diff --git a/boards.txt b/boards.txt index 281d8d2..7d4971c 100644 --- a/boards.txt +++ b/boards.txt @@ -23,11 +23,11 @@ idiBus.upload_port.5.vid=0x2341 idiBus.upload_port.5.pid=0x0242 idiBus.upload_port.6.board=mboard5v -idiBus.upload.tool=arduino:avrdude +idiBus.upload.tool=avrdude idiBus.upload.tool.default=avrdude idiBus.upload.maximum_data_size=8192 -idiBus.bootloader.tool=arduino:avrdude +idiBus.bootloader.tool=avrdude idiBus.bootloader.tool.default=avrdude idiBus.bootloader.low_fuses=0xFF idiBus.bootloader.unlock_bits=0x3F @@ -35,7 +35,7 @@ idiBus.bootloader.lock_bits=0xFF idiBus.build.f_cpu=16000000L idiBus.build.variant=mboard5v -idiBus.build.core=arduino:arduino +idiBus.build.core=idiBus # default board may be overridden by the cpu menu idiBus.build.board=AVR_MEGA2560 diff --git a/cores/arduino/Arduino.h b/cores/idiBus/Arduino.h similarity index 100% rename from cores/arduino/Arduino.h rename to cores/idiBus/Arduino.h diff --git a/cores/arduino/CDC.cpp b/cores/idiBus/CDC.cpp similarity index 100% rename from cores/arduino/CDC.cpp rename to cores/idiBus/CDC.cpp diff --git a/cores/arduino/Client.h b/cores/idiBus/Client.h similarity index 100% rename from cores/arduino/Client.h rename to cores/idiBus/Client.h diff --git a/cores/arduino/HardwareSerial.cpp b/cores/idiBus/HardwareSerial.cpp similarity index 100% rename from cores/arduino/HardwareSerial.cpp rename to cores/idiBus/HardwareSerial.cpp diff --git a/cores/arduino/HardwareSerial.h b/cores/idiBus/HardwareSerial.h similarity index 100% rename from cores/arduino/HardwareSerial.h rename to cores/idiBus/HardwareSerial.h diff --git a/cores/arduino/HardwareSerial0.cpp b/cores/idiBus/HardwareSerial0.cpp similarity index 100% rename from cores/arduino/HardwareSerial0.cpp rename to cores/idiBus/HardwareSerial0.cpp diff --git a/cores/arduino/HardwareSerial1.cpp b/cores/idiBus/HardwareSerial1.cpp similarity index 100% rename from cores/arduino/HardwareSerial1.cpp rename to cores/idiBus/HardwareSerial1.cpp diff --git a/cores/arduino/HardwareSerial2.cpp b/cores/idiBus/HardwareSerial2.cpp similarity index 100% rename from cores/arduino/HardwareSerial2.cpp rename to cores/idiBus/HardwareSerial2.cpp diff --git a/cores/arduino/HardwareSerial3.cpp b/cores/idiBus/HardwareSerial3.cpp similarity index 100% rename from cores/arduino/HardwareSerial3.cpp rename to cores/idiBus/HardwareSerial3.cpp diff --git a/cores/arduino/HardwareSerial_private.h b/cores/idiBus/HardwareSerial_private.h similarity index 100% rename from cores/arduino/HardwareSerial_private.h rename to cores/idiBus/HardwareSerial_private.h diff --git a/cores/arduino/IPAddress.cpp b/cores/idiBus/IPAddress.cpp similarity index 100% rename from cores/arduino/IPAddress.cpp rename to cores/idiBus/IPAddress.cpp diff --git a/cores/arduino/IPAddress.h b/cores/idiBus/IPAddress.h similarity index 100% rename from cores/arduino/IPAddress.h rename to cores/idiBus/IPAddress.h diff --git a/cores/arduino/PluggableUSB.cpp b/cores/idiBus/PluggableUSB.cpp similarity index 100% rename from cores/arduino/PluggableUSB.cpp rename to cores/idiBus/PluggableUSB.cpp diff --git a/cores/arduino/PluggableUSB.h b/cores/idiBus/PluggableUSB.h similarity index 100% rename from cores/arduino/PluggableUSB.h rename to cores/idiBus/PluggableUSB.h diff --git a/cores/arduino/Print.cpp b/cores/idiBus/Print.cpp similarity index 100% rename from cores/arduino/Print.cpp rename to cores/idiBus/Print.cpp diff --git a/cores/arduino/Print.h b/cores/idiBus/Print.h similarity index 100% rename from cores/arduino/Print.h rename to cores/idiBus/Print.h diff --git a/cores/arduino/Printable.h b/cores/idiBus/Printable.h similarity index 100% rename from cores/arduino/Printable.h rename to cores/idiBus/Printable.h diff --git a/cores/arduino/Server.h b/cores/idiBus/Server.h similarity index 100% rename from cores/arduino/Server.h rename to cores/idiBus/Server.h diff --git a/cores/arduino/Stream.cpp b/cores/idiBus/Stream.cpp similarity index 100% rename from cores/arduino/Stream.cpp rename to cores/idiBus/Stream.cpp diff --git a/cores/arduino/Stream.h b/cores/idiBus/Stream.h similarity index 100% rename from cores/arduino/Stream.h rename to cores/idiBus/Stream.h diff --git a/cores/arduino/Tone.cpp b/cores/idiBus/Tone.cpp similarity index 100% rename from cores/arduino/Tone.cpp rename to cores/idiBus/Tone.cpp diff --git a/cores/arduino/USBAPI.h b/cores/idiBus/USBAPI.h similarity index 100% rename from cores/arduino/USBAPI.h rename to cores/idiBus/USBAPI.h diff --git a/cores/arduino/USBCore.cpp b/cores/idiBus/USBCore.cpp similarity index 100% rename from cores/arduino/USBCore.cpp rename to cores/idiBus/USBCore.cpp diff --git a/cores/arduino/USBCore.h b/cores/idiBus/USBCore.h similarity index 100% rename from cores/arduino/USBCore.h rename to cores/idiBus/USBCore.h diff --git a/cores/arduino/USBDesc.h b/cores/idiBus/USBDesc.h similarity index 100% rename from cores/arduino/USBDesc.h rename to cores/idiBus/USBDesc.h diff --git a/cores/arduino/Udp.h b/cores/idiBus/Udp.h similarity index 100% rename from cores/arduino/Udp.h rename to cores/idiBus/Udp.h diff --git a/cores/arduino/WCharacter.h b/cores/idiBus/WCharacter.h similarity index 100% rename from cores/arduino/WCharacter.h rename to cores/idiBus/WCharacter.h diff --git a/cores/arduino/WInterrupts.c b/cores/idiBus/WInterrupts.c similarity index 100% rename from cores/arduino/WInterrupts.c rename to cores/idiBus/WInterrupts.c diff --git a/cores/arduino/WMath.cpp b/cores/idiBus/WMath.cpp similarity index 100% rename from cores/arduino/WMath.cpp rename to cores/idiBus/WMath.cpp diff --git a/cores/arduino/WString.cpp b/cores/idiBus/WString.cpp similarity index 100% rename from cores/arduino/WString.cpp rename to cores/idiBus/WString.cpp diff --git a/cores/arduino/WString.h b/cores/idiBus/WString.h similarity index 100% rename from cores/arduino/WString.h rename to cores/idiBus/WString.h diff --git a/cores/arduino/abi.cpp b/cores/idiBus/abi.cpp similarity index 100% rename from cores/arduino/abi.cpp rename to cores/idiBus/abi.cpp diff --git a/cores/arduino/binary.h b/cores/idiBus/binary.h similarity index 100% rename from cores/arduino/binary.h rename to cores/idiBus/binary.h diff --git a/cores/arduino/hooks.c b/cores/idiBus/hooks.c similarity index 100% rename from cores/arduino/hooks.c rename to cores/idiBus/hooks.c diff --git a/cores/arduino/main.cpp b/cores/idiBus/main.cpp similarity index 100% rename from cores/arduino/main.cpp rename to cores/idiBus/main.cpp diff --git a/cores/arduino/new b/cores/idiBus/new similarity index 100% rename from cores/arduino/new rename to cores/idiBus/new diff --git a/cores/arduino/new.cpp b/cores/idiBus/new.cpp similarity index 100% rename from cores/arduino/new.cpp rename to cores/idiBus/new.cpp diff --git a/cores/arduino/new.h b/cores/idiBus/new.h similarity index 100% rename from cores/arduino/new.h rename to cores/idiBus/new.h diff --git a/cores/arduino/wiring.c b/cores/idiBus/wiring.c similarity index 100% rename from cores/arduino/wiring.c rename to cores/idiBus/wiring.c diff --git a/cores/arduino/wiring_analog.c b/cores/idiBus/wiring_analog.c similarity index 100% rename from cores/arduino/wiring_analog.c rename to cores/idiBus/wiring_analog.c diff --git a/cores/arduino/wiring_digital.c b/cores/idiBus/wiring_digital.c similarity index 100% rename from cores/arduino/wiring_digital.c rename to cores/idiBus/wiring_digital.c diff --git a/cores/arduino/wiring_private.h b/cores/idiBus/wiring_private.h similarity index 100% rename from cores/arduino/wiring_private.h rename to cores/idiBus/wiring_private.h diff --git a/cores/arduino/wiring_pulse.S b/cores/idiBus/wiring_pulse.S similarity index 100% rename from cores/arduino/wiring_pulse.S rename to cores/idiBus/wiring_pulse.S diff --git a/cores/arduino/wiring_pulse.c b/cores/idiBus/wiring_pulse.c similarity index 100% rename from cores/arduino/wiring_pulse.c rename to cores/idiBus/wiring_pulse.c diff --git a/cores/arduino/wiring_shift.c b/cores/idiBus/wiring_shift.c similarity index 100% rename from cores/arduino/wiring_shift.c rename to cores/idiBus/wiring_shift.c diff --git a/libraries/idiBusMaster/src/IdiBusSerialDefs.h b/libraries/idiBusMaster/src/IdiBusSerialDefs.h index 778d4d8..e487235 100644 --- a/libraries/idiBusMaster/src/IdiBusSerialDefs.h +++ b/libraries/idiBusMaster/src/IdiBusSerialDefs.h @@ -4,7 +4,7 @@ //------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- #include "IdiBusSystem.h" //------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -#if defined (__AVR_ATmega2560__) +#if defined (__AVR_ATmega2560__) || (__AVR_ATmega1280__) #define USARTN_UCSRNA_RXC_Pos 7U #define USARTN_UCSRNA_TXC_Pos 6U #define USARTN_UCSRNA_UDR_Pos 5U diff --git a/platform.txt b/platform.txt new file mode 100644 index 0000000..df5ddb7 --- /dev/null +++ b/platform.txt @@ -0,0 +1,142 @@ + +# Arduino AVR Core and platform. +# ------------------------------ +# +# For more info: +# https://arduino.github.io/arduino-cli/latest/platform-specification/ + +name=Arduino AVR Boards +version=1.8.6 + +# AVR compile variables +# --------------------- + +compiler.warning_flags=-w +compiler.warning_flags.none=-w +compiler.warning_flags.default= +compiler.warning_flags.more=-Wall +compiler.warning_flags.all=-Wall -Wextra + +# Default "compiler.path" is correct, change only if you want to override the initial value +compiler.path={runtime.tools.avr-gcc.path}/bin/ +compiler.c.cmd=avr-gcc +compiler.c.flags=-c -g -Os {compiler.warning_flags} -std=gnu11 -ffunction-sections -fdata-sections -MMD -flto -fno-fat-lto-objects +compiler.c.elf.flags={compiler.warning_flags} -Os -g -flto -fuse-linker-plugin -Wl,--gc-sections +compiler.c.elf.cmd=avr-gcc +compiler.S.flags=-c -g -x assembler-with-cpp -flto -MMD +compiler.cpp.cmd=avr-g++ +compiler.cpp.flags=-c -g -Os {compiler.warning_flags} -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto +compiler.ar.cmd=avr-gcc-ar +compiler.ar.flags=rcs +compiler.objcopy.cmd=avr-objcopy +compiler.objcopy.eep.flags=-O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0 +compiler.elf2hex.flags=-O ihex -R .eeprom +compiler.elf2hex.cmd=avr-objcopy +compiler.ldflags= +compiler.libraries.ldflags= +compiler.size.cmd=avr-size + +# This can be overridden in boards.txt +build.extra_flags= + +# These can be overridden in platform.local.txt +compiler.c.extra_flags= +compiler.c.elf.extra_flags= +compiler.S.extra_flags= +compiler.cpp.extra_flags= +compiler.ar.extra_flags= +compiler.objcopy.eep.extra_flags= +compiler.elf2hex.extra_flags= + +# AVR compile patterns +# -------------------- + +## Compile c files +recipe.c.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.c.flags} -mmcu={build.mcu} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.c.extra_flags} {build.extra_flags} {includes} "{source_file}" -o "{object_file}" + +## Compile c++ files +recipe.cpp.o.pattern="{compiler.path}{compiler.cpp.cmd}" {compiler.cpp.flags} -mmcu={build.mcu} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.cpp.extra_flags} {build.extra_flags} {includes} "{source_file}" -o "{object_file}" + +## Compile S files +recipe.S.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.S.flags} -mmcu={build.mcu} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.S.extra_flags} {build.extra_flags} {includes} "{source_file}" -o "{object_file}" + +## Create archives +# archive_file_path is needed for backwards compatibility with IDE 1.6.5 or older, IDE 1.6.6 or newer overrides this value +archive_file_path={build.path}/{archive_file} +recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{archive_file_path}" "{object_file}" + +## Combine gc-sections, archives, and objects +recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" {compiler.c.elf.flags} -mmcu={build.mcu} {compiler.c.elf.extra_flags} {compiler.ldflags} -o "{build.path}/{build.project_name}.elf" {object_files} {compiler.libraries.ldflags} "{build.path}/{archive_file}" "-L{build.path}" -lm + +## Create output files (.eep and .hex) +recipe.objcopy.eep.pattern="{compiler.path}{compiler.objcopy.cmd}" {compiler.objcopy.eep.flags} {compiler.objcopy.eep.extra_flags} "{build.path}/{build.project_name}.elf" "{build.path}/{build.project_name}.eep" +recipe.objcopy.hex.pattern="{compiler.path}{compiler.elf2hex.cmd}" {compiler.elf2hex.flags} {compiler.elf2hex.extra_flags} "{build.path}/{build.project_name}.elf" "{build.path}/{build.project_name}.hex" + +## Save hex +recipe.output.tmp_file={build.project_name}.hex +recipe.output.save_file={build.project_name}.{build.variant}.hex + +## Compute size +recipe.size.pattern="{compiler.path}{compiler.size.cmd}" -A "{build.path}/{build.project_name}.elf" +recipe.size.regex=^(?:\.text|\.data|\.bootloader)\s+([0-9]+).* +recipe.size.regex.data=^(?:\.data|\.bss|\.noinit)\s+([0-9]+).* +recipe.size.regex.eeprom=^(?:\.eeprom)\s+([0-9]+).* + +## Preprocessor +preproc.includes.flags=-w -x c++ -M -MG -MP +recipe.preproc.includes="{compiler.path}{compiler.cpp.cmd}" {compiler.cpp.flags} {preproc.includes.flags} -mmcu={build.mcu} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.cpp.extra_flags} {build.extra_flags} {includes} "{source_file}" + +preproc.macros.flags=-w -x c++ -E -CC +recipe.preproc.macros="{compiler.path}{compiler.cpp.cmd}" {compiler.cpp.flags} {preproc.macros.flags} -mmcu={build.mcu} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.cpp.extra_flags} {build.extra_flags} {includes} "{source_file}" -o "{preprocessed_file_path}" + +# Required discoveries and monitors +# --------------------------------- +pluggable_discovery.required.0=builtin:serial-discovery +pluggable_discovery.required.1=builtin:mdns-discovery +pluggable_monitor.required.serial=builtin:serial-monitor + +# AVR Uploader/Programmers tools +# ------------------------------ + +tools.avrdude.path={runtime.tools.avrdude.path} +tools.avrdude.cmd.path={path}/bin/avrdude +tools.avrdude.config.path={path}/etc/avrdude.conf + +tools.avrdude.upload.params.verbose=-v +tools.avrdude.upload.params.quiet=-q -q +# tools.avrdude.upload.verify is needed for backwards compatibility with IDE 1.6.8 or older, IDE 1.6.9 or newer overrides this value +tools.avrdude.upload.verify= +tools.avrdude.upload.params.noverify=-V +tools.avrdude.upload.pattern="{cmd.path}" "-C{config.path}" {upload.verbose} {upload.verify} -p{build.mcu} -c{upload.protocol} "-P{serial.port}" -b{upload.speed} -D "-Uflash:w:{build.path}/{build.project_name}.hex:i" + +tools.avrdude.program.params.verbose=-v +tools.avrdude.program.params.quiet=-q -q +# tools.avrdude.program.verify is needed for backwards compatibility with IDE 1.6.8 or older, IDE 1.6.9 or newer overrides this value +tools.avrdude.program.verify= +tools.avrdude.program.params.noverify=-V +tools.avrdude.program.pattern="{cmd.path}" "-C{config.path}" {program.verbose} {program.verify} -p{build.mcu} -c{protocol} {program.extra_params} "-Uflash:w:{build.path}/{build.project_name}.hex:i" + +tools.avrdude.erase.params.verbose=-v +tools.avrdude.erase.params.quiet=-q -q +tools.avrdude.erase.pattern="{cmd.path}" "-C{config.path}" {erase.verbose} -p{build.mcu} -c{protocol} {program.extra_params} -e -Ulock:w:{bootloader.unlock_bits}:m -Uefuse:w:{bootloader.extended_fuses}:m -Uhfuse:w:{bootloader.high_fuses}:m -Ulfuse:w:{bootloader.low_fuses}:m + +tools.avrdude.bootloader.params.verbose=-v +tools.avrdude.bootloader.params.quiet=-q -q +tools.avrdude.bootloader.pattern="{cmd.path}" "-C{config.path}" {bootloader.verbose} -p{build.mcu} -c{protocol} {program.extra_params} "-Uflash:w:{runtime.platform.path}/bootloaders/{bootloader.file}:i" -Ulock:w:{bootloader.lock_bits}:m + +tools.avrdude_remote.upload.pattern=/usr/bin/run-avrdude /tmp/sketch.hex {upload.verbose} -p{build.mcu} + +# The following rule is deprecated by pluggable discovery. +# We keep it to avoid breaking compatibility with the Arduino Java IDE. +tools.avrdude.network_cmd={runtime.tools.arduinoOTA.path}/bin/arduinoOTA +tools.avrdude.upload.network_pattern="{network_cmd}" -address {serial.port} -port {upload.network.port} -sketch "{build.path}/{build.project_name}.hex" -upload {upload.network.endpoint_upload} -sync {upload.network.endpoint_sync} -reset {upload.network.endpoint_reset} -sync_exp {upload.network.sync_return} + +# arduino ota +tools.arduino_ota.cmd={runtime.tools.arduinoOTA.path}/bin/arduinoOTA +tools.arduino_ota.upload.pattern="{cmd}" -address {upload.port.address} -port {upload.port.properties.port} -sketch "{build.path}/{build.project_name}.hex" -upload {upload.port.properties.endpoint_upload} -sync {upload.port.properties.endpoint_sync} -reset {upload.port.properties.endpoint_reset} -sync_exp {upload.port.properties.sync_return} + +# USB Default Flags +# Default blank usb manufacturer will be filled in at compile time +# - from numeric vendor ID, set to Unknown otherwise +build.usb_manufacturer="Unknown" +build.usb_flags=-DUSB_VID={build.vid} -DUSB_PID={build.pid} '-DUSB_MANUFACTURER={build.usb_manufacturer}' '-DUSB_PRODUCT={build.usb_product}'