~gabe/flashlight-firmware/anduril2

« back to all changes in this revision

Viewing changes to bin/build-85.sh

  • Committer: Selene Scriven
  • Date: 2016-09-09 21:24:27 UTC
  • mfrom: (169.1.2 add-x85)
  • Revision ID: ubuntu@toykeeper.net-20160909212427-rjth501ui6cqugud
Merged in Mike C's X85 firmware.
It's pretty full-featured and advanced, but requires a special driver.
Still needs more info in its "meta" file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/bash
 
2
 
 
3
# Instead of using a Makefile, since most of the firmwares here build in the
 
4
# same exact way, here's a script to do the same thing
 
5
 
 
6
export PROGRAM=$1
 
7
export ATTINY=85
 
8
export MCU=attiny$ATTINY
 
9
export CC=avr-gcc
 
10
export OBJCOPY=avr-objcopy
 
11
export CFLAGS="-Wall -g -Os -mmcu=$MCU -c -std=gnu99 -DATTINY=$ATTINY -I.."
 
12
export OFLAGS="-Wall -g -Os -mmcu=$MCU"
 
13
export LDFLAGS=
 
14
export OBJCOPYFLAGS='--set-section-flags=.eeprom=alloc,load --change-section-lma .eeprom=0 --no-change-warnings -O ihex'
 
15
export OBJS=$PROGRAM.o
 
16
 
 
17
function run () {
 
18
  echo $*
 
19
  $*
 
20
  if [ x"$?" != x0 ]; then exit 1 ; fi
 
21
}
 
22
 
 
23
run $CC $CFLAGS -o $PROGRAM.o -c $PROGRAM.c
 
24
run $CC $OFLAGS $LDFLAGS -o $PROGRAM.elf $PROGRAM.o
 
25
run $OBJCOPY $OBJCOPYFLAGS $PROGRAM.elf $PROGRAM.hex
 
26
run avr-size -C --mcu=$MCU $PROGRAM.elf | grep Full