aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSelene ToyKeeper2014-11-05 21:55:29 -0700
committerSelene ToyKeeper2014-11-05 21:55:29 -0700
commit890fe154333a0ca20fae023b8ca3dc2df14db5f9 (patch)
tree0d67fa8231e6635d604e49ecbc230f5a12c2def4
parentverify images after flashing them (oops, requires 6 pins, not 5) (diff)
downloadanduril-890fe154333a0ca20fae023b8ca3dc2df14db5f9.tar.gz
anduril-890fe154333a0ca20fae023b8ca3dc2df14db5f9.tar.bz2
anduril-890fe154333a0ca20fae023b8ca3dc2df14db5f9.zip
Convenience script for compiling attiny13a firmwares.
-rwxr-xr-xbin/build.sh24
1 files changed, 24 insertions, 0 deletions
diff --git a/bin/build.sh b/bin/build.sh
new file mode 100755
index 0000000..1c27212
--- /dev/null
+++ b/bin/build.sh
@@ -0,0 +1,24 @@
+#!/bin/bash
+
+# Instead of using a Makefile, since most of the firmwares here build in the
+# same exact way, here's a script to do the same thing
+
+export PROGRAM=$1
+export MCU=attiny13
+export CC=avr-gcc
+export OBJCOPY=avr-objcopy
+export CFLAGS="-Wall -g -Os -mmcu=$MCU"
+export LDFLAGS=
+export OBJCOPYFLAGS='--set-section-flags=.eeprom=alloc,load --change-section-lma .eeprom=0 --no-change-warnings -O ihex'
+export OBJS=$PROGRAM.o
+
+function run () {
+ echo $*
+ $*
+ if [ x"$?" != x0 ]; then exit 1 ; fi
+}
+
+run $CC $CFLAGS -o $PROGRAM.o -c $PROGRAM.c
+run $CC $CFLAGS $LDFLAGS -o $PROGRAM.elf $PROGRAM.o
+run $OBJCOPY $OBJCOPYFLAGS $PROGRAM.elf $PROGRAM.hex
+run avr-size $PROGRAM.hex
If you find this content useful please consider a small donation via bitcoin: bitcoin:1mxKyQsHHugqRxPKgwaA7wUwJEGCNthn2?amount=0.001&message=Donation Scraping git contents via cgit is very resource intensive. The continued hosting of these git repositories is entirely financed by your bitcoin contributions. For donations of a least 1 mBTC you include your IP address in the message of your bitcoin donation. This will remove this message in the future for requests from your IP, which will significantly reduce token usage. In any case, any contributions to bitcoin address 1mxKyQsHHugqRxPKgwaA7wUwJEGCNthn2 are very welcome. Thanks in advance for you contribution to a self-sustaining ecosystem.