targets: all flash flash: all avrdude -P $(FLASHPORT) -p $(MCU) -c $(FLASHDEVTYPE) -U flash:w:$(TARGET).hex setup_config: # setup for bootloader in last 512 words avrdude -P $(FLASHPORT) -p $(MCU) -c $(FLASHDEVTYPE) -U lfuse:w:0xe7:m -U hfuse:w:0xde:m -U efuse:w:0xff:m # MCU name MCU = atmega324p # Target file name (without extension). TARGET = kcb_a32_v1 # Optimization level (can be 0, 1, 2, 3, s) # (Note: 3 is not always the best optimization level. See avr-libc FAQ) OPT = s # List C source files here. (C dependencies are automatically generated.) SRC = main.c timers.c eeprom_l.c adc.c display.c \ statemachine.c SRC += ../lib/devicelock.c ../lib/byte_to_hex.c ../lib/eeprom_x8.c \ ../lib/nmea.c ../lib/nmea_verify.c ../lib/serial_x8.c \ ../lib/sleep.c ../lib/i2c.c # List Assembler source files here. ASRC = CFLAGS += -O$(OPT) -DDATESTR=\"`date +%Y%m%d`\" -DVERSTR=\"0.1\" CFLAGS += -DNMEA_TX_HEADER=\"KA\" -DNMEA_RX_HEADER=\"KC\" CFLAGS += -DF_CPU=20000000UL -DUART_RX_FIFO=96 CFLAGS += -Wno-pointer-sign -fwhole-program #CFLAGS += -Wl,--gc-sections -ffunction-sections LDFLAGS += -lm include ../config2.mak