This commit is contained in:
Олег Бородин
2024-08-22 04:14:51 +02:00
parent fbd0a7e6e8
commit aee7e32bf0
9 changed files with 263 additions and 90 deletions

View File

@@ -7,12 +7,12 @@ F_CPU = 16000000UL
MCU = atmega328p
CFLAGS += -DF_CPU=$(F_CPU) -mmcu=$(MCU)
CFLAGS += -I. -O2 --std=c11
CFLAGS += -I. -Os --std=c11
CFLAGS += -ffunction-sections -fdata-sections
LDFLAGS += -s -mmcu=$(MCU)
LDFLAGS += -Wl,--gc-sections
LDFLAGS += -Wl,-u,vfprintf -lprintf_flt
LDFLAGS += -Wl,-u,vfprintf -lprintf_flt -lm
MAIN_OBJS += main.o
MAIN_OBJS += adc.o
@@ -54,7 +54,7 @@ TTY_SPEED = 115200
BACKUP = $(MAIN_HEX).bak
upload: $(MAIN_HEX)
$(AVRDUDE) -qq -c arduino -p ATMEGA328P -P $(TTY_PORT) -b $(TTY_SPEED) -U flash:w:$<
$(AVRDUDE) -qq -c arduino -p m328p -P $(TTY_PORT) -b $(TTY_SPEED) -U flash:w:$<
download:
$(AVRDUDE) -F -V -c arduino -p m328p -P $(TTY_PORT) -b $(TTY_SPEED) -U flash:r:$(BACKUP):i