diff --git a/apps/bounce1/Makefile b/apps/bounce1/Makefile index daf1fb4..dc6ed69 100644 --- a/apps/bounce1/Makefile +++ b/apps/bounce1/Makefile @@ -40,6 +40,11 @@ bounce1.out: bounce1.o pio.o system.o timer.o pacer.o $(SIZE) $@ +# Create hex file for programming from executable file. +bounce1.hex: bounce1.out + $(OBJCOPY) -O ihex bounce1.out bounce1.hex + + # Target: clean project. .PHONY: clean clean: @@ -48,8 +53,7 @@ clean: # Target: program project. .PHONY: program -program: bounce1.out - $(OBJCOPY) -O ihex bounce1.out bounce1.hex +program: bounce1.hex dfu-programmer atmega32u2 erase; dfu-programmer atmega32u2 flash bounce1.hex; dfu-programmer atmega32u2 start diff --git a/apps/bounce2/Makefile b/apps/bounce2/Makefile index d318c32..805b279 100644 --- a/apps/bounce2/Makefile +++ b/apps/bounce2/Makefile @@ -46,6 +46,11 @@ bounce2.out: bounce2.o pio.o system.o timer.o display.o ledmat.o pacer.o $(SIZE) $@ +# Create hex file for programming from executable file. +bounce2.hex: bounce2.out + $(OBJCOPY) -O ihex bounce2.out bounce2.hex + + # Target: clean project. .PHONY: clean clean: @@ -54,8 +59,7 @@ clean: # Target: program project. .PHONY: program -program: bounce2.out - $(OBJCOPY) -O ihex bounce2.out bounce2.hex +program: bounce2.hex dfu-programmer atmega32u2 erase; dfu-programmer atmega32u2 flash bounce2.hex; dfu-programmer atmega32u2 start diff --git a/apps/bounce3/Makefile b/apps/bounce3/Makefile index 808b208..68e7ade 100644 --- a/apps/bounce3/Makefile +++ b/apps/bounce3/Makefile @@ -52,6 +52,11 @@ bounce3.out: bounce3.o pio.o system.o timer.o display.o ledmat.o font.o pacer.o $(SIZE) $@ +# Create hex file for programming from executable file. +bounce3.hex: bounce3.out + $(OBJCOPY) -O ihex bounce3.out bounce3.hex + + # Target: clean project. .PHONY: clean clean: @@ -60,8 +65,7 @@ clean: # Target: program project. .PHONY: program -program: bounce3.out - $(OBJCOPY) -O ihex bounce3.out bounce3.hex +program: bounce3.hex dfu-programmer atmega32u2 erase; dfu-programmer atmega32u2 flash bounce3.hex; dfu-programmer atmega32u2 start diff --git a/apps/bounce4/Makefile b/apps/bounce4/Makefile index 92c8fd0..facb9ae 100644 --- a/apps/bounce4/Makefile +++ b/apps/bounce4/Makefile @@ -55,6 +55,11 @@ bounce4.out: bounce4.o pio.o system.o timer.o display.o ledmat.o boing.o font.o $(SIZE) $@ +# Create hex file for programming from executable file. +bounce4.hex: bounce4.out + $(OBJCOPY) -O ihex bounce4.out bounce4.hex + + # Target: clean project. .PHONY: clean clean: @@ -63,8 +68,7 @@ clean: # Target: program project. .PHONY: program -program: bounce4.out - $(OBJCOPY) -O ihex bounce4.out bounce4.hex +program: bounce4.hex dfu-programmer atmega32u2 erase; dfu-programmer atmega32u2 flash bounce4.hex; dfu-programmer atmega32u2 start diff --git a/apps/bounce5/Makefile b/apps/bounce5/Makefile index 811f3d0..89fb46f 100644 --- a/apps/bounce5/Makefile +++ b/apps/bounce5/Makefile @@ -55,6 +55,11 @@ bounce5.out: bounce5.o pio.o system.o timer.o display.o ledmat.o boing.o font.o $(SIZE) $@ +# Create hex file for programming from executable file. +bounce5.hex: bounce5.out + $(OBJCOPY) -O ihex bounce5.out bounce5.hex + + # Target: clean project. .PHONY: clean clean: @@ -63,8 +68,7 @@ clean: # Target: program project. .PHONY: program -program: bounce5.out - $(OBJCOPY) -O ihex bounce5.out bounce5.hex +program: bounce5.hex dfu-programmer atmega32u2 erase; dfu-programmer atmega32u2 flash bounce5.hex; dfu-programmer atmega32u2 start diff --git a/apps/chooser/Makefile b/apps/chooser/Makefile index c572d67..20d1196 100644 --- a/apps/chooser/Makefile +++ b/apps/chooser/Makefile @@ -55,6 +55,11 @@ chooser.out: chooser.o pio.o system.o timer.o display.o ledmat.o navswitch.o fon $(SIZE) $@ +# Create hex file for programming from executable file. +chooser.hex: chooser.out + $(OBJCOPY) -O ihex chooser.out chooser.hex + + # Target: clean project. .PHONY: clean clean: @@ -63,8 +68,7 @@ clean: # Target: program project. .PHONY: program -program: chooser.out - $(OBJCOPY) -O ihex chooser.out chooser.hex +program: chooser.hex dfu-programmer atmega32u2 erase; dfu-programmer atmega32u2 flash chooser.hex; dfu-programmer atmega32u2 start diff --git a/apps/demo1/Makefile b/apps/demo1/Makefile index 43686e6..f7f2772 100644 --- a/apps/demo1/Makefile +++ b/apps/demo1/Makefile @@ -34,6 +34,11 @@ demo1.out: demo1.o pio.o system.o $(SIZE) $@ +# Create hex file for programming from executable file. +demo1.hex: demo1.out + $(OBJCOPY) -O ihex demo1.out demo1.hex + + # Target: clean project. .PHONY: clean clean: @@ -42,8 +47,7 @@ clean: # Target: program project. .PHONY: program -program: demo1.out - $(OBJCOPY) -O ihex demo1.out demo1.hex +program: demo1.hex dfu-programmer atmega32u2 erase; dfu-programmer atmega32u2 flash demo1.hex; dfu-programmer atmega32u2 start diff --git a/apps/demo2/Makefile b/apps/demo2/Makefile index 02ac251..3d4a0f2 100644 --- a/apps/demo2/Makefile +++ b/apps/demo2/Makefile @@ -37,6 +37,11 @@ demo2.out: demo2.o pio.o system.o led.o $(SIZE) $@ +# Create hex file for programming from executable file. +demo2.hex: demo2.out + $(OBJCOPY) -O ihex demo2.out demo2.hex + + # Target: clean project. .PHONY: clean clean: @@ -45,8 +50,7 @@ clean: # Target: program project. .PHONY: program -program: demo2.out - $(OBJCOPY) -O ihex demo2.out demo2.hex +program: demo2.hex dfu-programmer atmega32u2 erase; dfu-programmer atmega32u2 flash demo2.hex; dfu-programmer atmega32u2 start diff --git a/apps/fonttest1/Makefile b/apps/fonttest1/Makefile index 6bc4d82..d36eb81 100644 --- a/apps/fonttest1/Makefile +++ b/apps/fonttest1/Makefile @@ -55,6 +55,11 @@ fonttest1.out: fonttest1.o pio.o system.o timer.o display.o ledmat.o navswitch.o $(SIZE) $@ +# Create hex file for programming from executable file. +fonttest1.hex: fonttest1.out + $(OBJCOPY) -O ihex fonttest1.out fonttest1.hex + + # Target: clean project. .PHONY: clean clean: @@ -63,8 +68,7 @@ clean: # Target: program project. .PHONY: program -program: fonttest1.out - $(OBJCOPY) -O ihex fonttest1.out fonttest1.hex +program: fonttest1.hex dfu-programmer atmega32u2 erase; dfu-programmer atmega32u2 flash fonttest1.hex; dfu-programmer atmega32u2 start diff --git a/apps/hello1/Makefile b/apps/hello1/Makefile index f223e66..d15e0e3 100644 --- a/apps/hello1/Makefile +++ b/apps/hello1/Makefile @@ -43,6 +43,11 @@ hello1.out: hello1.o pio.o system.o timer.o ledmat.o pacer.o $(SIZE) $@ +# Create hex file for programming from executable file. +hello1.hex: hello1.out + $(OBJCOPY) -O ihex hello1.out hello1.hex + + # Target: clean project. .PHONY: clean clean: @@ -51,8 +56,7 @@ clean: # Target: program project. .PHONY: program -program: hello1.out - $(OBJCOPY) -O ihex hello1.out hello1.hex +program: hello1.hex dfu-programmer atmega32u2 erase; dfu-programmer atmega32u2 flash hello1.hex; dfu-programmer atmega32u2 start diff --git a/apps/hello2/Makefile b/apps/hello2/Makefile index 46805e2..c4b7cfb 100644 --- a/apps/hello2/Makefile +++ b/apps/hello2/Makefile @@ -52,6 +52,11 @@ hello2.out: hello2.o pio.o system.o timer.o display.o ledmat.o font.o pacer.o ti $(SIZE) $@ +# Create hex file for programming from executable file. +hello2.hex: hello2.out + $(OBJCOPY) -O ihex hello2.out hello2.hex + + # Target: clean project. .PHONY: clean clean: @@ -60,8 +65,7 @@ clean: # Target: program project. .PHONY: program -program: hello2.out - $(OBJCOPY) -O ihex hello2.out hello2.hex +program: hello2.hex dfu-programmer atmega32u2 erase; dfu-programmer atmega32u2 flash hello2.hex; dfu-programmer atmega32u2 start diff --git a/apps/hello3/Makefile b/apps/hello3/Makefile index 6de138d..cadd282 100644 --- a/apps/hello3/Makefile +++ b/apps/hello3/Makefile @@ -52,6 +52,11 @@ hello3.out: hello3.o pio.o system.o timer.o display.o ledmat.o font.o pacer.o ti $(SIZE) $@ +# Create hex file for programming from executable file. +hello3.hex: hello3.out + $(OBJCOPY) -O ihex hello3.out hello3.hex + + # Target: clean project. .PHONY: clean clean: @@ -60,8 +65,7 @@ clean: # Target: program project. .PHONY: program -program: hello3.out - $(OBJCOPY) -O ihex hello3.out hello3.hex +program: hello3.hex dfu-programmer atmega32u2 erase; dfu-programmer atmega32u2 flash hello3.hex; dfu-programmer atmega32u2 start diff --git a/apps/hello4/Makefile b/apps/hello4/Makefile index 317afc3..3c0e120 100644 --- a/apps/hello4/Makefile +++ b/apps/hello4/Makefile @@ -55,6 +55,11 @@ hello4.out: hello4.o pio.o system.o timer.o display.o ledmat.o navswitch.o font. $(SIZE) $@ +# Create hex file for programming from executable file. +hello4.hex: hello4.out + $(OBJCOPY) -O ihex hello4.out hello4.hex + + # Target: clean project. .PHONY: clean clean: @@ -63,8 +68,7 @@ clean: # Target: program project. .PHONY: program -program: hello4.out - $(OBJCOPY) -O ihex hello4.out hello4.hex +program: hello4.hex dfu-programmer atmega32u2 erase; dfu-programmer atmega32u2 flash hello4.hex; dfu-programmer atmega32u2 start diff --git a/apps/hello5/Makefile b/apps/hello5/Makefile index e086066..9ae971d 100644 --- a/apps/hello5/Makefile +++ b/apps/hello5/Makefile @@ -55,6 +55,11 @@ hello5.out: hello5.o pio.o system.o timer.o display.o ledmat.o navswitch.o font. $(SIZE) $@ +# Create hex file for programming from executable file. +hello5.hex: hello5.out + $(OBJCOPY) -O ihex hello5.out hello5.hex + + # Target: clean project. .PHONY: clean clean: @@ -63,8 +68,7 @@ clean: # Target: program project. .PHONY: program -program: hello5.out - $(OBJCOPY) -O ihex hello5.out hello5.hex +program: hello5.hex dfu-programmer atmega32u2 erase; dfu-programmer atmega32u2 flash hello5.hex; dfu-programmer atmega32u2 start diff --git a/apps/ir_grab1/Makefile b/apps/ir_grab1/Makefile index ee2ad69..248cd6b 100644 --- a/apps/ir_grab1/Makefile +++ b/apps/ir_grab1/Makefile @@ -58,6 +58,11 @@ ir_grab1.out: ir_grab1.o pio.o system.o timer.o display.o ir.o ledmat.o navswitc $(SIZE) $@ +# Create hex file for programming from executable file. +ir_grab1.hex: ir_grab1.out + $(OBJCOPY) -O ihex ir_grab1.out ir_grab1.hex + + # Target: clean project. .PHONY: clean clean: @@ -66,8 +71,7 @@ clean: # Target: program project. .PHONY: program -program: ir_grab1.out - $(OBJCOPY) -O ihex ir_grab1.out ir_grab1.hex +program: ir_grab1.hex dfu-programmer atmega32u2 erase; dfu-programmer atmega32u2 flash ir_grab1.hex; dfu-programmer atmega32u2 start diff --git a/apps/ir_grab2/Makefile b/apps/ir_grab2/Makefile index a306d61..37a8608 100644 --- a/apps/ir_grab2/Makefile +++ b/apps/ir_grab2/Makefile @@ -61,6 +61,11 @@ ir_grab2.out: ir_grab2.o pio.o system.o timer.o display.o ir.o ledmat.o navswitc $(SIZE) $@ +# Create hex file for programming from executable file. +ir_grab2.hex: ir_grab2.out + $(OBJCOPY) -O ihex ir_grab2.out ir_grab2.hex + + # Target: clean project. .PHONY: clean clean: @@ -69,8 +74,7 @@ clean: # Target: program project. .PHONY: program -program: ir_grab2.out - $(OBJCOPY) -O ihex ir_grab2.out ir_grab2.hex +program: ir_grab2.hex dfu-programmer atmega32u2 erase; dfu-programmer atmega32u2 flash ir_grab2.hex; dfu-programmer atmega32u2 start diff --git a/apps/ir_grab3/Makefile b/apps/ir_grab3/Makefile index 00e1447..15d2fe9 100644 --- a/apps/ir_grab3/Makefile +++ b/apps/ir_grab3/Makefile @@ -67,6 +67,11 @@ ir_grab3.out: ir_grab3.o eeprom.o pio.o system.o timer.o button.o display.o ir.o $(SIZE) $@ +# Create hex file for programming from executable file. +ir_grab3.hex: ir_grab3.out + $(OBJCOPY) -O ihex ir_grab3.out ir_grab3.hex + + # Target: clean project. .PHONY: clean clean: @@ -75,8 +80,7 @@ clean: # Target: program project. .PHONY: program -program: ir_grab3.out - $(OBJCOPY) -O ihex ir_grab3.out ir_grab3.hex +program: ir_grab3.hex dfu-programmer atmega32u2 erase; dfu-programmer atmega32u2 flash ir_grab3.hex; dfu-programmer atmega32u2 start diff --git a/apps/ir_serial_test1/Makefile b/apps/ir_serial_test1/Makefile index d325233..23318e0 100644 --- a/apps/ir_serial_test1/Makefile +++ b/apps/ir_serial_test1/Makefile @@ -61,6 +61,11 @@ ir_serial_test1.out: ir_serial_test1.o pio.o system.o timer.o display.o ir.o ir_ $(SIZE) $@ +# Create hex file for programming from executable file. +ir_serial_test1.hex: ir_serial_test1.out + $(OBJCOPY) -O ihex ir_serial_test1.out ir_serial_test1.hex + + # Target: clean project. .PHONY: clean clean: @@ -69,8 +74,7 @@ clean: # Target: program project. .PHONY: program -program: ir_serial_test1.out - $(OBJCOPY) -O ihex ir_serial_test1.out ir_serial_test1.hex +program: ir_serial_test1.hex dfu-programmer atmega32u2 erase; dfu-programmer atmega32u2 flash ir_serial_test1.hex; dfu-programmer atmega32u2 start diff --git a/apps/ir_serial_test2/Makefile b/apps/ir_serial_test2/Makefile index 19ccd4b..9c5df7f 100644 --- a/apps/ir_serial_test2/Makefile +++ b/apps/ir_serial_test2/Makefile @@ -61,6 +61,11 @@ ir_serial_test2.out: ir_serial_test2.o pio.o system.o timer.o display.o ir.o ir_ $(SIZE) $@ +# Create hex file for programming from executable file. +ir_serial_test2.hex: ir_serial_test2.out + $(OBJCOPY) -O ihex ir_serial_test2.out ir_serial_test2.hex + + # Target: clean project. .PHONY: clean clean: @@ -69,8 +74,7 @@ clean: # Target: program project. .PHONY: program -program: ir_serial_test2.out - $(OBJCOPY) -O ihex ir_serial_test2.out ir_serial_test2.hex +program: ir_serial_test2.hex dfu-programmer atmega32u2 erase; dfu-programmer atmega32u2 flash ir_serial_test2.hex; dfu-programmer atmega32u2 start diff --git a/apps/ir_serial_test3/Makefile b/apps/ir_serial_test3/Makefile index 8e33871..bc670d2 100644 --- a/apps/ir_serial_test3/Makefile +++ b/apps/ir_serial_test3/Makefile @@ -61,6 +61,11 @@ ir_serial_test3.out: ir_serial_test3.o pio.o system.o timer.o display.o ir.o ir_ $(SIZE) $@ +# Create hex file for programming from executable file. +ir_serial_test3.hex: ir_serial_test3.out + $(OBJCOPY) -O ihex ir_serial_test3.out ir_serial_test3.hex + + # Target: clean project. .PHONY: clean clean: @@ -69,8 +74,7 @@ clean: # Target: program project. .PHONY: program -program: ir_serial_test3.out - $(OBJCOPY) -O ihex ir_serial_test3.out ir_serial_test3.hex +program: ir_serial_test3.hex dfu-programmer atmega32u2 erase; dfu-programmer atmega32u2 flash ir_serial_test3.hex; dfu-programmer atmega32u2 start diff --git a/apps/ir_uart_test1/Makefile b/apps/ir_uart_test1/Makefile index 63a8029..144ca8a 100644 --- a/apps/ir_uart_test1/Makefile +++ b/apps/ir_uart_test1/Makefile @@ -67,6 +67,11 @@ ir_uart_test1.out: ir_uart_test1.o ir_uart.o pio.o prescale.o system.o timer.o t $(SIZE) $@ +# Create hex file for programming from executable file. +ir_uart_test1.hex: ir_uart_test1.out + $(OBJCOPY) -O ihex ir_uart_test1.out ir_uart_test1.hex + + # Target: clean project. .PHONY: clean clean: @@ -75,8 +80,7 @@ clean: # Target: program project. .PHONY: program -program: ir_uart_test1.out - $(OBJCOPY) -O ihex ir_uart_test1.out ir_uart_test1.hex +program: ir_uart_test1.hex dfu-programmer atmega32u2 erase; dfu-programmer atmega32u2 flash ir_uart_test1.hex; dfu-programmer atmega32u2 start diff --git a/apps/ir_uart_test2/Makefile b/apps/ir_uart_test2/Makefile index 9d7e64f..3e308e6 100644 --- a/apps/ir_uart_test2/Makefile +++ b/apps/ir_uart_test2/Makefile @@ -67,6 +67,11 @@ ir_uart_test2.out: ir_uart_test2.o ir_uart.o pio.o prescale.o system.o timer.o t $(SIZE) $@ +# Create hex file for programming from executable file. +ir_uart_test2.hex: ir_uart_test2.out + $(OBJCOPY) -O ihex ir_uart_test2.out ir_uart_test2.hex + + # Target: clean project. .PHONY: clean clean: @@ -75,8 +80,7 @@ clean: # Target: program project. .PHONY: program -program: ir_uart_test2.out - $(OBJCOPY) -O ihex ir_uart_test2.out ir_uart_test2.hex +program: ir_uart_test2.hex dfu-programmer atmega32u2 erase; dfu-programmer atmega32u2 flash ir_uart_test2.hex; dfu-programmer atmega32u2 start diff --git a/apps/ir_uart_test3/Makefile b/apps/ir_uart_test3/Makefile index 7cdfc2e..a53b963 100644 --- a/apps/ir_uart_test3/Makefile +++ b/apps/ir_uart_test3/Makefile @@ -70,6 +70,11 @@ ir_uart_test3.out: ir_uart_test3.o ir_uart.o pio.o prescale.o system.o timer.o t $(SIZE) $@ +# Create hex file for programming from executable file. +ir_uart_test3.hex: ir_uart_test3.out + $(OBJCOPY) -O ihex ir_uart_test3.out ir_uart_test3.hex + + # Target: clean project. .PHONY: clean clean: @@ -78,8 +83,7 @@ clean: # Target: program project. .PHONY: program -program: ir_uart_test3.out - $(OBJCOPY) -O ihex ir_uart_test3.out ir_uart_test3.hex +program: ir_uart_test3.hex dfu-programmer atmega32u2 erase; dfu-programmer atmega32u2 flash ir_uart_test3.hex; dfu-programmer atmega32u2 start diff --git a/apps/led0/Makefile b/apps/led0/Makefile index 7f4e37d..2a9e864 100644 --- a/apps/led0/Makefile +++ b/apps/led0/Makefile @@ -43,6 +43,11 @@ led0.out: led0.o pio.o system.o timer.o led.o pacer.o $(SIZE) $@ +# Create hex file for programming from executable file. +led0.hex: led0.out + $(OBJCOPY) -O ihex led0.out led0.hex + + # Target: clean project. .PHONY: clean clean: @@ -51,8 +56,7 @@ clean: # Target: program project. .PHONY: program -program: led0.out - $(OBJCOPY) -O ihex led0.out led0.hex +program: led0.hex dfu-programmer atmega32u2 erase; dfu-programmer atmega32u2 flash led0.hex; dfu-programmer atmega32u2 start diff --git a/apps/led1/Makefile b/apps/led1/Makefile index 235e912..258c6b0 100644 --- a/apps/led1/Makefile +++ b/apps/led1/Makefile @@ -43,6 +43,11 @@ led1.out: led1.o pio.o system.o timer.o led.o pacer.o $(SIZE) $@ +# Create hex file for programming from executable file. +led1.hex: led1.out + $(OBJCOPY) -O ihex led1.out led1.hex + + # Target: clean project. .PHONY: clean clean: @@ -51,8 +56,7 @@ clean: # Target: program project. .PHONY: program -program: led1.out - $(OBJCOPY) -O ihex led1.out led1.hex +program: led1.hex dfu-programmer atmega32u2 erase; dfu-programmer atmega32u2 flash led1.hex; dfu-programmer atmega32u2 start diff --git a/apps/led1/led1.c b/apps/led1/led1.c index 1381f94..55a23a8 100644 --- a/apps/led1/led1.c +++ b/apps/led1/led1.c @@ -1,6 +1,7 @@ /** @file led1.c @author M.P. Hayes @date 5 Oct 2010 + @descr This flashes the LED twice per second. */ #include "system.h" @@ -8,11 +9,14 @@ #include "pacer.h" -/* Define polling rate in Hz. */ +/* Define polling rate in Hz. (Note, this is much faster than + needed for this application.) */ #define LOOP_RATE 1000 +/* LED flash rate (Hz). */ #define LED_RATE 2 + int main (void) { unsigned int count = 0; diff --git a/apps/led2/Makefile b/apps/led2/Makefile index 67f5d15..9107fae 100644 --- a/apps/led2/Makefile +++ b/apps/led2/Makefile @@ -46,6 +46,11 @@ led2.out: led2.o pio.o system.o timer.o led.o navswitch.o pacer.o $(SIZE) $@ +# Create hex file for programming from executable file. +led2.hex: led2.out + $(OBJCOPY) -O ihex led2.out led2.hex + + # Target: clean project. .PHONY: clean clean: @@ -54,8 +59,7 @@ clean: # Target: program project. .PHONY: program -program: led2.out - $(OBJCOPY) -O ihex led2.out led2.hex +program: led2.hex dfu-programmer atmega32u2 erase; dfu-programmer atmega32u2 flash led2.hex; dfu-programmer atmega32u2 start diff --git a/apps/led2/led2.c b/apps/led2/led2.c index 1ec982b..72ae6d9 100644 --- a/apps/led2/led2.c +++ b/apps/led2/led2.c @@ -9,14 +9,14 @@ #include "pacer.h" -/* Define polling rate in Hz. */ +/* Define polling rate in Hz. (Note, this is much faster than + needed for this application.) */ #define LOOP_RATE 1000 #define LED_RATE_INC 2 #define LED_RATE_MIN 0 #define LED_RATE_MAX 100 -typedef struct pen pen_t; int main (void) diff --git a/apps/led3/Makefile b/apps/led3/Makefile index 24f51b2..7a7f417 100644 --- a/apps/led3/Makefile +++ b/apps/led3/Makefile @@ -46,6 +46,11 @@ led3.out: led3.o pio.o system.o timer.o led.o navswitch.o pacer.o $(SIZE) $@ +# Create hex file for programming from executable file. +led3.hex: led3.out + $(OBJCOPY) -O ihex led3.out led3.hex + + # Target: clean project. .PHONY: clean clean: @@ -54,8 +59,7 @@ clean: # Target: program project. .PHONY: program -program: led3.out - $(OBJCOPY) -O ihex led3.out led3.hex +program: led3.hex dfu-programmer atmega32u2 erase; dfu-programmer atmega32u2 flash led3.hex; dfu-programmer atmega32u2 start diff --git a/apps/led4/Makefile b/apps/led4/Makefile index eec7d44..1c8850a 100644 --- a/apps/led4/Makefile +++ b/apps/led4/Makefile @@ -46,6 +46,11 @@ led4.out: led4.o pio.o system.o timer.o led.o navswitch.o pacer.o $(SIZE) $@ +# Create hex file for programming from executable file. +led4.hex: led4.out + $(OBJCOPY) -O ihex led4.out led4.hex + + # Target: clean project. .PHONY: clean clean: @@ -54,8 +59,7 @@ clean: # Target: program project. .PHONY: program -program: led4.out - $(OBJCOPY) -O ihex led4.out led4.hex +program: led4.hex dfu-programmer atmega32u2 erase; dfu-programmer atmega32u2 flash led4.hex; dfu-programmer atmega32u2 start diff --git a/apps/led4/led4.c b/apps/led4/led4.c index 182e4c5..80162a1 100644 --- a/apps/led4/led4.c +++ b/apps/led4/led4.c @@ -14,8 +14,6 @@ #define LED_RATE 40 -typedef struct pen pen_t; - int main (void) { diff --git a/apps/led5/Makefile b/apps/led5/Makefile index cf3e8e3..9bbf3a9 100644 --- a/apps/led5/Makefile +++ b/apps/led5/Makefile @@ -40,6 +40,11 @@ led5.out: led5.o pio.o system.o timer.o led.o $(SIZE) $@ +# Create hex file for programming from executable file. +led5.hex: led5.out + $(OBJCOPY) -O ihex led5.out led5.hex + + # Target: clean project. .PHONY: clean clean: @@ -48,8 +53,7 @@ clean: # Target: program project. .PHONY: program -program: led5.out - $(OBJCOPY) -O ihex led5.out led5.hex +program: led5.hex dfu-programmer atmega32u2 erase; dfu-programmer atmega32u2 flash led5.hex; dfu-programmer atmega32u2 start diff --git a/apps/pio1/Makefile b/apps/pio1/Makefile index 28dda14..20ff28f 100644 --- a/apps/pio1/Makefile +++ b/apps/pio1/Makefile @@ -34,6 +34,11 @@ pio1.out: pio1.o pio.o system.o $(SIZE) $@ +# Create hex file for programming from executable file. +pio1.hex: pio1.out + $(OBJCOPY) -O ihex pio1.out pio1.hex + + # Target: clean project. .PHONY: clean clean: @@ -42,8 +47,7 @@ clean: # Target: program project. .PHONY: program -program: pio1.out - $(OBJCOPY) -O ihex pio1.out pio1.hex +program: pio1.hex dfu-programmer atmega32u2 erase; dfu-programmer atmega32u2 flash pio1.hex; dfu-programmer atmega32u2 start diff --git a/apps/pio2/Makefile b/apps/pio2/Makefile index dc174b1..2647f1b 100644 --- a/apps/pio2/Makefile +++ b/apps/pio2/Makefile @@ -34,6 +34,11 @@ pio2.out: pio2.o pio.o system.o $(SIZE) $@ +# Create hex file for programming from executable file. +pio2.hex: pio2.out + $(OBJCOPY) -O ihex pio2.out pio2.hex + + # Target: clean project. .PHONY: clean clean: @@ -42,8 +47,7 @@ clean: # Target: program project. .PHONY: program -program: pio2.out - $(OBJCOPY) -O ihex pio2.out pio2.hex +program: pio2.hex dfu-programmer atmega32u2 erase; dfu-programmer atmega32u2 flash pio2.hex; dfu-programmer atmega32u2 start diff --git a/apps/pio3/Makefile b/apps/pio3/Makefile index 453ef98..168fd96 100644 --- a/apps/pio3/Makefile +++ b/apps/pio3/Makefile @@ -37,6 +37,11 @@ pio3.out: pio3.o pio.o system.o timer.o $(SIZE) $@ +# Create hex file for programming from executable file. +pio3.hex: pio3.out + $(OBJCOPY) -O ihex pio3.out pio3.hex + + # Target: clean project. .PHONY: clean clean: @@ -45,8 +50,7 @@ clean: # Target: program project. .PHONY: program -program: pio3.out - $(OBJCOPY) -O ihex pio3.out pio3.hex +program: pio3.hex dfu-programmer atmega32u2 erase; dfu-programmer atmega32u2 flash pio3.hex; dfu-programmer atmega32u2 start diff --git a/apps/scribble1/Makefile b/apps/scribble1/Makefile index 8840733..9f461f9 100644 --- a/apps/scribble1/Makefile +++ b/apps/scribble1/Makefile @@ -61,6 +61,11 @@ scribble1.out: scribble1.o pio.o system.o timer.o button.o display.o led.o ledma $(SIZE) $@ +# Create hex file for programming from executable file. +scribble1.hex: scribble1.out + $(OBJCOPY) -O ihex scribble1.out scribble1.hex + + # Target: clean project. .PHONY: clean clean: @@ -69,8 +74,7 @@ clean: # Target: program project. .PHONY: program -program: scribble1.out - $(OBJCOPY) -O ihex scribble1.out scribble1.hex +program: scribble1.hex dfu-programmer atmega32u2 erase; dfu-programmer atmega32u2 flash scribble1.hex; dfu-programmer atmega32u2 start diff --git a/apps/snake1/Makefile b/apps/snake1/Makefile index c74c363..da204ec 100644 --- a/apps/snake1/Makefile +++ b/apps/snake1/Makefile @@ -55,6 +55,11 @@ snake1.out: snake1.o pio.o system.o timer.o display.o ledmat.o navswitch.o font. $(SIZE) $@ +# Create hex file for programming from executable file. +snake1.hex: snake1.out + $(OBJCOPY) -O ihex snake1.out snake1.hex + + # Target: clean project. .PHONY: clean clean: @@ -63,8 +68,7 @@ clean: # Target: program project. .PHONY: program -program: snake1.out - $(OBJCOPY) -O ihex snake1.out snake1.hex +program: snake1.hex dfu-programmer atmega32u2 erase; dfu-programmer atmega32u2 flash snake1.hex; dfu-programmer atmega32u2 start diff --git a/apps/space10/Makefile b/apps/space10/Makefile index fa863ae..acf0c2f 100644 --- a/apps/space10/Makefile +++ b/apps/space10/Makefile @@ -70,6 +70,11 @@ space10.out: space10.o flasher.o spacey.o eeprom.o pio.o system.o timer.o displa $(SIZE) $@ +# Create hex file for programming from executable file. +space10.hex: space10.out + $(OBJCOPY) -O ihex space10.out space10.hex + + # Target: clean project. .PHONY: clean clean: @@ -78,8 +83,7 @@ clean: # Target: program project. .PHONY: program -program: space10.out - $(OBJCOPY) -O ihex space10.out space10.hex +program: space10.hex dfu-programmer atmega32u2 erase; dfu-programmer atmega32u2 flash space10.hex; dfu-programmer atmega32u2 start diff --git a/apps/space11/Makefile b/apps/space11/Makefile index 456b630..bc2dc86 100644 --- a/apps/space11/Makefile +++ b/apps/space11/Makefile @@ -70,6 +70,11 @@ space11.out: space11.o flasher.o spacey.o eeprom.o pio.o system.o timer.o displa $(SIZE) $@ +# Create hex file for programming from executable file. +space11.hex: space11.out + $(OBJCOPY) -O ihex space11.out space11.hex + + # Target: clean project. .PHONY: clean clean: @@ -78,8 +83,7 @@ clean: # Target: program project. .PHONY: program -program: space11.out - $(OBJCOPY) -O ihex space11.out space11.hex +program: space11.hex dfu-programmer atmega32u2 erase; dfu-programmer atmega32u2 flash space11.hex; dfu-programmer atmega32u2 start diff --git a/apps/space12/Makefile b/apps/space12/Makefile index f197dc6..03b1751 100644 --- a/apps/space12/Makefile +++ b/apps/space12/Makefile @@ -79,6 +79,11 @@ space12.out: space12.o flasher.o spacey.o eeprom.o pio.o system.o timer.o displa $(SIZE) $@ +# Create hex file for programming from executable file. +space12.hex: space12.out + $(OBJCOPY) -O ihex space12.out space12.hex + + # Target: clean project. .PHONY: clean clean: @@ -87,8 +92,7 @@ clean: # Target: program project. .PHONY: program -program: space12.out - $(OBJCOPY) -O ihex space12.out space12.hex +program: space12.hex dfu-programmer atmega32u2 erase; dfu-programmer atmega32u2 flash space12.hex; dfu-programmer atmega32u2 start diff --git a/apps/space9/Makefile b/apps/space9/Makefile index 52222e9..1194dde 100644 --- a/apps/space9/Makefile +++ b/apps/space9/Makefile @@ -70,6 +70,11 @@ space9.out: space9.o flasher.o spacey.o eeprom.o pio.o system.o timer.o display. $(SIZE) $@ +# Create hex file for programming from executable file. +space9.hex: space9.out + $(OBJCOPY) -O ihex space9.out space9.hex + + # Target: clean project. .PHONY: clean clean: @@ -78,8 +83,7 @@ clean: # Target: program project. .PHONY: program -program: space9.out - $(OBJCOPY) -O ihex space9.out space9.hex +program: space9.hex dfu-programmer atmega32u2 erase; dfu-programmer atmega32u2 flash space9.hex; dfu-programmer atmega32u2 start diff --git a/apps/spacey_remote1/Makefile b/apps/spacey_remote1/Makefile index 0a21cde..ead3407 100644 --- a/apps/spacey_remote1/Makefile +++ b/apps/spacey_remote1/Makefile @@ -61,6 +61,11 @@ spacey_remote1.out: spacey_remote1.o pio.o system.o timer.o display.o ir.o ir_se $(SIZE) $@ +# Create hex file for programming from executable file. +spacey_remote1.hex: spacey_remote1.out + $(OBJCOPY) -O ihex spacey_remote1.out spacey_remote1.hex + + # Target: clean project. .PHONY: clean clean: @@ -69,8 +74,7 @@ clean: # Target: program project. .PHONY: program -program: spacey_remote1.out - $(OBJCOPY) -O ihex spacey_remote1.out spacey_remote1.hex +program: spacey_remote1.hex dfu-programmer atmega32u2 erase; dfu-programmer atmega32u2 flash spacey_remote1.hex; dfu-programmer atmega32u2 start diff --git a/apps/squeak0/Makefile b/apps/squeak0/Makefile index 0a9d5eb..3c9c55f 100644 --- a/apps/squeak0/Makefile +++ b/apps/squeak0/Makefile @@ -49,6 +49,11 @@ squeak0.out: squeak0.o pio.o system.o timer.o mmelody.o ticker.o tweeter.o task. $(SIZE) $@ +# Create hex file for programming from executable file. +squeak0.hex: squeak0.out + $(OBJCOPY) -O ihex squeak0.out squeak0.hex + + # Target: clean project. .PHONY: clean clean: @@ -57,8 +62,7 @@ clean: # Target: program project. .PHONY: program -program: squeak0.out - $(OBJCOPY) -O ihex squeak0.out squeak0.hex +program: squeak0.hex dfu-programmer atmega32u2 erase; dfu-programmer atmega32u2 flash squeak0.hex; dfu-programmer atmega32u2 start diff --git a/apps/squeak1/Makefile b/apps/squeak1/Makefile index ece37a6..c596efc 100644 --- a/apps/squeak1/Makefile +++ b/apps/squeak1/Makefile @@ -52,6 +52,11 @@ squeak1.out: squeak1.o pio.o system.o timer.o led.o mmelody.o ticker.o tweeter.o $(SIZE) $@ +# Create hex file for programming from executable file. +squeak1.hex: squeak1.out + $(OBJCOPY) -O ihex squeak1.out squeak1.hex + + # Target: clean project. .PHONY: clean clean: @@ -60,8 +65,7 @@ clean: # Target: program project. .PHONY: program -program: squeak1.out - $(OBJCOPY) -O ihex squeak1.out squeak1.hex +program: squeak1.hex dfu-programmer atmega32u2 erase; dfu-programmer atmega32u2 flash squeak1.hex; dfu-programmer atmega32u2 start diff --git a/apps/squeak2/Makefile b/apps/squeak2/Makefile index 916835b..4d03d46 100644 --- a/apps/squeak2/Makefile +++ b/apps/squeak2/Makefile @@ -55,6 +55,11 @@ squeak2.out: squeak2.o pio.o system.o timer.o button.o led.o mmelody.o ticker.o $(SIZE) $@ +# Create hex file for programming from executable file. +squeak2.hex: squeak2.out + $(OBJCOPY) -O ihex squeak2.out squeak2.hex + + # Target: clean project. .PHONY: clean clean: @@ -63,8 +68,7 @@ clean: # Target: program project. .PHONY: program -program: squeak2.out - $(OBJCOPY) -O ihex squeak2.out squeak2.hex +program: squeak2.hex dfu-programmer atmega32u2 erase; dfu-programmer atmega32u2 flash squeak2.hex; dfu-programmer atmega32u2 start diff --git a/apps/squeak3/Makefile b/apps/squeak3/Makefile index fbbaf01..bc5e7df 100644 --- a/apps/squeak3/Makefile +++ b/apps/squeak3/Makefile @@ -67,6 +67,11 @@ squeak3.out: squeak3.o pio.o system.o timer.o button.o display.o led.o ledmat.o $(SIZE) $@ +# Create hex file for programming from executable file. +squeak3.hex: squeak3.out + $(OBJCOPY) -O ihex squeak3.out squeak3.hex + + # Target: clean project. .PHONY: clean clean: @@ -75,8 +80,7 @@ clean: # Target: program project. .PHONY: program -program: squeak3.out - $(OBJCOPY) -O ihex squeak3.out squeak3.hex +program: squeak3.hex dfu-programmer atmega32u2 erase; dfu-programmer atmega32u2 flash squeak3.hex; dfu-programmer atmega32u2 start diff --git a/apps/squeak4/Makefile b/apps/squeak4/Makefile index 957c8cf..dca79c1 100644 --- a/apps/squeak4/Makefile +++ b/apps/squeak4/Makefile @@ -67,6 +67,11 @@ squeak4.out: squeak4.o pio.o system.o timer.o button.o display.o led.o ledmat.o $(SIZE) $@ +# Create hex file for programming from executable file. +squeak4.hex: squeak4.out + $(OBJCOPY) -O ihex squeak4.out squeak4.hex + + # Target: clean project. .PHONY: clean clean: @@ -75,8 +80,7 @@ clean: # Target: program project. .PHONY: program -program: squeak4.out - $(OBJCOPY) -O ihex squeak4.out squeak4.hex +program: squeak4.hex dfu-programmer atmega32u2 erase; dfu-programmer atmega32u2 flash squeak4.hex; dfu-programmer atmega32u2 start diff --git a/apps/steer1/Makefile b/apps/steer1/Makefile index 75600e0..7f14bee 100644 --- a/apps/steer1/Makefile +++ b/apps/steer1/Makefile @@ -55,6 +55,11 @@ steer1.out: steer1.o pio.o system.o timer.o display.o ledmat.o navswitch.o font. $(SIZE) $@ +# Create hex file for programming from executable file. +steer1.hex: steer1.out + $(OBJCOPY) -O ihex steer1.out steer1.hex + + # Target: clean project. .PHONY: clean clean: @@ -63,8 +68,7 @@ clean: # Target: program project. .PHONY: program -program: steer1.out - $(OBJCOPY) -O ihex steer1.out steer1.hex +program: steer1.hex dfu-programmer atmega32u2 erase; dfu-programmer atmega32u2 flash steer1.hex; dfu-programmer atmega32u2 start diff --git a/apps/stopwatch1/Makefile b/apps/stopwatch1/Makefile index 44155bc..709b8a1 100644 --- a/apps/stopwatch1/Makefile +++ b/apps/stopwatch1/Makefile @@ -55,6 +55,11 @@ stopwatch1.out: stopwatch1.o pio.o system.o timer.o button.o display.o ledmat.o $(SIZE) $@ +# Create hex file for programming from executable file. +stopwatch1.hex: stopwatch1.out + $(OBJCOPY) -O ihex stopwatch1.out stopwatch1.hex + + # Target: clean project. .PHONY: clean clean: @@ -63,8 +68,7 @@ clean: # Target: program project. .PHONY: program -program: stopwatch1.out - $(OBJCOPY) -O ihex stopwatch1.out stopwatch1.hex +program: stopwatch1.hex dfu-programmer atmega32u2 erase; dfu-programmer atmega32u2 flash stopwatch1.hex; dfu-programmer atmega32u2 start diff --git a/apps/task1/Makefile b/apps/task1/Makefile index 582c5c0..9605f52 100644 --- a/apps/task1/Makefile +++ b/apps/task1/Makefile @@ -43,6 +43,11 @@ task1.out: task1.o pio.o system.o timer.o led.o task.o $(SIZE) $@ +# Create hex file for programming from executable file. +task1.hex: task1.out + $(OBJCOPY) -O ihex task1.out task1.hex + + # Target: clean project. .PHONY: clean clean: @@ -51,8 +56,7 @@ clean: # Target: program project. .PHONY: program -program: task1.out - $(OBJCOPY) -O ihex task1.out task1.hex +program: task1.hex dfu-programmer atmega32u2 erase; dfu-programmer atmega32u2 flash task1.hex; dfu-programmer atmega32u2 start diff --git a/apps/task2/Makefile b/apps/task2/Makefile index 572a004..abce4d9 100644 --- a/apps/task2/Makefile +++ b/apps/task2/Makefile @@ -55,6 +55,11 @@ task2.out: task2.o pio.o system.o timer.o display.o led.o ledmat.o font.o task.o $(SIZE) $@ +# Create hex file for programming from executable file. +task2.hex: task2.out + $(OBJCOPY) -O ihex task2.out task2.hex + + # Target: clean project. .PHONY: clean clean: @@ -63,8 +68,7 @@ clean: # Target: program project. .PHONY: program -program: task2.out - $(OBJCOPY) -O ihex task2.out task2.hex +program: task2.hex dfu-programmer atmega32u2 erase; dfu-programmer atmega32u2 flash task2.hex; dfu-programmer atmega32u2 start diff --git a/apps/tdmdemo1/Makefile b/apps/tdmdemo1/Makefile index c2f4200..dbefe49 100644 --- a/apps/tdmdemo1/Makefile +++ b/apps/tdmdemo1/Makefile @@ -43,6 +43,11 @@ tdmdemo1.out: tdmdemo1.o pio.o system.o timer.o ledmat.o pacer.o $(SIZE) $@ +# Create hex file for programming from executable file. +tdmdemo1.hex: tdmdemo1.out + $(OBJCOPY) -O ihex tdmdemo1.out tdmdemo1.hex + + # Target: clean project. .PHONY: clean clean: @@ -51,8 +56,7 @@ clean: # Target: program project. .PHONY: program -program: tdmdemo1.out - $(OBJCOPY) -O ihex tdmdemo1.out tdmdemo1.hex +program: tdmdemo1.hex dfu-programmer atmega32u2 erase; dfu-programmer atmega32u2 flash tdmdemo1.hex; dfu-programmer atmega32u2 start diff --git a/apps/tdmdemo2/Makefile b/apps/tdmdemo2/Makefile index 75e7be9..8a779ba 100644 --- a/apps/tdmdemo2/Makefile +++ b/apps/tdmdemo2/Makefile @@ -46,6 +46,11 @@ tdmdemo2.out: tdmdemo2.o pio.o system.o timer.o ledmat.o navswitch.o pacer.o $(SIZE) $@ +# Create hex file for programming from executable file. +tdmdemo2.hex: tdmdemo2.out + $(OBJCOPY) -O ihex tdmdemo2.out tdmdemo2.hex + + # Target: clean project. .PHONY: clean clean: @@ -54,8 +59,7 @@ clean: # Target: program project. .PHONY: program -program: tdmdemo2.out - $(OBJCOPY) -O ihex tdmdemo2.out tdmdemo2.hex +program: tdmdemo2.hex dfu-programmer atmega32u2 erase; dfu-programmer atmega32u2 flash tdmdemo2.hex; dfu-programmer atmega32u2 start diff --git a/apps/updown1/Makefile b/apps/updown1/Makefile index c6d67e3..e6726dc 100644 --- a/apps/updown1/Makefile +++ b/apps/updown1/Makefile @@ -52,6 +52,11 @@ updown1.out: updown1.o pio.o system.o timer.o display.o ledmat.o font.o pacer.o $(SIZE) $@ +# Create hex file for programming from executable file. +updown1.hex: updown1.out + $(OBJCOPY) -O ihex updown1.out updown1.hex + + # Target: clean project. .PHONY: clean clean: @@ -60,8 +65,7 @@ clean: # Target: program project. .PHONY: program -program: updown1.out - $(OBJCOPY) -O ihex updown1.out updown1.hex +program: updown1.hex dfu-programmer atmega32u2 erase; dfu-programmer atmega32u2 flash updown1.hex; dfu-programmer atmega32u2 start diff --git a/apps/updown2/Makefile b/apps/updown2/Makefile index 15a9297..721bf4e 100644 --- a/apps/updown2/Makefile +++ b/apps/updown2/Makefile @@ -55,6 +55,11 @@ updown2.out: updown2.o pio.o system.o timer.o display.o ledmat.o navswitch.o fon $(SIZE) $@ +# Create hex file for programming from executable file. +updown2.hex: updown2.out + $(OBJCOPY) -O ihex updown2.out updown2.hex + + # Target: clean project. .PHONY: clean clean: @@ -63,8 +68,7 @@ clean: # Target: program project. .PHONY: program -program: updown2.out - $(OBJCOPY) -O ihex updown2.out updown2.hex +program: updown2.hex dfu-programmer atmega32u2 erase; dfu-programmer atmega32u2 flash updown2.hex; dfu-programmer atmega32u2 start diff --git a/apps/voltmeter1/Makefile b/apps/voltmeter1/Makefile index 7b8f958..30dad5b 100644 --- a/apps/voltmeter1/Makefile +++ b/apps/voltmeter1/Makefile @@ -55,6 +55,11 @@ voltmeter1.out: voltmeter1.o adc.o pio.o system.o timer.o display.o ledmat.o fon $(SIZE) $@ +# Create hex file for programming from executable file. +voltmeter1.hex: voltmeter1.out + $(OBJCOPY) -O ihex voltmeter1.out voltmeter1.hex + + # Target: clean project. .PHONY: clean clean: @@ -63,8 +68,7 @@ clean: # Target: program project. .PHONY: program -program: voltmeter1.out - $(OBJCOPY) -O ihex voltmeter1.out voltmeter1.hex +program: voltmeter1.hex dfu-programmer atmega32u2 erase; dfu-programmer atmega32u2 flash voltmeter1.hex; dfu-programmer atmega32u2 start diff --git a/etc/Makefile.template b/etc/Makefile.template index 5d14233..a89a2e5 100644 --- a/etc/Makefile.template +++ b/etc/Makefile.template @@ -25,6 +25,11 @@ all: @PROJECT@.out $(SIZE) $@ +# Create hex file for programming from executable file. +@PROJECT@.hex: @PROJECT@.out + $(OBJCOPY) -O ihex @PROJECT@.out @PROJECT@.hex + + # Target: clean project. .PHONY: clean clean: @@ -33,7 +38,6 @@ clean: # Target: program project. .PHONY: program -program: @PROJECT@.out - $(OBJCOPY) -O ihex @PROJECT@.out @PROJECT@.hex +program: @PROJECT@.hex dfu-programmer atmega32u2 erase; dfu-programmer atmega32u2 flash @PROJECT@.hex; dfu-programmer atmega32u2 start