2024-04-15 21:55:51 -04:00
|
|
|
CC = avr-gcc
|
2024-04-17 14:26:45 -04:00
|
|
|
CFLAGS = -O2 -Wall -Wextra -mmcu=atmega328p --param=min-pagesize=0
|
2024-04-15 21:55:51 -04:00
|
|
|
OBJCOPY = avr-objcopy
|
|
|
|
|
2024-04-17 10:07:39 -04:00
|
|
|
PORT ?= /dev/ttyACM0
|
|
|
|
|
2024-04-17 13:59:33 -04:00
|
|
|
all: notes lcd
|
|
|
|
|
|
|
|
notes:
|
2024-04-17 14:07:35 -04:00
|
|
|
${CC} ${CFLAGS} notes.c
|
|
|
|
${OBJCOPY} -j .text -j .data -O ihex a.out notes.hex
|
2024-04-17 13:59:33 -04:00
|
|
|
rm -f a.out
|
|
|
|
|
|
|
|
flash_notes: notes
|
2024-04-17 14:07:35 -04:00
|
|
|
avrdude -p atmega328p -c arduino -P ${PORT} -b 115200 -U flash:w:notes.hex:i
|
2024-04-17 13:59:33 -04:00
|
|
|
|
|
|
|
lcd:
|
2024-04-17 14:07:35 -04:00
|
|
|
${CC} ${CFLAGS} lcd.c
|
|
|
|
${OBJCOPY} -j .text -j .data -O ihex a.out lcd.hex
|
2024-04-15 21:55:51 -04:00
|
|
|
rm -f a.out
|
|
|
|
|
2024-04-17 13:59:33 -04:00
|
|
|
flash_lcd: notes
|
2024-04-17 14:07:35 -04:00
|
|
|
avrdude -p atmega328p -c arduino -P ${PORT} -b 115200 -U flash:w:lcd.hex:i
|
2024-04-20 00:01:55 -04:00
|
|
|
|
|
|
|
serial_setup:
|
|
|
|
stty -F ${PORT} raw speed 115200 cs8 -cstopb -parenb
|
|
|
|
|
|
|
|
serial_open:
|
|
|
|
od -x --endian=big -w4 ${PORT}
|