From: Jan Michel Date: Mon, 28 Mar 2016 17:17:02 +0000 (+0200) Subject: extending daqi for more LED, adding arduino to Daqi makefile X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=0f316f9e72431bfd89544ae4200f080d8682a480;p=avr.git extending daqi for more LED, adding arduino to Daqi makefile --- diff --git a/atmega32u4/cooler/lcdlib/.gitattributes b/atmega32u4/cooler/lcdlib/.gitattributes index 0ab96b6..670c7f1 100644 --- a/atmega32u4/cooler/lcdlib/.gitattributes +++ b/atmega32u4/cooler/lcdlib/.gitattributes @@ -1,4 +1,4 @@ -* text=auto -*.c text -*.h text +* text=auto +*.c text +*.h text *.font binary \ No newline at end of file diff --git a/atmega32u4/daqi/Makefile b/atmega32u4/daqi/Makefile index b372769..7087a81 100644 --- a/atmega32u4/daqi/Makefile +++ b/atmega32u4/daqi/Makefile @@ -8,9 +8,10 @@ MCU = atmega32u4 FORMAT = ihex TARGET = daqi -SRC = $(TARGET).c usb_serial.c +SRC = $(TARGET).c usb_serial.c ASRC = -OPT = s +OPT = 2 +PORT=/dev/ttyACM0 # Name of this Makefile (used for "make depend"). MAKEFILE = Makefile @@ -28,17 +29,17 @@ DEBUG = stabs CSTANDARD = -std=gnu99 # Place -D or -U options here -CDEFS = +CDEFS = -DF_CPU=16000000 # Place -I options here CINCS = CDEBUG = -g$(DEBUG) -CWARN = -Wall -Wstrict-prototypes -CTUNING = -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums +CWARN = -Wall -Wstrict-prototypes +CTUNING = -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wl,--relax #CEXTRA = -Wa,-adhlns=$(<:.c=.lst) -CFLAGS = $(CDEBUG) $(CDEFS) $(CINCS) -O$(OPT) $(CWARN) $(CSTANDARD) $(CEXTRA) +CFLAGS = $(CDEBUG) $(CDEFS) $(CINCS) -O$(OPT) $(CWARN) $(CSTANDARD) $(CEXTRA) $(CTUNING) #ASFLAGS = -Wa,-adhlns=$(<:.S=.lst),-gstabs @@ -82,7 +83,7 @@ LDFLAGS = $(EXTMEMOPTS) $(LDMAP) $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB) # Programming support using avrdude. Settings and variables. -AVRDUDE_PROGRAMMER = dragon_isp +AVRDUDE_PROGRAMMER = dragon_jtag AVRDUDE_PORT = usb AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex @@ -96,7 +97,7 @@ AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex # Uncomment the following if you do /not/ wish a verification to be # performed after programming the device. -#AVRDUDE_NO_VERIFY = -V +AVRDUDE_NO_VERIFY = -V # Increase verbosity level. Please use this when submitting bug # reports about avrdude. See @@ -144,10 +145,9 @@ sym: $(TARGET).sym program: $(TARGET).hex $(TARGET).eep $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM) -program_dfu: $(TARGET).hex - dfu-programmer $(MCU) erase && dfu-programmer $(MCU) flash $(TARGET).hex && dfu-programmer $(MCU) start - +size: + $(SIZE) -C --mcu=$(MCU) $(TARGET).elf # Convert ELF to COFF for use in debugging / simulating in AVR Studio or VMLAB. COFFCONVERT=$(OBJCOPY) --debugging \ @@ -222,5 +222,10 @@ depend: >> $(MAKEFILE); \ $(CC) -M -mmcu=$(MCU) $(CDEFS) $(CINCS) $(SRC) $(ASRC) >> $(MAKEFILE) -.PHONY: all build elf hex eep lss sym program coff extcoff clean depend +.PHONY: all build elf hex eep lss sym program coff extcoff clean depend program_bootloader program_arduino + +program_bootloader: all + dfu-programmer $(MCU) erase && dfu-programmer $(MCU) flash $(TARGET).hex && dfu-programmer $(MCU) start +program_arduino: all + avrdude -patmega32u4 -cavr109 -P$(PORT) -b57600 -D -Uflash:w:$(TARGET).hex:i diff --git a/atmega32u4/daqi/daqi.c b/atmega32u4/daqi/daqi.c index 2b8b6f7..0d99a42 100644 --- a/atmega32u4/daqi/daqi.c +++ b/atmega32u4/daqi/daqi.c @@ -5,7 +5,7 @@ #include #include -#define NUM_LEDS 2 +#define NUM_LEDS 5 #define LED_RGB_HIGH() PORTF |= (1<