diff --git a/devel/arduino/Makefile b/devel/arduino/Makefile index caec5626f34e..c1f5614fd27b 100644 --- a/devel/arduino/Makefile +++ b/devel/arduino/Makefile @@ -1,120 +1,117 @@ PORTNAME= arduino PORTVERSION= 1.0.6 -PORTREVISION= 4 +PORTREVISION= 5 PORTEPOCH= 1 CATEGORIES= devel java lang MASTER_SITES= https://arduino.cc/download.php?f=/ DISTNAME= ${PORTNAME}-${PORTVERSION}-linux32 MAINTAINER= leres@FreeBSD.org COMMENT= Open-source electronics prototyping platform WWW= https://www.arduino.cc/ LICENSE= GPLv2 LGPL21 LICENSE_COMB= multi # Confirmed for ARCHS below. Arm and PowerPC untested. (Feedback welcome) ONLY_FOR_ARCHS= amd64 i386 RUN_DEPENDS= ${JAVA_HOME}/jre/lib/ext/RXTXcomm.jar:comms/rxtx \ ${LOCALBASE}/bin/avrdude:devel/avrdude \ ${LOCALBASE}/avr/include/avr/io.h:devel/avr-libc WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION} USES= dos2unix tar:tgz kmod DOS2UNIX_REGEX= .*(\.(c|cpp|h|hex|txt)|Makefile|makefile) USE_JAVA= yes JAVA_OS= native JAVA_VENDOR= openjdk JAVA_RUN= yes CONFLICTS_INSTALL= arduino18 NO_BUILD= yes USE_LDCONFIG= ${PREFIX}/arduino/lib PLIST_SUB= ARCH=${ARCH:S|i386||:S|amd64|64|} SUB_FILES= arduino pkg-message SUB_LIST= PORTNAME=${PORTNAME} LINUXBASE=${PREFIX} REINPLACE_ARGS= -i "" DESKTOP_ENTRIES= "Arduino" "Arduino IDE" \ ${PREFIX}/${PORTNAME}/logo.png \ "arduino" "Development;IDE;" false OPTIONS_DEFINE= ATMEGA644P DOCS EXAMPLES UARDUNO OPTIONS_SUB= -ATMEGA644P_DESC= ATmega644p patches +ATMEGA644P_DESC= ATmega644p/ATmega1284p patches DOCS_DESC= Install the reference documents UARDUNO_DESC= Kernel module for Arduino Uno USB interface INSLIST= arduino hardware lib libraries logo.png revisions.txt tools +ATMEGA644P_EXTRA_PATCHES= \ + ${FILESDIR}/extrapatch-hardware_arduino_boards.txt \ + ${FILESDIR}/extrapatch-hardware_arduino_cores_arduino_WInterrupts.c \ + ${FILESDIR}/extrapatch-hardware_arduino_variants_atmega644p_pins__arduino.h + # Add serial drivers for those who are new to this. UARDUNO_RUN_DEPENDS+= ${KMODDIR}/uarduno.ko:comms/uarduno -.include +pre-patch-ATMEGA644P-on: + ${MKDIR} ${WRKSRC}/hardware/arduino/variants/atmega644p -.if ${PORT_OPTIONS:MATMEGA644P} -EXTRA_PATCHES+= \ - ${FILESDIR}/extrapatch-hardware-arduino-boards.txt \ - ${FILESDIR}/extrapatch-hardware-arduino-cores-arduino-WInterrupts.c \ - ${FILESDIR}/extrapatch-hardware-arduino-variants-atmega644p-pins_arduino.h -.endif +.include .if ! empty(PORT_OPTIONS:MDOCS) INSLIST+= reference .endif FIND_EXCLUDES= ! -name *.orig .if empty(PORT_OPTIONS:MEXAMPLES) FIND_EXCLUDES+= ! -path */examples ! -path */examples/* .else INSLIST+= examples .endif FIND_EXPR= "${FIND_EXCLUDES} -prune" -.if ${PORT_OPTIONS:MATMEGA644P} -pre-patch: - @${MKDIR} ${WRKSRC}/hardware/arduino/variants/atmega644p -.endif - post-patch: - @${RM} -r ${WRKSRC}/hardware/tools/ - @${MKDIR} ${WRKSRC}/hardware/tools/avr/ - @${LN} -s ${PREFIX}/bin ${WRKSRC}/hardware/tools/avr/bin - @${LN} -s ${PREFIX}/etc ${WRKSRC}/hardware/tools/avr/etc + ${RM} -r ${WRKSRC}/hardware/tools/ + ${MKDIR} ${WRKSRC}/hardware/tools/avr/ + ${LN} -s ${PREFIX}/bin ${WRKSRC}/hardware/tools/avr/bin + ${LN} -s ${PREFIX}/etc ${WRKSRC}/hardware/tools/avr/etc # Remove broken jar, and Linux C6 based libraries. - @${RM} ${WRKSRC}/lib/RXTXcomm.jar + ${RM} ${WRKSRC}/lib/RXTXcomm.jar # This port relys on comms/RXTX working without Linux C6 compatibility. - @${RM} ${WRKSRC}/lib/librxtxSerial.so - @${RM} ${WRKSRC}/lib/librxtxSerial64.so + ${RM} ${WRKSRC}/lib/librxtxSerial.so + ${RM} ${WRKSRC}/lib/librxtxSerial64.so # Map the RXTX port for our use - @${LN} -s ${JAVA_HOME}/jre/lib/ext/RXTXcomm.jar ${WRKSRC}/lib/RXTXcomm.jar + ${LN} -s ${JAVA_HOME}/jre/lib/ext/RXTXcomm.jar ${WRKSRC}/lib/RXTXcomm.jar # Add in links to the libraries compiled in RXTX for the above jar to use based on architecture. .if ${ARCH} == i386 - @${LN} -s ${JAVA_HOME}/jre/lib/i386/librxtxSerial.so ${WRKSRC}/lib/librxtxSerial.so + ${LN} -s ${JAVA_HOME}/jre/lib/i386/librxtxSerial.so ${WRKSRC}/lib/librxtxSerial.so .endif .if ${ARCH} == amd64 - @${LN} -s ${JAVA_HOME}/jre/lib/amd64/librxtxSerial.so ${WRKSRC}/lib/librxtxSerial64.so + ${LN} -s ${JAVA_HOME}/jre/lib/amd64/librxtxSerial.so ${WRKSRC}/lib/librxtxSerial64.so .endif - @${MV} ${WRKSRC}/reference/img/logo.png ${WRKSRC}/ - @${RM} -r ${WRKSRC}/reference/img/ + ${MV} ${WRKSRC}/reference/img/logo.png ${WRKSRC}/ + ${RM} -r ${WRKSRC}/reference/img/ do-install: ${MKDIR} ${STAGEDIR}${PREFIX}/${PORTNAME} - (cd ${WRKSRC}/ && ${COPYTREE_SHARE} "${INSLIST}" ${STAGEDIR}${PREFIX}/${PORTNAME} ${FIND_EXPR}) + (cd ${WRKSRC}/ && ${COPYTREE_SHARE} "${INSLIST}" ${STAGEDIR}${PREFIX}/${PORTNAME} \ + ${FIND_EXPR}) ${INSTALL_SCRIPT} ${WRKDIR}/arduino ${STAGEDIR}${PREFIX}/bin/ .include diff --git a/devel/arduino/files/extrapatch-hardware-arduino-boards.txt b/devel/arduino/files/extrapatch-hardware-arduino-boards.txt deleted file mode 100644 index 3fa8bc21ff78..000000000000 --- a/devel/arduino/files/extrapatch-hardware-arduino-boards.txt +++ /dev/null @@ -1,27 +0,0 @@ ---- hardware/arduino/boards.txt.orig 2017-03-15 17:34:53 UTC -+++ hardware/arduino/boards.txt -@@ -525,6 +525,24 @@ atmega8.build.variant=standard - - ############################################################## - -+atmega644.name=ATmega644 -+atmega644.upload.protocol=stk500 -+atmega644.upload.maximum_size=63488 -+atmega644.upload.speed=38400 -+atmega644.bootloader.low_fuses=0xFF -+atmega644.bootloader.high_fuses=0xDC -+atmega644.bootloader.extended_fuses=0xFD -+atmega644.bootloader.path=atmega644p -+atmega644.bootloader.file=atmega644p -+atmega644.bootloader.unlock_bits=0x3F -+atmega644.bootloader.lock_bits=0x0F -+atmega644.build.mcu=atmega644p -+atmega644.build.f_cpu=16000000L -+atmega644.build.core=atmega644 -+atmega644.build.variant=atmega644p -+ -+############################################################## -+ - robotControl.name=Arduino Robot Control - robotControl.upload.protocol=avr109 - robotControl.upload.maximum_size=28672 diff --git a/devel/arduino/files/extrapatch-hardware-arduino-boards.txt-arlcd b/devel/arduino/files/extrapatch-hardware-arduino-boards.txt-arlcd deleted file mode 100644 index 97cc41ece469..000000000000 --- a/devel/arduino/files/extrapatch-hardware-arduino-boards.txt-arlcd +++ /dev/null @@ -1,23 +0,0 @@ ---- hardware/arduino/boards.txt.orig 2013-07-14 10:31:43.000000000 -0700 -+++ hardware/arduino/boards.txt 2013-07-21 12:43:56.000000000 -0700 -@@ -601,3 +601,20 @@ - robotMotor.build.core=robot - robotMotor.build.variant=robot_motor - -+############################################################## -+ -+arlcd.name=EarthLCD arLCD -+arlcd.upload.protocol=arduino -+arlcd.upload.maximum_size=32256 -+arlcd.upload.speed=115200 -+arlcd.bootloader.low_fuses=0xff -+arlcd.bootloader.high_fuses=0xde -+arlcd.bootloader.extended_fuses=0x05 -+arlcd.bootloader.path=optiboot -+arlcd.bootloader.file=optiboot_atmega328.hex -+arlcd.bootloader.unlock_bits=0x3F -+arlcd.bootloader.lock_bits=0x0F -+arlcd.build.mcu=atmega328 -+arlcd.build.f_cpu=16000000L -+arlcd.build.core=arduino -+arlcd.build.variant=standard diff --git a/devel/arduino/files/extrapatch-hardware_arduino_boards.txt b/devel/arduino/files/extrapatch-hardware_arduino_boards.txt new file mode 100644 index 000000000000..51d32c307b06 --- /dev/null +++ b/devel/arduino/files/extrapatch-hardware_arduino_boards.txt @@ -0,0 +1,43 @@ +--- hardware/arduino/boards.txt.orig 2024-01-29 02:52:44 UTC ++++ hardware/arduino/boards.txt +@@ -565,3 +565,40 @@ robotMotor.build.pid=0x8039 + robotMotor.build.core=robot + robotMotor.build.variant=robot_motor + ++############################################################## ++ ++atmega644.name=ATmega644 ++atmega644.upload.protocol=stk500 ++atmega644.upload.maximum_size=63488 ++atmega644.upload.speed=38400 ++atmega644.bootloader.low_fuses=0xFF ++atmega644.bootloader.high_fuses=0xDC ++atmega644.bootloader.extended_fuses=0xFD ++atmega644.bootloader.path=atmega644p ++atmega644.bootloader.file=atmega644p ++atmega644.bootloader.unlock_bits=0x3F ++atmega644.bootloader.lock_bits=0x0F ++atmega644.build.mcu=atmega644p ++atmega644.build.f_cpu=16000000L ++atmega644.build.core=atmega644 ++atmega644.build.variant=atmega644p ++ ++############################################################## ++ ++atmega1284.name=ATmega1284 ++atmega1284.upload.protocol=stk500 ++atmega1284.upload.maximum_size=129024 ++atmega1284.upload.speed=38400 ++atmega1284.bootloader.low_fuses=0xFF ++atmega1284.bootloader.high_fuses=0xDC ++atmega1284.bootloader.extended_fuses=0xFD ++atmega1284.bootloader.path=atmega1284p ++atmega1284.bootloader.file=atmega1284p ++atmega1284.bootloader.unlock_bits=0x3F ++atmega1284.bootloader.lock_bits=0x0F ++atmega1284.build.mcu=atmega1284p ++atmega1284.build.f_cpu=16000000L ++atmega1284.build.core=atmega1284 ++atmega1284.build.variant=atmega644p ++ ++############################################################## diff --git a/devel/arduino/files/extrapatch-hardware-arduino-cores-arduino-WInterrupts.c b/devel/arduino/files/extrapatch-hardware_arduino_cores_arduino_WInterrupts.c similarity index 100% rename from devel/arduino/files/extrapatch-hardware-arduino-cores-arduino-WInterrupts.c rename to devel/arduino/files/extrapatch-hardware_arduino_cores_arduino_WInterrupts.c diff --git a/devel/arduino/files/extrapatch-hardware-arduino-variants-atmega644p-pins_arduino.h b/devel/arduino/files/extrapatch-hardware_arduino_variants_atmega644p_pins__arduino.h similarity index 94% rename from devel/arduino/files/extrapatch-hardware-arduino-variants-atmega644p-pins_arduino.h rename to devel/arduino/files/extrapatch-hardware_arduino_variants_atmega644p_pins__arduino.h index 2035d4aa45df..7e70247eb6e4 100644 --- a/devel/arduino/files/extrapatch-hardware-arduino-variants-atmega644p-pins_arduino.h +++ b/devel/arduino/files/extrapatch-hardware_arduino_variants_atmega644p_pins__arduino.h @@ -1,227 +1,232 @@ ---- /dev/null 2012-12-26 20:59:44.000000000 -0800 -+++ hardware/arduino/variants/atmega644p/pins_arduino.h 2012-12-26 21:12:00.000000000 -0800 -@@ -0,0 +1,224 @@ +--- hardware/arduino/variants/atmega644p/pins_arduino.h.orig 2024-01-29 03:40:21 UTC ++++ hardware/arduino/variants/atmega644p/pins_arduino.h +@@ -0,0 +1,229 @@ +/* + pins_arduino.h - Pin definition functions for Arduino + Part of Arduino - http://www.arduino.cc/ + + Copyright (c) 2007 David A. Mellis + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General + Public License along with this library; if not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, + Boston, MA 02111-1307 USA + -+ $Id: pins_arduino.h 5 2012-07-30 03:39:31Z leres $ ++ $Id: pins_arduino.h,v 1.2 2021/06/20 20:01:08 leres Exp $ +*/ + +#ifndef Pins_Arduino_h +#define Pins_Arduino_h + +#include + +#define NUM_DIGITAL_PINS 32 +#define NUM_ANALOG_INPUTS 8 +#define analogInputToDigitalPin(p) ((p < 8) ? ((p) - 7) + 24 : -1) +#define digitalPinHasPWM(p) \ + ((p) == 4 || (p) == 5 || (p) == 12 || (p) == 13 || (p) == 14 || (p) == 15) + +static const uint8_t SS = 4; +static const uint8_t MOSI = 5; +static const uint8_t MISO = 6; +static const uint8_t SCK = 7; +static const uint8_t SCL = 16; +static const uint8_t SDA = 17; + +static const uint8_t A0 = 14; +static const uint8_t A1 = 15; +static const uint8_t A2 = 16; +static const uint8_t A3 = 17; +static const uint8_t A4 = 18; +static const uint8_t A5 = 19; +static const uint8_t A6 = 20; +static const uint8_t A7 = 21; + +#ifdef notdef +/* XXX not yet */ +#define digitalPinToPCICR(p) (((p) >= 0 && (p) <= 21) ? (&PCICR) : ((uint8_t *)0)) +#define digitalPinToPCICRbit(p) (((p) <= 7) ? 2 : (((p) <= 13) ? 0 : 1)) +#define digitalPinToPCMSK(p) (((p) <= 7) ? (&PCMSK2) : (((p) <= 13) ? (&PCMSK0) : (((p) <= 21) ? (&PCMSK1) : ((uint8_t *)0)))) +#define digitalPinToPCMSKbit(p) (((p) <= 7) ? (p) : (((p) <= 13) ? ((p) - 8) : ((p) - 14))) +#endif + ++#define digitalPinToInterrupt(p) \ ++ ((p) == 2 ? 2 : \ ++ ((p) == 10 ? 0 : \ ++ ((p) == 11 ? 1 : NOT_AN_INTERRUPT))) ++ +#ifdef ARDUINO_MAIN + +// Digital pins are also used for the analog output (software PWM). +// Analog input pins are a separate set. + +// ATMEL ATMEGA644P +// +// +---\/---+ +// (D 0) PB0 1| |40 PA0 (AI 0) +// (D 1) PB1 2| |39 PA1 (AI 1) +// (D 2) PB2 3| |38 PA2 (AI 2) +// (D 3) PB3 4| |37 PA3 (AI 3) +// PWM (D 4) PB4 5| |36 PA4 (AI 4) +// PWM (D 5) PB5 6| |35 PA5 (AI 5) +// (D 6) PB6 7| |34 PA6 (AI 6) +// PB7 8| |33 PA7 (AI 7) +// RESET 9| |32 AREF +// VCC 10| |31 GND +// GND 11| |30 AVCC +// XTAL2 12| |29 PC7 (D 23) +// XTAL1 13| |28 PC6 (D 22) +// (D 8) PD0 14| |27 PC5 (D 21) +// (D 9) PD1 15| |26 PC4 (D 20) +// (D 10) PD2 16| |25 PC3 (D 19) +// (D 11) PD3 17| |24 PC2 (D 18) +// PWM (D 12) PD4 18| |23 PC1 (D 17) +// PWM (D 13) PD5 19| |22 PC0 (D 16) +// PWM (D 14) PD6 20| |21 PD7 (D 15) PWM +// +--------+ + +// these arrays map port names (e.g. port B) to the +// appropriate addresses for various functions (e.g. reading +// and writing) +const uint16_t PROGMEM port_to_mode_PGM[] = { + NOT_A_PORT, + (uint16_t) &DDRA, + (uint16_t) &DDRB, + (uint16_t) &DDRC, + (uint16_t) &DDRD, +}; + +const uint16_t PROGMEM port_to_output_PGM[] = { + NOT_A_PORT, + (uint16_t) &PORTA, + (uint16_t) &PORTB, + (uint16_t) &PORTC, + (uint16_t) &PORTD, +}; + +const uint16_t PROGMEM port_to_input_PGM[] = { + NOT_A_PORT, + (uint16_t) &PINA, + (uint16_t) &PINB, + (uint16_t) &PINC, + (uint16_t) &PIND, +}; + +const uint8_t PROGMEM digital_pin_to_port_PGM[] = { + PB, /* 0 */ + PB, + PB, + PB, + PB, + PB, + PB, + PB, + PD, /* 8 */ + PD, + PD, + PD, + PD, + PD, + PD, + PD, + PC, /* 16 */ + PC, + PC, + PC, + PC, + PC, + PC, + PC, + PA, /* 24 */ + PA, + PA, + PA, + PA, + PA, + PA, + PA /* 31 */ +}; + +const uint8_t PROGMEM digital_pin_to_bit_mask_PGM[] = { + _BV(0), /* 0, port B */ + _BV(1), + _BV(2), + _BV(3), + _BV(4), + _BV(5), + _BV(6), + _BV(7), + _BV(0), /* 8, port D */ + _BV(1), + _BV(2), + _BV(3), + _BV(4), + _BV(5), + _BV(6), + _BV(7), + _BV(0), /* 16, port C */ + _BV(1), + _BV(2), + _BV(3), + _BV(4), + _BV(5), + _BV(6), + _BV(7), + _BV(7), /* 24, port A */ + _BV(6), + _BV(5), + _BV(4), + _BV(3), + _BV(2), + _BV(1), + _BV(0) +}; + +const uint8_t PROGMEM digital_pin_to_timer_PGM[] = { + NOT_ON_TIMER, /* 0 - PB0 */ + NOT_ON_TIMER, /* 1 - PB1 */ + NOT_ON_TIMER, /* 2 - PB2 */ + TIMER0A, /* 3 - PB3 */ + TIMER0B, /* 4 - PB4 */ + NOT_ON_TIMER, /* 5 - PB5 */ + NOT_ON_TIMER, /* 6 - PB6 */ + NOT_ON_TIMER, /* 7 - PB7 */ + NOT_ON_TIMER, /* 8 - PD0 */ + NOT_ON_TIMER, /* 9 - PD1 */ + NOT_ON_TIMER, /* 10 - PD2 */ + NOT_ON_TIMER, /* 11 - PD3 */ + TIMER1B, /* 12 - PD4 */ + TIMER1A, /* 13 - PD5 */ + TIMER2B, /* 14 - PD6 */ + TIMER2A, /* 15 - PD7 */ + NOT_ON_TIMER, /* 16 - PC0 */ + NOT_ON_TIMER, /* 17 - PC1 */ + NOT_ON_TIMER, /* 18 - PC2 */ + NOT_ON_TIMER, /* 19 - PC3 */ + NOT_ON_TIMER, /* 20 - PC4 */ + NOT_ON_TIMER, /* 21 - PC5 */ + NOT_ON_TIMER, /* 22 - PC6 */ + NOT_ON_TIMER, /* 23 - PC7 */ + NOT_ON_TIMER, /* 24 - PA0 */ + NOT_ON_TIMER, /* 25 - PA1 */ + NOT_ON_TIMER, /* 26 - PA2 */ + NOT_ON_TIMER, /* 27 - PA3 */ + NOT_ON_TIMER, /* 28 - PA4 */ + NOT_ON_TIMER, /* 29 - PA5 */ + NOT_ON_TIMER, /* 30 - PA6 */ + NOT_ON_TIMER /* 31 - PA7 */ +}; + +#endif + +#endif diff --git a/devel/arduino/files/patch-hardware-arduino-cores-arduino-HardwareSerial.cpp b/devel/arduino/files/patch-hardware_arduino_cores_arduino_HardwareSerial.cpp similarity index 100% rename from devel/arduino/files/patch-hardware-arduino-cores-arduino-HardwareSerial.cpp rename to devel/arduino/files/patch-hardware_arduino_cores_arduino_HardwareSerial.cpp