summaryrefslogtreecommitdiff
path: root/Makefile
blob: b45656483fe29b26f6423f269ff9deef2b3bbc6e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
CC 	= avr-gcc
CFLAGS	= -O2 -Wall -Wextra -mmcu=atmega328p --param=min-pagesize=0
OBJCOPY	= avr-objcopy

PORT	?= /dev/ttyACM0

all: notes lcd

notes:
	${CC} ${CFLAGS} notes.c
	${OBJCOPY} -j .text -j .data -O ihex a.out notes.hex
	rm -f a.out

flash_notes: notes
	avrdude -p atmega328p -c arduino -P ${PORT} -b 115200 -U flash:w:notes.hex:i

lcd:
	${CC} ${CFLAGS} lcd.c
	${OBJCOPY} -j .text -j .data -O ihex a.out lcd.hex
	rm -f a.out

flash_lcd: lcd
	avrdude -p atmega328p -c arduino -P ${PORT} -b 115200 -U flash:w:lcd.hex:i

serial_setup:
	stty -F ${PORT} raw speed 9600 cs8 -cstopb -parenb

serial_open:
	od -x --endian=big -w4 ${PORT}

serial_obsd:
	cu -l ${PORT} -s 9600 | hexdump -C