summaryrefslogtreecommitdiff
path: root/src/makefile
diff options
context:
space:
mode:
Diffstat (limited to 'src/makefile')
-rw-r--r--src/makefile28
1 files changed, 19 insertions, 9 deletions
diff --git a/src/makefile b/src/makefile
index 67a36c0..8c6b06d 100644
--- a/src/makefile
+++ b/src/makefile
@@ -4,14 +4,16 @@ CC=$(TOOLCHAIN_DIR)/bin/avr-gcc
LD=$(TOOLCHAIN_DIR)/bin/avr-ld
INC=$(TOOLCHAIN_DIR)/avr/include
OUT=compiled_payload.elf
-DEVICE=atmega2560
+#DEVICE=atmega2560
+DEVICE=atmega328p
F_CPU=16000000
DEBUG=1
#avrdude options
-PARTNO=ATmega2560
-PORT=/dev/ttyACM1
+#PARTNO=ATmega2560
+PARTNO=ATmega328p
+PORT=/dev/ttyUSB0
BAUD=115200
@@ -25,23 +27,31 @@ make:
#$(CC) -mmcu=$(DEVICE) -I $(INC) -c debug_serial.o -DDEBUG_BUILD=$(DEBUG) -DBAUD=$(RUNTIME_BAUDRATE) -DF_CPU=$(F_CPU) -Wall -O1 i2c.c
#$(LD) -mavr6 -o $(OUT) -s main.o debug_serial.o #TODO wish I knew how to make -mavr6 dependent on DEVICE
#TODO no debug.c if debug disabled
- $(CC) -mmcu=$(DEVICE) -I $(INC) -o $(OUT) -DDEBUG_BUILD=$(DEBUG) -DBAUD=$(RUNTIME_BAUDRATE) -DF_CPU=$(F_CPU) -Wall -O1 main.c debug.c i2c.c ssd1306_display_driver.c uart.c br24t_eeprom_driver.c paint.c -Wall
+ $(CC) -mmcu=$(DEVICE) -I $(INC) -o $(OUT) -DDEBUG_BUILD=$(DEBUG) -DBAUD=$(RUNTIME_BAUDRATE) -DF_CPU=$(F_CPU) -Wall -O1 main.c debug.c i2c.c ssd1306_display_driver.c uart.c br24t_eeprom_driver.c paint.c pcf_clock_driver.c -Wall
compiledb make --dry-run > /dev/null
+reset:
+ doas avrdude -c usbtiny -p $(PARTNO)
+
+eeprom_write:
+ doas avrdude -c usbtiny -p $(PARTNO)
+ doas ./write_eeprom.py $(PORT) $(RUNTIME_BAUDRATE)
+
eeprom:
./compile_eeprom.py
eeprom_install:
- $(CC) -lc -mmcu=$(DEVICE) -I $(INC) -o $(OUT) -DBAUD=$(RUNTIME_BAUDRATE) -DF_CPU=$(F_CPU) -DEEPROM_INSTALL -Wall -O1 debug.c i2c.c ssd1306_driver.c uart.c main.c -Wall
- doas avrdude -v -p $(PARTNO) -P $(PORT) -c wiring -b $(BAUD) -D -U flash:w:$(OUT):e
- doas ./write_eeprom.py $(PORT) $(SPEED)
+ $(CC) -mmcu=$(DEVICE) -I $(INC) -o $(OUT) -DFLASH_EEPROM -DDEBUG_BUILD=$(DEBUG) -DBAUD=$(RUNTIME_BAUDRATE) -DF_CPU=$(F_CPU) -Wall -O1 main.c debug.c i2c.c ssd1306_display_driver.c uart.c br24t_eeprom_driver.c paint.c -Wall
+ doas avrdude -B 1 -v -p $(PARTNO) -c usbtiny -U flash:w:$(OUT):e
install: $(OUT)
- doas avrdude -v -p $(PARTNO) -P $(PORT) -c wiring -b $(BAUD) -D -U flash:w:$(OUT):e
+ doas avrdude -B 1 -v -p $(PARTNO) -c usbtiny -U flash:w:$(OUT):e
+ #doas avrdude -v -p $(PARTNO) -P $(PORT) -c wiring -b $(BAUD) -D -U flash:w:$(OUT):e
screen:
- screen $(PORT) $(RUNTIME_BAUDRATE)
+ doas avrdude -c usbtiny -p $(PARTNO)
+ doas screen $(PORT) $(RUNTIME_BAUDRATE)
clean:
rm -f *.o *.elf compiled_eeprom