sysprog-basic/blink/build.sh

18 lines
501 B
Bash
Executable File

#!/bin/bash
set -e
TDIR=$(mktemp -d)
BUILD=./build
mkdir -p $BUILD
avr-gcc -mmcu=atmega328p -DF_CPU=16000000L \
-DARDUINO=10607 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR \
-I/usr/avr/include \
main.c -o $BUILD/main.elf
avr-objcopy -O ihex -R .eeprom $BUILD/main.elf $BUILD/main.hex
avr-size -A $BUILD/main.elf
avrdude \
"-C/home/plex/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/etc/avrdude.conf" -v -V \
-patmega328p -carduino -P/dev/ttyUSB0 -b57600 -D \
-Uflash:w:$BUILD/main.hex:i