pomodoro-avr

Pomodoro timer на базе Attiny45
git clone git://git.konyahin.xyz/pomodoro-avr
Log | Files | Refs | LICENSE

commit d801e67aed47f7f4f3b89d619eaf286a15e12eb8
parent 4b80983f6b9a4c1b41ad8c5b7aeaba7fbc3d3a05
Author: Anton Konyahin <me@konyahin.xyz>
Date:   Sun, 10 Apr 2022 16:12:07 +0300

Improve Makefile

Diffstat:
MMakefile | 25+++++++++++++------------
Mmain.c | 4+++-
2 files changed, 16 insertions(+), 13 deletions(-)

diff --git a/Makefile b/Makefile @@ -1,17 +1,18 @@ PROG=USBasp -MMCU=attiny45 -MCP=t45 -FCPU=1200000 +MCU=attiny45 +F_CPU=1200000 +CC=avr-gcc +OBJCOPY=avr-objcopy +CFLAGS=-std=c99 -Wall -g -Os -mmcu=$(MCU) -DF_CPU=$(F_CPU) -I. +TARGET=pomodoro +SRCS=main.c interrupt.c -burn: main.hex - avrdude -c $(PROG) -p $(MCP) -U flash:w:./main.hex +build: $(SRCS) + $(CC) $(CFLAGS) -o $(TARGET).bin $(SRCS) + $(OBJCOPY) -j .text -j .data -O ihex $(TARGET).bin $(TARGET).hex -build: main.hex - -main.hex: main.c interrupt.c - avr-gcc -g -Os -mmcu=$(MMCU) -DF_CPU=$(FCPU) -c main.c interrupt.c - avr-gcc -g -mmcu=$(MMCU) -o main.elf main.o interrupt.o - avr-objcopy -j .text -j .data -O ihex main.elf main.hex +burn: build + avrdude -c $(PROG) -p $(MCU) -U flash:w:./$(TARGET).hex clean: - rm -f *.elf *.hex *.o + rm -f *.bin *.hex *.o diff --git a/main.c b/main.c @@ -43,7 +43,7 @@ void switch_status() set_status(); } -void main(void) +int main(void) { DDRB |= (1 << LED_GREEN); DDRB |= (1 << LED_RED); @@ -56,4 +56,6 @@ void main(void) while (true) { } + + return 0; }