]> jspc29.x-matter.uni-frankfurt.de Git - avr.git/commitdiff
extending daqi for more LED, adding arduino to Daqi makefile
authorJan Michel <jan@mueschelsoft.de>
Mon, 28 Mar 2016 17:17:02 +0000 (19:17 +0200)
committerJan Michel <jan@mueschelsoft.de>
Mon, 28 Mar 2016 17:17:02 +0000 (19:17 +0200)
atmega32u4/cooler/lcdlib/.gitattributes
atmega32u4/daqi/Makefile
atmega32u4/daqi/daqi.c

index 0ab96b6688cd8ddcfcb920115f82c0e40faa8bae..670c7f1e4a0d8f48465ad2c36d4562981187fbe8 100644 (file)
@@ -1,4 +1,4 @@
-* text=auto\r
-*.c text\r
-*.h text\r
+* text=auto
+*.c text
+*.h text
 *.font binary
\ No newline at end of file
index b3727695b0c560a7c192a50109a71e6054aab1f0..7087a8150b8787488cd5658d915856a1ceae4be7 100644 (file)
@@ -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 <http://savannah.nongnu.org/projects/avrdude> 
@@ -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
index 2b8b6f7b9ae65bd65d8dff207790729dea60e95f..0d99a4262e625989e58e65fa627cd003576f58c8 100644 (file)
@@ -5,7 +5,7 @@
 #include <avr/io.h>
 #include <usb_serial.h>
 
-#define NUM_LEDS 2
+#define NUM_LEDS 5
 
 #define LED_RGB_HIGH() PORTF |=  (1<<PF4)
 #define LED_RGB_LOW()  PORTF &= ~(1<<PF4)
@@ -15,9 +15,9 @@
 uint8_t buffer[BUFFERSIZE];
 uint8_t pointer = 0;
 
-uint8_t red[NUM_LEDS]   = {0xff,0x00};
-uint8_t green[NUM_LEDS] = {0x00,0xff};
-uint8_t blue[NUM_LEDS]  = {0x20,0x20};
+uint8_t red[NUM_LEDS]   = {0xff};
+uint8_t green[NUM_LEDS] = {0xff};
+uint8_t blue[NUM_LEDS]  = {0xff};
 
 
 void init(void) {