mirror of
https://codeberg.org/eel4746_piano/avr_piano.git
synced 2024-11-22 09:10:30 -05:00
Vineet K
edd35cae3b
Besides moving the UART into an interrupt, we also need to read from UART to set the mode of playing from buttons or from serial notes
30 lines
642 B
Makefile
30 lines
642 B
Makefile
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: notes
|
|
avrdude -p atmega328p -c arduino -P ${PORT} -b 115200 -U flash:w:lcd.hex:i
|
|
|
|
serial_setup:
|
|
stty -F ${PORT} raw speed 115200 cs8 -cstopb -parenb
|
|
|
|
serial_open:
|
|
od -x --endian=big -w4 ${PORT}
|