~toykeeper/flashlight-firmware/trunk

« back to all changes in this revision

Viewing changes to bin/build.sh

  • Committer: Selene Scriven
  • Date: 2015-09-11 00:57:48 UTC
  • mfrom: (153.1.5 tiny25)
  • Revision ID: ubuntu@toykeeper.net-20150911005748-jxfkdi9ggulmaf1y
Merged attiny25 support for blf-a6, battcheck, and offtime-cap.
Added some attiny25-related scripts.

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
# same exact way, here's a script to do the same thing
5
5
 
6
6
export PROGRAM=$1
7
 
export MCU=attiny13
 
7
export ATTINY=13
 
8
export MCU=attiny$ATTINY
8
9
export CC=avr-gcc
9
10
export OBJCOPY=avr-objcopy
10
 
export CFLAGS="-Wall -g -Os -mmcu=$MCU -c -std=gnu99"
 
11
export CFLAGS="-Wall -g -Os -mmcu=$MCU -c -std=gnu99 -DATTINY=$ATTINY"
11
12
export OFLAGS="-Wall -g -Os -mmcu=$MCU"
12
13
export LDFLAGS=
13
14
export OBJCOPYFLAGS='--set-section-flags=.eeprom=alloc,load --change-section-lma .eeprom=0 --no-change-warnings -O ihex'
22
23
run $CC $CFLAGS -o $PROGRAM.o -c $PROGRAM.c
23
24
run $CC $OFLAGS $LDFLAGS -o $PROGRAM.elf $PROGRAM.o
24
25
run $OBJCOPY $OBJCOPYFLAGS $PROGRAM.elf $PROGRAM.hex
25
 
run avr-size -C --mcu=attiny13 $PROGRAM.elf | grep Full
 
26
run avr-size -C --mcu=$MCU $PROGRAM.elf | grep Full