From db3de678d9189a74f9b1cc6d7dcb3ed5b8f1d15f Mon Sep 17 00:00:00 2001 From: zs2hx Date: Sat, 20 Jun 2015 14:32:44 +0200 Subject: [PATCH] Compatible with newer Arduino format. Tested 'Original Mighty 1284p 8MHz' on 1284p - working. --- .gitignore => avr/.gitignore | 0 README.md => avr/README.md | 0 boards.txt => avr/boards.txt | 27 +++-- .../bootloaders}/optiboot/Makefile | 0 .../bootloaders}/optiboot/boot.h | 0 .../bootloaders}/optiboot/optiboot.c | 0 .../optiboot/optiboot_atmega1284p.hex | 0 .../optiboot/optiboot_atmega1284p.lst | 0 .../bootloaders}/optiboot/pin_defs.h | 0 .../bootloaders}/optiboot/stk500.h | 0 .../bootloaders}/standard/ATmegaBOOT.c | 0 .../standard/ATmegaBOOT_1284P.hex | 0 .../standard/ATmegaBOOT_1284P_8MHz.hex | 0 .../bootloaders}/standard/Makefile | 0 {cores => avr/cores}/standard/Arduino.h | 0 {cores => avr/cores}/standard/CDC.cpp | 0 {cores => avr/cores}/standard/Client.h | 0 {cores => avr/cores}/standard/HID.cpp | 0 .../cores}/standard/HardwareSerial.cpp | 0 .../cores}/standard/HardwareSerial.h | 0 {cores => avr/cores}/standard/IPAddress.cpp | 0 {cores => avr/cores}/standard/IPAddress.h | 0 {cores => avr/cores}/standard/Platform.h | 0 {cores => avr/cores}/standard/Print.cpp | 0 {cores => avr/cores}/standard/Print.h | 0 {cores => avr/cores}/standard/Printable.h | 0 {cores => avr/cores}/standard/Server.h | 0 {cores => avr/cores}/standard/Stream.cpp | 0 {cores => avr/cores}/standard/Stream.h | 0 {cores => avr/cores}/standard/Tone.cpp | 0 {cores => avr/cores}/standard/USBAPI.h | 0 {cores => avr/cores}/standard/USBCore.cpp | 0 {cores => avr/cores}/standard/USBCore.h | 0 {cores => avr/cores}/standard/USBDesc.h | 0 {cores => avr/cores}/standard/Udp.h | 0 {cores => avr/cores}/standard/WCharacter.h | 0 {cores => avr/cores}/standard/WInterrupts.c | 0 {cores => avr/cores}/standard/WMath.cpp | 0 {cores => avr/cores}/standard/WString.cpp | 0 {cores => avr/cores}/standard/WString.h | 0 {cores => avr/cores}/standard/binary.h | 0 {cores => avr/cores}/standard/main.cpp | 0 {cores => avr/cores}/standard/new.cpp | 0 {cores => avr/cores}/standard/new.h | 0 {cores => avr/cores}/standard/wiring.c | 0 {cores => avr/cores}/standard/wiring_analog.c | 0 .../cores}/standard/wiring_digital.c | 0 .../cores}/standard/wiring_private.h | 0 {cores => avr/cores}/standard/wiring_pulse.c | 0 {cores => avr/cores}/standard/wiring_shift.c | 0 avr/platform.txt | 113 ++++++++++++++++++ .../variants}/avr_developers/README | 0 .../variants}/avr_developers/pins_arduino.h | 0 {variants => avr/variants}/bobuino/pins.ods | Bin .../variants}/bobuino/pins_arduino.h | 0 .../variants}/standard/pins_arduino.h | 0 56 files changed, 130 insertions(+), 10 deletions(-) rename .gitignore => avr/.gitignore (100%) rename README.md => avr/README.md (100%) rename boards.txt => avr/boards.txt (80%) rename {bootloaders => avr/bootloaders}/optiboot/Makefile (100%) rename {bootloaders => avr/bootloaders}/optiboot/boot.h (100%) rename {bootloaders => avr/bootloaders}/optiboot/optiboot.c (100%) rename {bootloaders => avr/bootloaders}/optiboot/optiboot_atmega1284p.hex (100%) rename {bootloaders => avr/bootloaders}/optiboot/optiboot_atmega1284p.lst (100%) rename {bootloaders => avr/bootloaders}/optiboot/pin_defs.h (100%) rename {bootloaders => avr/bootloaders}/optiboot/stk500.h (100%) rename {bootloaders => avr/bootloaders}/standard/ATmegaBOOT.c (100%) rename {bootloaders => avr/bootloaders}/standard/ATmegaBOOT_1284P.hex (100%) rename {bootloaders => avr/bootloaders}/standard/ATmegaBOOT_1284P_8MHz.hex (100%) rename {bootloaders => avr/bootloaders}/standard/Makefile (100%) rename {cores => avr/cores}/standard/Arduino.h (100%) rename {cores => avr/cores}/standard/CDC.cpp (100%) rename {cores => avr/cores}/standard/Client.h (100%) rename {cores => avr/cores}/standard/HID.cpp (100%) rename {cores => avr/cores}/standard/HardwareSerial.cpp (100%) rename {cores => avr/cores}/standard/HardwareSerial.h (100%) rename {cores => avr/cores}/standard/IPAddress.cpp (100%) rename {cores => avr/cores}/standard/IPAddress.h (100%) rename {cores => avr/cores}/standard/Platform.h (100%) rename {cores => avr/cores}/standard/Print.cpp (100%) rename {cores => avr/cores}/standard/Print.h (100%) rename {cores => avr/cores}/standard/Printable.h (100%) rename {cores => avr/cores}/standard/Server.h (100%) rename {cores => avr/cores}/standard/Stream.cpp (100%) rename {cores => avr/cores}/standard/Stream.h (100%) rename {cores => avr/cores}/standard/Tone.cpp (100%) rename {cores => avr/cores}/standard/USBAPI.h (100%) rename {cores => avr/cores}/standard/USBCore.cpp (100%) rename {cores => avr/cores}/standard/USBCore.h (100%) rename {cores => avr/cores}/standard/USBDesc.h (100%) rename {cores => avr/cores}/standard/Udp.h (100%) rename {cores => avr/cores}/standard/WCharacter.h (100%) rename {cores => avr/cores}/standard/WInterrupts.c (100%) rename {cores => avr/cores}/standard/WMath.cpp (100%) rename {cores => avr/cores}/standard/WString.cpp (100%) rename {cores => avr/cores}/standard/WString.h (100%) rename {cores => avr/cores}/standard/binary.h (100%) rename {cores => avr/cores}/standard/main.cpp (100%) rename {cores => avr/cores}/standard/new.cpp (100%) rename {cores => avr/cores}/standard/new.h (100%) rename {cores => avr/cores}/standard/wiring.c (100%) rename {cores => avr/cores}/standard/wiring_analog.c (100%) rename {cores => avr/cores}/standard/wiring_digital.c (100%) rename {cores => avr/cores}/standard/wiring_private.h (100%) rename {cores => avr/cores}/standard/wiring_pulse.c (100%) rename {cores => avr/cores}/standard/wiring_shift.c (100%) create mode 100644 avr/platform.txt rename {variants => avr/variants}/avr_developers/README (100%) rename {variants => avr/variants}/avr_developers/pins_arduino.h (100%) rename {variants => avr/variants}/bobuino/pins.ods (100%) rename {variants => avr/variants}/bobuino/pins_arduino.h (100%) rename {variants => avr/variants}/standard/pins_arduino.h (100%) diff --git a/.gitignore b/avr/.gitignore similarity index 100% rename from .gitignore rename to avr/.gitignore diff --git a/README.md b/avr/README.md similarity index 100% rename from README.md rename to avr/README.md diff --git a/boards.txt b/avr/boards.txt similarity index 80% rename from boards.txt rename to avr/boards.txt index 10acdce..514f13c 100644 --- a/boards.txt +++ b/avr/boards.txt @@ -4,32 +4,35 @@ mighty_opt.name=Mighty 1284p 16MHz using Optiboot mighty_opt.upload.protocol=arduino mighty_opt.upload.maximum_size=130048 mighty_opt.upload.speed=115200 +mighty_opt.upload.tool=arduino:avrdude mighty_opt.bootloader.low_fuses=0xff mighty_opt.bootloader.high_fuses=0xde mighty_opt.bootloader.extended_fuses=0xfd -mighty_opt.bootloader.path=optiboot -mighty_opt.bootloader.file=optiboot_atmega1284p.hex +mighty_opt.bootloader.file=optiboot\optiboot_atmega1284p.hex mighty_opt.bootloader.unlock_bits=0x3F mighty_opt.bootloader.lock_bits=0x0F +mighty_opt.bootloader.tool=arduino:avrdude mighty_opt.build.mcu=atmega1284p mighty_opt.build.f_cpu=16000000L #mighty_opt.build.core=arduino:arduino mighty_opt.build.core=standard mighty_opt.build.variant=standard + ############################################################## avr_developers.name=avr-developers.com pinouts 16MHz using Optiboot avr_developers.upload.protocol=arduino avr_developers.upload.maximum_size=130048 avr_developers.upload.speed=115200 +avr_developers.upload.tool=arduino:avrdude avr_developers.bootloader.low_fuses=0xff avr_developers.bootloader.high_fuses=0xde avr_developers.bootloader.extended_fuses=0xfd -avr_developers.bootloader.path=optiboot -avr_developers.bootloader.file=optiboot_atmega1284p.hex +avr_developers.bootloader.file=optiboot\optiboot_atmega1284p.hex avr_developers.bootloader.unlock_bits=0x3F avr_developers.bootloader.lock_bits=0x0F +avr_developers.bootloader.tool=arduino:avrdude avr_developers.build.mcu=atmega1284p avr_developers.build.f_cpu=16000000L #avr_developers.build.core=arduino:arduino @@ -42,13 +45,14 @@ bobuino.name=Bobuino bobuino.upload.protocol=arduino bobuino.upload.maximum_size=130048 bobuino.upload.speed=115200 +bobuino.upload.tool=arduino:avrdude bobuino.bootloader.low_fuses=0xff bobuino.bootloader.high_fuses=0xde bobuino.bootloader.extended_fuses=0xfd -bobuino.bootloader.path=optiboot -bobuino.bootloader.file=optiboot_atmega1284p.hex +bobuino.bootloader.file=optiboot\optiboot_atmega1284p.hex bobuino.bootloader.unlock_bits=0x3F bobuino.bootloader.lock_bits=0x0F +bobuino.bootloader.tool=arduino:avrdude bobuino.build.mcu=atmega1284p bobuino.build.f_cpu=16000000L #bobuino.build.core=arduino:arduino @@ -61,13 +65,14 @@ mighty.name=Original Mighty 1284p 16MHz mighty.upload.protocol=stk500v1 mighty.upload.maximum_size=129024 mighty.upload.speed=57600 +mighty.upload.tool=arduino:avrdude mighty.bootloader.low_fuses=0xff mighty.bootloader.high_fuses=0xdc mighty.bootloader.extended_fuses=0xfd -mighty.bootloader.path=standard -mighty.bootloader.file=ATmegaBOOT_1284P.hex +mighty.bootloader.file=standard\ATmegaBOOT_1284P.hex mighty.bootloader.unlock_bits=0x3F mighty.bootloader.lock_bits=0x0F +mighty.bootloader.tool=arduino:avrdude mighty.build.mcu=atmega1284p mighty.build.f_cpu=16000000L #mighty.build.core=arduino:arduino @@ -80,15 +85,17 @@ mighty8.name=Original Mighty 1284p 8MHz mighty8.upload.protocol=stk500v1 mighty8.upload.maximum_size=129024 mighty8.upload.speed=28800 +mighty8.upload.tool=arduino:avrdude mighty8.bootloader.low_fuses=0xff mighty8.bootloader.high_fuses=0xdc mighty8.bootloader.extended_fuses=0xfd -mighty8.bootloader.path=standard -mighty8.bootloader.file=ATmegaBOOT_1284P_8MHz.hex +mighty8.bootloader.file=standard\ATmegaBOOT_1284P_8MHz.hex mighty8.bootloader.unlock_bits=0x3F mighty8.bootloader.lock_bits=0x0F +mighty8.bootloader.tool=arduino:avrdude mighty8.build.mcu=atmega1284p mighty8.build.f_cpu=8000000L #mighty8.build.core=arduino:arduino mighty8.build.core=standard mighty8.build.variant=standard + diff --git a/bootloaders/optiboot/Makefile b/avr/bootloaders/optiboot/Makefile similarity index 100% rename from bootloaders/optiboot/Makefile rename to avr/bootloaders/optiboot/Makefile diff --git a/bootloaders/optiboot/boot.h b/avr/bootloaders/optiboot/boot.h similarity index 100% rename from bootloaders/optiboot/boot.h rename to avr/bootloaders/optiboot/boot.h diff --git a/bootloaders/optiboot/optiboot.c b/avr/bootloaders/optiboot/optiboot.c similarity index 100% rename from bootloaders/optiboot/optiboot.c rename to avr/bootloaders/optiboot/optiboot.c diff --git a/bootloaders/optiboot/optiboot_atmega1284p.hex b/avr/bootloaders/optiboot/optiboot_atmega1284p.hex similarity index 100% rename from bootloaders/optiboot/optiboot_atmega1284p.hex rename to avr/bootloaders/optiboot/optiboot_atmega1284p.hex diff --git a/bootloaders/optiboot/optiboot_atmega1284p.lst b/avr/bootloaders/optiboot/optiboot_atmega1284p.lst similarity index 100% rename from bootloaders/optiboot/optiboot_atmega1284p.lst rename to avr/bootloaders/optiboot/optiboot_atmega1284p.lst diff --git a/bootloaders/optiboot/pin_defs.h b/avr/bootloaders/optiboot/pin_defs.h similarity index 100% rename from bootloaders/optiboot/pin_defs.h rename to avr/bootloaders/optiboot/pin_defs.h diff --git a/bootloaders/optiboot/stk500.h b/avr/bootloaders/optiboot/stk500.h similarity index 100% rename from bootloaders/optiboot/stk500.h rename to avr/bootloaders/optiboot/stk500.h diff --git a/bootloaders/standard/ATmegaBOOT.c b/avr/bootloaders/standard/ATmegaBOOT.c similarity index 100% rename from bootloaders/standard/ATmegaBOOT.c rename to avr/bootloaders/standard/ATmegaBOOT.c diff --git a/bootloaders/standard/ATmegaBOOT_1284P.hex b/avr/bootloaders/standard/ATmegaBOOT_1284P.hex similarity index 100% rename from bootloaders/standard/ATmegaBOOT_1284P.hex rename to avr/bootloaders/standard/ATmegaBOOT_1284P.hex diff --git a/bootloaders/standard/ATmegaBOOT_1284P_8MHz.hex b/avr/bootloaders/standard/ATmegaBOOT_1284P_8MHz.hex similarity index 100% rename from bootloaders/standard/ATmegaBOOT_1284P_8MHz.hex rename to avr/bootloaders/standard/ATmegaBOOT_1284P_8MHz.hex diff --git a/bootloaders/standard/Makefile b/avr/bootloaders/standard/Makefile similarity index 100% rename from bootloaders/standard/Makefile rename to avr/bootloaders/standard/Makefile diff --git a/cores/standard/Arduino.h b/avr/cores/standard/Arduino.h similarity index 100% rename from cores/standard/Arduino.h rename to avr/cores/standard/Arduino.h diff --git a/cores/standard/CDC.cpp b/avr/cores/standard/CDC.cpp similarity index 100% rename from cores/standard/CDC.cpp rename to avr/cores/standard/CDC.cpp diff --git a/cores/standard/Client.h b/avr/cores/standard/Client.h similarity index 100% rename from cores/standard/Client.h rename to avr/cores/standard/Client.h diff --git a/cores/standard/HID.cpp b/avr/cores/standard/HID.cpp similarity index 100% rename from cores/standard/HID.cpp rename to avr/cores/standard/HID.cpp diff --git a/cores/standard/HardwareSerial.cpp b/avr/cores/standard/HardwareSerial.cpp similarity index 100% rename from cores/standard/HardwareSerial.cpp rename to avr/cores/standard/HardwareSerial.cpp diff --git a/cores/standard/HardwareSerial.h b/avr/cores/standard/HardwareSerial.h similarity index 100% rename from cores/standard/HardwareSerial.h rename to avr/cores/standard/HardwareSerial.h diff --git a/cores/standard/IPAddress.cpp b/avr/cores/standard/IPAddress.cpp similarity index 100% rename from cores/standard/IPAddress.cpp rename to avr/cores/standard/IPAddress.cpp diff --git a/cores/standard/IPAddress.h b/avr/cores/standard/IPAddress.h similarity index 100% rename from cores/standard/IPAddress.h rename to avr/cores/standard/IPAddress.h diff --git a/cores/standard/Platform.h b/avr/cores/standard/Platform.h similarity index 100% rename from cores/standard/Platform.h rename to avr/cores/standard/Platform.h diff --git a/cores/standard/Print.cpp b/avr/cores/standard/Print.cpp similarity index 100% rename from cores/standard/Print.cpp rename to avr/cores/standard/Print.cpp diff --git a/cores/standard/Print.h b/avr/cores/standard/Print.h similarity index 100% rename from cores/standard/Print.h rename to avr/cores/standard/Print.h diff --git a/cores/standard/Printable.h b/avr/cores/standard/Printable.h similarity index 100% rename from cores/standard/Printable.h rename to avr/cores/standard/Printable.h diff --git a/cores/standard/Server.h b/avr/cores/standard/Server.h similarity index 100% rename from cores/standard/Server.h rename to avr/cores/standard/Server.h diff --git a/cores/standard/Stream.cpp b/avr/cores/standard/Stream.cpp similarity index 100% rename from cores/standard/Stream.cpp rename to avr/cores/standard/Stream.cpp diff --git a/cores/standard/Stream.h b/avr/cores/standard/Stream.h similarity index 100% rename from cores/standard/Stream.h rename to avr/cores/standard/Stream.h diff --git a/cores/standard/Tone.cpp b/avr/cores/standard/Tone.cpp similarity index 100% rename from cores/standard/Tone.cpp rename to avr/cores/standard/Tone.cpp diff --git a/cores/standard/USBAPI.h b/avr/cores/standard/USBAPI.h similarity index 100% rename from cores/standard/USBAPI.h rename to avr/cores/standard/USBAPI.h diff --git a/cores/standard/USBCore.cpp b/avr/cores/standard/USBCore.cpp similarity index 100% rename from cores/standard/USBCore.cpp rename to avr/cores/standard/USBCore.cpp diff --git a/cores/standard/USBCore.h b/avr/cores/standard/USBCore.h similarity index 100% rename from cores/standard/USBCore.h rename to avr/cores/standard/USBCore.h diff --git a/cores/standard/USBDesc.h b/avr/cores/standard/USBDesc.h similarity index 100% rename from cores/standard/USBDesc.h rename to avr/cores/standard/USBDesc.h diff --git a/cores/standard/Udp.h b/avr/cores/standard/Udp.h similarity index 100% rename from cores/standard/Udp.h rename to avr/cores/standard/Udp.h diff --git a/cores/standard/WCharacter.h b/avr/cores/standard/WCharacter.h similarity index 100% rename from cores/standard/WCharacter.h rename to avr/cores/standard/WCharacter.h diff --git a/cores/standard/WInterrupts.c b/avr/cores/standard/WInterrupts.c similarity index 100% rename from cores/standard/WInterrupts.c rename to avr/cores/standard/WInterrupts.c diff --git a/cores/standard/WMath.cpp b/avr/cores/standard/WMath.cpp similarity index 100% rename from cores/standard/WMath.cpp rename to avr/cores/standard/WMath.cpp diff --git a/cores/standard/WString.cpp b/avr/cores/standard/WString.cpp similarity index 100% rename from cores/standard/WString.cpp rename to avr/cores/standard/WString.cpp diff --git a/cores/standard/WString.h b/avr/cores/standard/WString.h similarity index 100% rename from cores/standard/WString.h rename to avr/cores/standard/WString.h diff --git a/cores/standard/binary.h b/avr/cores/standard/binary.h similarity index 100% rename from cores/standard/binary.h rename to avr/cores/standard/binary.h diff --git a/cores/standard/main.cpp b/avr/cores/standard/main.cpp similarity index 100% rename from cores/standard/main.cpp rename to avr/cores/standard/main.cpp diff --git a/cores/standard/new.cpp b/avr/cores/standard/new.cpp similarity index 100% rename from cores/standard/new.cpp rename to avr/cores/standard/new.cpp diff --git a/cores/standard/new.h b/avr/cores/standard/new.h similarity index 100% rename from cores/standard/new.h rename to avr/cores/standard/new.h diff --git a/cores/standard/wiring.c b/avr/cores/standard/wiring.c similarity index 100% rename from cores/standard/wiring.c rename to avr/cores/standard/wiring.c diff --git a/cores/standard/wiring_analog.c b/avr/cores/standard/wiring_analog.c similarity index 100% rename from cores/standard/wiring_analog.c rename to avr/cores/standard/wiring_analog.c diff --git a/cores/standard/wiring_digital.c b/avr/cores/standard/wiring_digital.c similarity index 100% rename from cores/standard/wiring_digital.c rename to avr/cores/standard/wiring_digital.c diff --git a/cores/standard/wiring_private.h b/avr/cores/standard/wiring_private.h similarity index 100% rename from cores/standard/wiring_private.h rename to avr/cores/standard/wiring_private.h diff --git a/cores/standard/wiring_pulse.c b/avr/cores/standard/wiring_pulse.c similarity index 100% rename from cores/standard/wiring_pulse.c rename to avr/cores/standard/wiring_pulse.c diff --git a/cores/standard/wiring_shift.c b/avr/cores/standard/wiring_shift.c similarity index 100% rename from cores/standard/wiring_shift.c rename to avr/cores/standard/wiring_shift.c diff --git a/avr/platform.txt b/avr/platform.txt new file mode 100644 index 0000000..b3c9986 --- /dev/null +++ b/avr/platform.txt @@ -0,0 +1,113 @@ + +# Arduino AVR Core and platform. +# ------------------------------ +# +# For more info: +# https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5---3rd-party-Hardware-specification + +name=Arduino AVR Boards +version=1.6.7 + +# 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 overidde 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} -ffunction-sections -fdata-sections -MMD +# -w flag added to avoid printing a wrong warning http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59396 +# This is fixed in gcc 4.8.3 and will be removed as soon as we update the toolchain +compiler.c.elf.flags={compiler.warning_flags} -Os -Wl,--gc-sections +compiler.c.elf.cmd=avr-gcc +compiler.S.flags=-c -g -x assembler-with-cpp +compiler.cpp.cmd=avr-g++ +compiler.cpp.flags=-c -g -Os {compiler.warning_flags} -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD +compiler.ar.cmd=avr-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.size.cmd=avr-size + +# This can be overriden 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 +recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{build.path}/{archive_file}" "{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} -o "{build.path}/{build.project_name}.elf" {object_files} "{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]+).* + + +# 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.pattern="{cmd.path}" "-C{config.path}" {upload.verbose} -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.pattern="{cmd.path}" "-C{config.path}" {program.verbose} -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 + + +# USB Default Flags +# Default blank usb manufacturer will be filled it 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}' diff --git a/variants/avr_developers/README b/avr/variants/avr_developers/README similarity index 100% rename from variants/avr_developers/README rename to avr/variants/avr_developers/README diff --git a/variants/avr_developers/pins_arduino.h b/avr/variants/avr_developers/pins_arduino.h similarity index 100% rename from variants/avr_developers/pins_arduino.h rename to avr/variants/avr_developers/pins_arduino.h diff --git a/variants/bobuino/pins.ods b/avr/variants/bobuino/pins.ods similarity index 100% rename from variants/bobuino/pins.ods rename to avr/variants/bobuino/pins.ods diff --git a/variants/bobuino/pins_arduino.h b/avr/variants/bobuino/pins_arduino.h similarity index 100% rename from variants/bobuino/pins_arduino.h rename to avr/variants/bobuino/pins_arduino.h diff --git a/variants/standard/pins_arduino.h b/avr/variants/standard/pins_arduino.h similarity index 100% rename from variants/standard/pins_arduino.h rename to avr/variants/standard/pins_arduino.h