From 121eff2882f448cc88705af66f5cbaa08972bfac Mon Sep 17 00:00:00 2001 From: Selene ToyKeeper Date: Mon, 5 Aug 2019 01:41:02 -0600 Subject: replaced deprecated avr-size with avr-objdump in build.sh --- bin/build.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'bin') diff --git a/bin/build.sh b/bin/build.sh index ddd2a72..192fa30 100755 --- a/bin/build.sh +++ b/bin/build.sh @@ -33,4 +33,6 @@ function run () { run $CC $OTHERFLAGS $CFLAGS -o $PROGRAM.o -c $PROGRAM.c run $CC $OFLAGS $LDFLAGS -o $PROGRAM.elf $PROGRAM.o run $OBJCOPY $OBJCOPYFLAGS $PROGRAM.elf $PROGRAM.hex -run avr-size -C --mcu=$MCU $PROGRAM.elf | grep Full +# deprecated +#run avr-size -C --mcu=$MCU $PROGRAM.elf | grep Full +run avr-objdump -Pmem-usage $PROGRAM.elf | grep Full -- cgit v1.2.3 From 09213cc3c27b70727f8296f8f661a308100ff40c Mon Sep 17 00:00:00 2001 From: Selene ToyKeeper Date: Mon, 5 Aug 2019 01:49:46 -0600 Subject: added scripts to flash attiny1634, which were missing before --- bin/flash-tiny1634-fuses.sh | 9 +++++++++ bin/flash-tiny1634.sh | 3 +++ 2 files changed, 12 insertions(+) create mode 100755 bin/flash-tiny1634-fuses.sh create mode 100755 bin/flash-tiny1634.sh (limited to 'bin') diff --git a/bin/flash-tiny1634-fuses.sh b/bin/flash-tiny1634-fuses.sh new file mode 100755 index 0000000..1bc73e1 --- /dev/null +++ b/bin/flash-tiny1634-fuses.sh @@ -0,0 +1,9 @@ +#/bin/sh +# 8 MHz, 64ms boot delay, enable flashing +# (everything else disabled) +# Use low fuse 0xD2 for 4ms startup delay, +# or 0xE2 for 64ms (useful on a twisty light) +# Use high fuse 0xDE for BOD 1.8V, +# or 0xDF for no BOD +avrdude -c usbasp -p t1634 -u -U lfuse:w:0xe2:m -U hfuse:w:0xde:m -U efuse:w:0xff:m + diff --git a/bin/flash-tiny1634.sh b/bin/flash-tiny1634.sh new file mode 100755 index 0000000..2eb9b77 --- /dev/null +++ b/bin/flash-tiny1634.sh @@ -0,0 +1,3 @@ +#/bin/sh +FIRMWARE=$1 +avrdude -c usbasp -p t1634 -u -Uflash:w:$FIRMWARE -- cgit v1.2.3 From a67ba8d52f04fc74d90f1885325f76cec04546f4 Mon Sep 17 00:00:00 2001 From: Selene ToyKeeper Date: Wed, 28 Aug 2019 02:28:01 -0600 Subject: added arbitrary ramp shape powers to level_calc.py, to more easily hit specific values --- bin/level_calc.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'bin') diff --git a/bin/level_calc.py b/bin/level_calc.py index f16f8ce..6f07621 100755 --- a/bin/level_calc.py +++ b/bin/level_calc.py @@ -14,7 +14,7 @@ def main(args): """ # Get parameters from the user questions_main = [ - (str, 'ramp_shape', 'cube', 'Ramp shape? [cube, square, fifth, seventh, ninth, log]'), + (str, 'ramp_shape', 'cube', 'Ramp shape? [cube, square, fifth, seventh, ninth, log, N.NN]'), (int, 'num_channels', 1, 'How many power channels?'), (int, 'num_levels', 4, 'How many total levels do you want?'), ] @@ -179,11 +179,19 @@ shapes = dict( ) def power(x): - return shapes[ramp_shape][0](x) + try: + factor = float(ramp_shape) + return math.pow(x, factor) + except ValueError: + return shapes[ramp_shape][0](x) def invpower(x): - return shapes[ramp_shape][1](x) + try: + factor = float(ramp_shape) + return math.pow(x, 1.0 / factor) + except ValueError: + return shapes[ramp_shape][1](x) def input_text(): -- cgit v1.2.3 From 5cde301fc1ae3f297804c93a2528ab4a79a5f6cd Mon Sep 17 00:00:00 2001 From: Selene ToyKeeper Date: Sun, 15 Sep 2019 15:35:29 -0600 Subject: level_calc.py: note the highest level for each channel before the next channel starts, so it'll be easier to identify the channel transition points --- bin/level_calc.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'bin') diff --git a/bin/level_calc.py b/bin/level_calc.py index f16f8ce..f1e7d16 100755 --- a/bin/level_calc.py +++ b/bin/level_calc.py @@ -152,6 +152,16 @@ def multi_pwm(answers, channels): (cnum+1, ','.join([str(int(round(i))) for i in channel.modes]))) + # Show highest level for each channel before next channel starts + for cnum, channel in enumerate(channels[:-1]): + prev = 0 + i = 1 + while (i < answers.num_levels) \ + and (channel.modes[i] >= channel.modes[i-1]) \ + and (channels[cnum+1].modes[i] == 0): + i += 1 + print('Ch%i max: %i (%.2f/255)' % (cnum, i, channel.modes[i-1])) + def get_value(text, default, args): """Get input from the user, or from the command line args.""" -- cgit v1.2.3 From 87f5095f52e8e9ccb30ee4ff4beda75ef5b11baa Mon Sep 17 00:00:00 2001 From: Selene ToyKeeper Date: Wed, 18 Sep 2019 16:17:27 -0600 Subject: added a compile flag to fix compatibility with GCC 7/8/9's new semantics for "inline" (should fix builds on newer compilers, I think) --- bin/build.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'bin') diff --git a/bin/build.sh b/bin/build.sh index 192fa30..fbb24ea 100755 --- a/bin/build.sh +++ b/bin/build.sh @@ -14,9 +14,9 @@ export PROGRAM=$1 ; shift export MCU=attiny$ATTINY export CC=avr-gcc export OBJCOPY=avr-objcopy -export CFLAGS="-Wall -g -Os -mmcu=$MCU -c -std=gnu99 -DATTINY=$ATTINY -I.. -I../.. -I../../.. -fshort-enums" +export CFLAGS="-Wall -g -Os -mmcu=$MCU -c -std=gnu99 -fgnu89-inline -DATTINY=$ATTINY -I.. -I../.. -I../../.. -fshort-enums" export OFLAGS="-Wall -g -Os -mmcu=$MCU" -export LDFLAGS= +export LDFLAGS="-fgnu89-inline" export OBJCOPYFLAGS='--set-section-flags=.eeprom=alloc,load --change-section-lma .eeprom=0 --no-change-warnings -O ihex' export OBJS=$PROGRAM.o -- cgit v1.2.3