diff options
| author | Selene ToyKeeper | 2018-11-08 17:45:09 -0700 |
|---|---|---|
| committer | Selene ToyKeeper | 2018-11-08 17:45:09 -0700 |
| commit | e143d03198ff1d16cc91ed94d5ea529170e9bfbf (patch) | |
| tree | 0f5ebc8816bea516722dfec7ea832994e4b3c9bf | |
| parent | added lantern pin layout (diff) | |
| parent | Made it easier to override hwdef-*.h values in cfg-*.h files. (diff) | |
| download | anduril-e143d03198ff1d16cc91ed94d5ea529170e9bfbf.tar.gz anduril-e143d03198ff1d16cc91ed94d5ea529170e9bfbf.tar.bz2 anduril-e143d03198ff1d16cc91ed94d5ea529170e9bfbf.zip | |
merged upstream changes from fsm branch
40 files changed, 332 insertions, 443 deletions
diff --git a/bin/build-25.sh b/bin/build-25.sh deleted file mode 100755 index a775a0f..0000000 --- a/bin/build-25.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/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 ; shift -export ATTINY=25 -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 OFLAGS="-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 - -for arg in "$*" ; do - OTHERFLAGS="$OTHERFLAGS $arg" -done - -function run () { - echo $* - $* - if [ x"$?" != x0 ]; then exit 1 ; fi -} - -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 diff --git a/bin/build-85.sh b/bin/build-85.sh deleted file mode 100755 index f0cf1b9..0000000 --- a/bin/build-85.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/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 ; shift -export ATTINY=85 -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 OFLAGS="-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 - -for arg in "$*" ; do - OTHERFLAGS="$OTHERFLAGS $arg" -done - -function run () { - echo $* - $* - if [ x"$?" != x0 ]; then exit 1 ; fi -} - -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 diff --git a/bin/build-tiny13.sh b/bin/build-tiny13.sh new file mode 100755 index 0000000..d4b492f --- /dev/null +++ b/bin/build-tiny13.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +BASEDIR=$(dirname "$0") +$BASEDIR/build.sh 13 $* diff --git a/bin/build-tiny25.sh b/bin/build-tiny25.sh new file mode 100755 index 0000000..779f1ef --- /dev/null +++ b/bin/build-tiny25.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +BASEDIR=$(dirname "$0") +$BASEDIR/build.sh 25 $* diff --git a/bin/build-tiny85.sh b/bin/build-tiny85.sh new file mode 100755 index 0000000..6ee8397 --- /dev/null +++ b/bin/build-tiny85.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +BASEDIR=$(dirname "$0") +$BASEDIR/build.sh 85 $* diff --git a/bin/build.sh b/bin/build.sh index c1f0446..ddd2a72 100755 --- a/bin/build.sh +++ b/bin/build.sh @@ -3,8 +3,14 @@ # 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 +if [ -z "$1" ]; then + echo "Usage: build.sh MCU myprogram" + echo "MCU is a number, like '13' for attiny13 or '841' for attiny841" + exit +fi + +export ATTINY=$1 ; shift export PROGRAM=$1 ; shift -export ATTINY=13 export MCU=attiny$ATTINY export CC=avr-gcc export OBJCOPY=avr-objcopy diff --git a/bin/flash-25.sh b/bin/flash-25.sh deleted file mode 100755 index 0b24bb2..0000000 --- a/bin/flash-25.sh +++ /dev/null @@ -1,4 +0,0 @@ -#/bin/sh -FIRMWARE=$1 -avrdude -c usbasp -p t25 -u -U lfuse:w:0xd2:m -U hfuse:w:0xdf:m -U efuse:w:0xff:m -Uflash:w:$FIRMWARE -# http://www.engbedded.com/cgi-bin/fcx.cgi?P_PREV=ATtiny25&P=ATtiny25&M_LOW_0x3F=0x22&M_HIGH_0x07=0x07&M_HIGH_0x20=0x00&B_SUT1=P&B_SPIEN=P&B_CKSEL3=P&B_CKSEL2=P&B_CKSEL0=P&V_LOW=D2&V_HIGH=DF&V_EXTENDED=FF diff --git a/bin/flash-85.sh b/bin/flash-85.sh deleted file mode 100755 index 8d1636d..0000000 --- a/bin/flash-85.sh +++ /dev/null @@ -1,4 +0,0 @@ -#/bin/sh -FIRMWARE=$1 -avrdude -c usbasp -p t85 -u -U lfuse:w:0xe2:m -U hfuse:w:0xdf:m -U efuse:w:0xff:m -Uflash:w:$FIRMWARE -# http://www.engbedded.com/cgi-bin/fcx.cgi?P_PREV=ATtiny85&P=ATtiny85&M_LOW_0x3F=0x22&M_HIGH_0x07=0x06&M_HIGH_0x20=0x00&B_SPIEN=P&B_SUT0=P&B_CKSEL3=P&B_CKSEL2=P&B_CKSEL0=P&B_BODLEVEL0=P&V_LOW=E2&V_HIGH=DE&V_EXTENDED=FF diff --git a/bin/flash-tiny13-fuses.bat b/bin/flash-tiny13-fuses.bat new file mode 100755 index 0000000..cec982e --- /dev/null +++ b/bin/flash-tiny13-fuses.bat @@ -0,0 +1 @@ +avrdude -c usbasp -p t13 -u -Ulfuse:w:0x75:m -Uhfuse:w:0xFF:m diff --git a/bin/flash-tiny13-fuses.sh b/bin/flash-tiny13-fuses.sh new file mode 100755 index 0000000..fe479a8 --- /dev/null +++ b/bin/flash-tiny13-fuses.sh @@ -0,0 +1,8 @@ +#/bin/sh +# 4.8 MHz (~4.0 MHz actual), 4ms boot delay, enable flashing +# (everything else disabled) +# Use low fuse 0x75 for 4ms startup delay, +# or 0x79 for 64ms (useful on a twisty light) +avrdude -c usbasp -p t13 -u -Ulfuse:w:0x75:m -Uhfuse:w:0xFF:m + +# http://www.engbedded.com/cgi-bin/fcx.cgi?P_PREV=ATtiny13A&P=ATtiny13A&M_LOW_0x0F=0x05&M_LOW_0x80=0x00&M_HIGH_0x06=0x06&B_SPIEN=P&B_SUT1=P&B_CKSEL1=P&V_LOW=75&V_HIGH=FF&O_HEX=Apply+values diff --git a/bin/flash-tiny13.bat b/bin/flash-tiny13.bat new file mode 100755 index 0000000..db75fd8 --- /dev/null +++ b/bin/flash-tiny13.bat @@ -0,0 +1 @@ +avrdude -p t13 -c usbasp -u -Uflash:w:%1:a diff --git a/bin/flash-tiny13.sh b/bin/flash-tiny13.sh new file mode 100755 index 0000000..47b2bfe --- /dev/null +++ b/bin/flash-tiny13.sh @@ -0,0 +1,3 @@ +#/bin/sh +FIRMWARE=$1 +avrdude -c usbasp -p t13 -u -Uflash:w:$FIRMWARE diff --git a/bin/flash-tiny25-fuses.sh b/bin/flash-tiny25-fuses.sh new file mode 100755 index 0000000..65d5b1d --- /dev/null +++ b/bin/flash-tiny25-fuses.sh @@ -0,0 +1,8 @@ +#/bin/sh +# 8 MHz, 4ms boot delay, enable flashing +# (everything else disabled) +# Use low fuse 0xD2 for 4ms startup delay, +# or 0xE2 for 64ms (useful on a twisty light) +avrdude -c usbasp -p t25 -u -U lfuse:w:0xd2:m -U hfuse:w:0xdf:m -U efuse:w:0xff:m + +# http://www.engbedded.com/cgi-bin/fcx.cgi?P_PREV=ATtiny25&P=ATtiny25&M_LOW_0x3F=0x22&M_HIGH_0x07=0x07&M_HIGH_0x20=0x00&B_SPIEN=P&B_SUT0=P&B_CKSEL3=P&B_CKSEL2=P&B_CKSEL0=P&V_LOW=E2&V_HIGH=DF&V_EXTENDED=FF&O_HEX=Apply+values diff --git a/bin/flash-tiny25.sh b/bin/flash-tiny25.sh new file mode 100755 index 0000000..9975671 --- /dev/null +++ b/bin/flash-tiny25.sh @@ -0,0 +1,3 @@ +#/bin/sh +FIRMWARE=$1 +avrdude -c usbasp -p t25 -u -Uflash:w:$FIRMWARE diff --git a/bin/flash-tiny85-fuses.sh b/bin/flash-tiny85-fuses.sh new file mode 100755 index 0000000..e517b2d --- /dev/null +++ b/bin/flash-tiny85-fuses.sh @@ -0,0 +1,8 @@ +#/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) +avrdude -c usbasp -p t85 -u -U lfuse:w:0xe2:m -U hfuse:w:0xdf:m -U efuse:w:0xff:m + +# http://www.engbedded.com/cgi-bin/fcx.cgi?P_PREV=ATtiny85&P=ATtiny85&M_LOW_0x3F=0x22&M_HIGH_0x07=0x07&M_HIGH_0x20=0x00&B_SPIEN=P&B_SUT0=P&B_CKSEL3=P&B_CKSEL2=P&B_CKSEL0=P&V_LOW=E2&V_HIGH=DF&V_EXTENDED=FF&O_HEX=Apply+values diff --git a/bin/flash-tiny85.sh b/bin/flash-tiny85.sh new file mode 100755 index 0000000..0f5a292 --- /dev/null +++ b/bin/flash-tiny85.sh @@ -0,0 +1,3 @@ +#/bin/sh +FIRMWARE=$1 +avrdude -c usbasp -p t85 -u -Uflash:w:$FIRMWARE diff --git a/bin/flash.sh b/bin/flash.sh index 9c2ef82..0423c90 100755 --- a/bin/flash.sh +++ b/bin/flash.sh @@ -1,3 +1,19 @@ -#/bin/sh -FIRMWARE=$1 -avrdude -c usbasp -p t13 -u -Uflash:w:$FIRMWARE -Ulfuse:w:0x75:m -Uhfuse:w:0xFF:m +#!/bin/bash + +# Flashes both fuses and firmware. + +if [ -z "$1" ]; then + echo "Usage: flash.sh MCU myprogram[.hex]" + echo "MCU is a number, like '13' for attiny13 or '841' for attiny841" + echo "The .hex suffix is optional." + exit +fi + +set -e + +BASEDIR=$(dirname "$0") +export ATTINY=$1 ; shift +export PROGRAM=$1 ; shift +if [ ! -f "$PROGRAM" ]; then PROGRAM="$PROGRAM".hex ; fi +$BASEDIR/flash-tiny"$ATTINY"-fuses.sh +$BASEDIR/flash-tiny"$ATTINY".sh "$PROGRAM" diff --git a/hwdef-BLF_GT.h b/hwdef-BLF_GT.h index 1a05741..7dcc8a0 100644 --- a/hwdef-BLF_GT.h +++ b/hwdef-BLF_GT.h @@ -9,29 +9,43 @@ #define PWM_CHANNELS 2 +#ifndef AUXLED_PIN #define AUXLED_PIN PB4 // pin 3 +#endif +#ifndef SWITCH_PIN #define SWITCH_PIN PB3 // pin 2 #define SWITCH_PCINT PCINT3 // pin 2 pin change interrupt +#endif +#ifndef PWM1_PIN #define PWM1_PIN PB0 // pin 5, 1x7135 PWM #define PWM1_LVL OCR0A // OCR0A is the output compare register for PB0 +#endif +#ifndef PWM2_PIN #define PWM2_PIN PB1 // pin 6, FET PWM #define PWM2_LVL OCR0B // OCR0B is the output compare register for PB1 +#endif #define USE_VOLTAGE_DIVIDER // use a voltage divider on pin 7, not VCC +#ifndef VOLTAGE_PIN #define VOLTAGE_PIN PB2 // pin 7, voltage ADC #define VOLTAGE_CHANNEL 0x01 // MUX 01 corresponds with PB2 +#define VOLTAGE_ADC_DIDR ADC1D // Digital input disable bit corresponding with PB2 // 1.1V reference, left-adjust, ADC1/PB2 //#define ADMUX_VOLTAGE_DIVIDER ((1 << V_REF) | (1 << ADLAR) | VOLTAGE_CHANNEL) // 1.1V reference, no left-adjust, ADC1/PB2 #define ADMUX_VOLTAGE_DIVIDER ((1 << V_REF) | VOLTAGE_CHANNEL) -#define VOLTAGE_ADC_DIDR ADC1D // Digital input disable bit corresponding with PB2 +#endif #define ADC_PRSCL 0x06 // clk/64 // Raw ADC readings at 4.4V and 2.2V (in-between, we assume values form a straight line) +#ifndef ADC_44 #define ADC_44 184 +#endif +#ifndef ADC_22 #define ADC_22 92 +#endif #define TEMP_CHANNEL 0b00001111 diff --git a/hwdef-BLF_GT_Mini.h b/hwdef-BLF_GT_Mini.h index 504c561..aacbca4 100644 --- a/hwdef-BLF_GT_Mini.h +++ b/hwdef-BLF_GT_Mini.h @@ -2,3 +2,9 @@ */ // exactly the same as a D1S, but with a lighted button #include "hwdef-Emisar_D1S.h" + +// lighted button +#ifndef AUXLED_PIN +#define AUXLED_PIN PB4 // pin 3 +#endif + diff --git a/hwdef-BLF_Q8.h b/hwdef-BLF_Q8.h index f00c392..6e13faf 100644 --- a/hwdef-BLF_Q8.h +++ b/hwdef-BLF_Q8.h @@ -1,16 +1,17 @@ /* BLF Q8 driver layout + * Q8 driver is the same as a D4, basically */ -// Q8 driver is the same as a D4, basically -#include "hwdef-Emisar_D4.h" // ... except the Q8 has a lighted button #ifndef AUXLED_PIN #define AUXLED_PIN PB4 // pin 3 #endif -// average drop across diode on this hardware -#ifdef VOLTAGE_FUDGE_FACTOR -#undef VOLTAGE_FUDGE_FACTOR -#endif +// ... and slightly different calibration +#ifndef VOLTAGE_FUDGE_FACTOR #define VOLTAGE_FUDGE_FACTOR 7 // add 0.35V +#endif + +// Q8 driver is the same as a D4, basically +#include "hwdef-Emisar_D4.h" diff --git a/hwdef-Emisar_D4.h b/hwdef-Emisar_D4.h index 105d3b9..0dfcab9 100644 --- a/hwdef-Emisar_D4.h +++ b/hwdef-Emisar_D4.h @@ -9,24 +9,32 @@ #define PWM_CHANNELS 2 -#define AUXLED_PIN PB4 // pin 3 +//#define AUXLED_PIN PB4 // pin 3 +#ifndef SWITCH_PIN #define SWITCH_PIN PB3 // pin 2 #define SWITCH_PCINT PCINT3 // pin 2 pin change interrupt +#endif +#ifndef PWM1_PIN #define PWM1_PIN PB0 // pin 5, 1x7135 PWM #define PWM1_LVL OCR0A // OCR0A is the output compare register for PB0 +#endif +#ifndef PWM2_PIN #define PWM2_PIN PB1 // pin 6, FET PWM #define PWM2_LVL OCR0B // OCR0B is the output compare register for PB1 +#endif // (FIXME: remove? not used?) -#define VOLTAGE_PIN PB2 // pin 7, voltage ADC -#define ADC_CHANNEL 0x01 // MUX 01 corresponds with PB2 -#define ADC_DIDR ADC1D // Digital input disable bit corresponding with PB2 +//#define VOLTAGE_PIN PB2 // pin 7, voltage ADC +//#define ADC_CHANNEL 0x01 // MUX 01 corresponds with PB2 +//#define ADC_DIDR ADC1D // Digital input disable bit corresponding with PB2 #define ADC_PRSCL 0x06 // clk/64 // average drop across diode on this hardware +#ifndef VOLTAGE_FUDGE_FACTOR #define VOLTAGE_FUDGE_FACTOR 5 // add 0.25V +#endif //#define TEMP_DIDR ADC4D #define TEMP_CHANNEL 0b00001111 diff --git a/hwdef-FF_PL47.h b/hwdef-FF_PL47.h index 4189220..217ce45 100644 --- a/hwdef-FF_PL47.h +++ b/hwdef-FF_PL47.h @@ -1,24 +1,23 @@ /* Fireflies PL47 driver layout + * same as a D4S, basically, except ... */ -// same as a D4S, basically -#include "hwdef-Emisar_D4S.h" -#undef FSM_EMISAR_D4S_DRIVER -#undef FSM_EMISAR_D4_DRIVER -// ... except the PL47 has aux LEDs on pin 7 -#ifdef AUXLED_PIN -#undef AUXLED_PIN -#endif +// ... the PL47 has aux LEDs on pin 7 +#ifndef AUXLED_PIN #define AUXLED_PIN PB2 // pin 7 +#endif // ... and switch LEDs on pin 3 -#ifdef AUXLED2_PIN -#undef AUXLED2_PIN -#endif +#ifndef AUXLED2_PIN #define AUXLED2_PIN PB4 // pin 3 - -// average drop across diode on this hardware -#ifdef VOLTAGE_FUDGE_FACTOR -#undef VOLTAGE_FUDGE_FACTOR #endif + +// ... and slightly different calibration +#ifndef VOLTAGE_FUDGE_FACTOR #define VOLTAGE_FUDGE_FACTOR 7 // add 0.35V +#endif + +#include "hwdef-Emisar_D4S.h" +#undef FSM_EMISAR_D4S_DRIVER +#undef FSM_EMISAR_D4_DRIVER + diff --git a/hwdef-FF_ROT66.h b/hwdef-FF_ROT66.h index 49947ab..0913a76 100644 --- a/hwdef-FF_ROT66.h +++ b/hwdef-FF_ROT66.h @@ -1,20 +1,21 @@ /* Fireflies ROT66 driver layout + * same as a FW3A, basically, except ... */ -// same as a FW3A, basically -#include "hwdef-FW3A.h" // ... except the ROT66 has a lighted button #ifndef AUXLED_PIN #define AUXLED_PIN PB2 // pin 7 #endif +// ... and slightly different calibration +#ifndef VOLTAGE_FUDGE_FACTOR +#define VOLTAGE_FUDGE_FACTOR 7 // add 0.35V +#endif + +#include "hwdef-FW3A.h" + // ... and no optic nerve #ifdef VISION_PIN #undef VISION_PIN #endif -// average drop across diode on this hardware -#ifdef VOLTAGE_FUDGE_FACTOR -#undef VOLTAGE_FUDGE_FACTOR -#endif -#define VOLTAGE_FUDGE_FACTOR 7 // add 0.35V diff --git a/hwdef-FW3A.h b/hwdef-FW3A.h index 5e253c7..8abab9a 100644 --- a/hwdef-FW3A.h +++ b/hwdef-FW3A.h @@ -9,23 +9,35 @@ #define PWM_CHANNELS 3 +#ifndef SWITCH_PIN #define SWITCH_PIN PB3 // pin 2 #define SWITCH_PCINT PCINT3 // pin 2 pin change interrupt +#endif +#ifndef PWM1_PIN #define PWM1_PIN PB0 // pin 5, 1x7135 PWM #define PWM1_LVL OCR0A // OCR0A is the output compare register for PB0 -#define PWM2_PIN PB1 // pin 6, FET PWM +#endif +#ifndef PWM2_PIN +#define PWM2_PIN PB1 // pin 6, 7x7135 PWM #define PWM2_LVL OCR0B // OCR0B is the output compare register for PB1 -#define PWM3_PIN PB4 // pin 3 -#define PWM3_LVL OCR1B +#endif +#ifndef PWM3_PIN +#define PWM3_PIN PB4 // pin 3, FET PWM +#define PWM3_LVL OCR1B // OCR1B is the output compare register for PB4 +#endif +#ifndef VISION_PIN #define VISION_PIN PB2 // pin 7, optic nerve -#define ADC_CHANNEL 0x01 // MUX 01 corresponds with PB2 -#define ADC_DIDR ADC1D // Digital input disable bit corresponding with PB2 +//#define ADC_CHANNEL 0x01 // MUX 01 corresponds with PB2 +//#define ADC_DIDR ADC1D // Digital input disable bit corresponding with PB2 +#endif #define ADC_PRSCL 0x06 // clk/64 // average drop across diode on this hardware +#ifndef VOLTAGE_FUDGE_FACTOR #define VOLTAGE_FUDGE_FACTOR 5 // add 0.25V +#endif //#define TEMP_DIDR ADC4D #define TEMP_CHANNEL 0b00001111 diff --git a/spaghetti-monster/anduril/Makefile b/spaghetti-monster/anduril/Makefile new file mode 100644 index 0000000..25c56fa --- /dev/null +++ b/spaghetti-monster/anduril/Makefile @@ -0,0 +1,7 @@ +all: + ./build-all.sh + +clean: + rm -f *.hex *~ *.elf *.o + +.phony: clean diff --git a/spaghetti-monster/anduril/anduril.c b/spaghetti-monster/anduril/anduril.c index bd5d3b6..bebef72 100644 --- a/spaghetti-monster/anduril/anduril.c +++ b/spaghetti-monster/anduril/anduril.c @@ -32,6 +32,7 @@ //#define FSM_FF_ROT66_DRIVER //#define FSM_FF_ROT66_219_DRIVER //#define FSM_FW3A_DRIVER +//#define FSM_SOFIRN_SP36_DRIVER #define USE_LVP // FIXME: won't build when this option is turned off @@ -117,6 +118,9 @@ #elif defined(FSM_FW3A_DRIVER) #include "cfg-fw3a.h" +#elif defined(FSM_SOFIRN_SP36_DRIVER) +#include "cfg-sofirn-sp36.h" + #endif @@ -139,16 +143,29 @@ /********* Configure SpaghettiMonster *********/ #define USE_DELAY_ZERO #define USE_RAMPING +#ifndef RAMP_LENGTH #define RAMP_LENGTH 150 // default, if not overridden in a driver cfg file +#endif #define MAX_BIKING_LEVEL 120 // should be 127 or less #define USE_BATTCHECK -#ifdef USE_MUGGLE_MODE + +// determine the highest number of clicks to handle +#ifdef USE_INDICATOR_LED +#define MAX_CLICKS 7 +#elif defined(USE_MUGGLE_MODE) #define MAX_CLICKS 6 -#define MUGGLE_FLOOR 22 -#define MUGGLE_CEILING (MAX_1x7135+20) #else #define MAX_CLICKS 5 #endif + +#if defined(USE_MUGGLE_MODE) +#ifndef MUGGLE_FLOOR +#define MUGGLE_FLOOR 22 +#endif +#ifndef MUGGLE_CEILING +#define MUGGLE_CEILING (MAX_1x7135+20) +#endif +#endif #define USE_IDLE_MODE // reduce power use while awake and no tasks are pending #define USE_DYNAMIC_UNDERCLOCKING // cut clock speed at very low modes for better efficiency @@ -498,6 +515,24 @@ uint8_t off_state(EventPtr event, uint16_t arg) { return MISCHIEF_MANAGED; } #endif + #ifdef USE_INDICATOR_LED + // 7 clicks: change indicator LED mode + else if (event == EV_7clicks) { + uint8_t mode = (indicator_led_mode & 3) + 1; + #ifdef TICK_DURING_STANDBY + mode = mode & 3; + #else + mode = mode % 3; + #endif + #ifdef INDICATOR_LED_SKIP_LOW + if (mode == 1) { mode ++; } + #endif + indicator_led_mode = (indicator_led_mode & 0b11111100) | mode; + indicator_led(mode); + save_config(); + return MISCHIEF_MANAGED; + } + #endif return EVENT_NOT_HANDLED; } @@ -1241,6 +1276,7 @@ uint8_t lockout_state(EventPtr event, uint16_t arg) { save_config(); return MISCHIEF_MANAGED; } + #if 0 // old method, deprecated in favor of "7 clicks from off" // click, click, hold: rotate through indicator LED modes (off mode) else if (event == EV_click3_hold) { #ifndef USE_INDICATOR_LED_WHILE_RAMPING @@ -1273,6 +1309,7 @@ uint8_t lockout_state(EventPtr event, uint16_t arg) { return MISCHIEF_MANAGED; } #endif + #endif // 4 clicks: exit else if (event == EV_4clicks) { blink_confirm(1); diff --git a/spaghetti-monster/anduril/anduril.txt b/spaghetti-monster/anduril/anduril.txt index 9cbef68..f0f0b4d 100644 --- a/spaghetti-monster/anduril/anduril.txt +++ b/spaghetti-monster/anduril/anduril.txt @@ -17,6 +17,9 @@ From off: * 4 clicks: lock-out * 5 clicks: momentary mode (disconnect power to exit) * 6 clicks: muggle mode + * On hardware with an indicator LED... + * 7 clicks: Change aux LED mode used in "off" mode. + (the modes are usually off/low/high/blinking) In steady mode: * 1 click: off @@ -111,8 +114,8 @@ Lockout mode: * Hold: momentary moon * 4 clicks: exit lockout (return to regular "off" mode) * On hardware with an indicator LED... - * 3 clicks: Change button brightness used in lockout mode. (low/high/off) - * Click, click, hold: Change button brightness used in "off" mode. + * 3 clicks: Change aux LED brightness used in lockout mode. + (the modes are usually off/low/high/blinking) Momentary mode: * Press button: Light on (at memorized level). diff --git a/spaghetti-monster/anduril/build-all.sh b/spaghetti-monster/anduril/build-all.sh index 06e7761..b50744f 100755 --- a/spaghetti-monster/anduril/build-all.sh +++ b/spaghetti-monster/anduril/build-all.sh @@ -17,8 +17,9 @@ for TARGET in \ FF_ROT66 \ FF_ROT66_219 \ FW3A \ + SOFIRN_SP36 \ ; do echo "===== $TARGET =====" - ../../../bin/build-85.sh "$UI" "-DFSM_${TARGET}_DRIVER" + ../../../bin/build.sh 85 "$UI" "-DFSM_${TARGET}_DRIVER" mv -f "$UI".hex "$UI".$TARGET.hex done diff --git a/spaghetti-monster/anduril/cfg-blf-gt.h b/spaghetti-monster/anduril/cfg-blf-gt.h index 369d028..a29d7e7 100644 --- a/spaghetti-monster/anduril/cfg-blf-gt.h +++ b/spaghetti-monster/anduril/cfg-blf-gt.h @@ -14,10 +14,6 @@ //#undef USE_SET_LEVEL_GRADUALLY -#ifdef RAMP_LENGTH -#undef RAMP_LENGTH -#endif - #define RAMP_LENGTH 150 // First 60 values: level_calc.py 1 60 7135 4 5.0 255 // Remainder: all 255 (buck driver at 100% duty cycle) diff --git a/spaghetti-monster/anduril/cfg-blf-q8.h b/spaghetti-monster/anduril/cfg-blf-q8.h index 269aae9..1b9b971 100644 --- a/spaghetti-monster/anduril/cfg-blf-q8.h +++ b/spaghetti-monster/anduril/cfg-blf-q8.h @@ -7,10 +7,6 @@ // enable blinking indicator LED while off #define TICK_DURING_STANDBY -#ifdef RAMP_LENGTH -#undef RAMP_LENGTH -#endif - // copied from Emisar D4 ramp // ../../bin/level_calc.py 1 65 7135 1 0.8 150 // ... mixed with this: diff --git a/spaghetti-monster/anduril/cfg-emisar-d4.h b/spaghetti-monster/anduril/cfg-emisar-d4.h index 251f81d..e83c62d 100644 --- a/spaghetti-monster/anduril/cfg-emisar-d4.h +++ b/spaghetti-monster/anduril/cfg-emisar-d4.h @@ -1,8 +1,5 @@ // Emisar D4 config options for Anduril -#ifdef RAMP_LENGTH -#undef RAMP_LENGTH -#endif // ../../bin/level_calc.py 1 65 7135 1 0.8 150 // ... mixed with this: // ../../bin/level_calc.py 2 150 7135 4 0.33 150 FET 1 10 1500 diff --git a/spaghetti-monster/anduril/cfg-ff-pl47.h b/spaghetti-monster/anduril/cfg-ff-pl47.h index d916e06..2e5647d 100644 --- a/spaghetti-monster/anduril/cfg-ff-pl47.h +++ b/spaghetti-monster/anduril/cfg-ff-pl47.h @@ -17,7 +17,8 @@ // the "low" mode doesn't work on this light's aux LEDs // (but it does work on the switch LEDs) -//#define INDICATOR_LED_SKIP_LOW +// Fireflies wants to skip aux LED mode 1 (low) +#define INDICATOR_LED_SKIP_LOW // ... or if TICK_DURING_STANDBY is turned off: // off mode: high (2) @@ -25,9 +26,6 @@ //#define INDICATOR_LED_DEFAULT_MODE ((0<<2) + 2) -#ifdef RAMP_LENGTH -#undef RAMP_LENGTH -#endif #define RAMP_LENGTH 150 // driver is a FET + 3x7135, ~400 lm at highest regulated level @@ -38,15 +36,27 @@ #define HALFSPEED_LEVEL 13 #define QUARTERSPEED_LEVEL 6 -// ceiling is level 120/150 -#define RAMP_SMOOTH_CEIL (MAX_LEVEL*4/5) - // thermal regulation parameters #ifdef MIN_THERM_STEPDOWN #undef MIN_THERM_STEPDOWN // this should be lower, because 3x7135 instead of 1x7135 #endif #define MIN_THERM_STEPDOWN 60 // lowest value it'll step down to +// ceiling is level 120/150 +#define RAMP_SMOOTH_CEIL 120 + +// 10, 28, 46, 65, 83, 101, 120 (83 is highest regulated) +#define RAMP_DISCRETE_FLOOR 10 +#define RAMP_DISCRETE_CEIL 120 +#define RAMP_DISCRETE_STEPS 7 + +// ~25 lm to ~300 lm +#define MUGGLE_FLOOR 30 +#define MUGGLE_CEILING MAX_1x7135 +// ~50 lm to ~500 lm +//#define MUGGLE_FLOOR 40 +//#define MUGGLE_CEILING 90 + // regulate down faster when the FET is active, slower otherwise #define THERM_FASTER_LEVEL 130 // throttle back faster when high diff --git a/spaghetti-monster/anduril/cfg-ff-rot66.h b/spaghetti-monster/anduril/cfg-ff-rot66.h index c8e0d52..165b2ba 100644 --- a/spaghetti-monster/anduril/cfg-ff-rot66.h +++ b/spaghetti-monster/anduril/cfg-ff-rot66.h @@ -18,10 +18,6 @@ #define INDICATOR_LED_DEFAULT_MODE ((0<<2) + 2) -#ifdef RAMP_LENGTH -#undef RAMP_LENGTH -#endif - // driver is a FET+N+1, // where N=6 for the 219b version, // or N=13 for the XP-L HI version (this version) diff --git a/spaghetti-monster/anduril/cfg-fw3a.h b/spaghetti-monster/anduril/cfg-fw3a.h index 65f1e48..efa70ae 100644 --- a/spaghetti-monster/anduril/cfg-fw3a.h +++ b/spaghetti-monster/anduril/cfg-fw3a.h @@ -1,9 +1,5 @@ // FW3A config options for Anduril -#ifdef RAMP_LENGTH -#undef RAMP_LENGTH -#endif - // ../../bin/level_calc.py 1 65 7135 1 0.8 150 // ... mixed with this: // ../../../bin/level_calc.py 3 150 7135 1 0.33 150 7135 1 1 850 FET 1 10 1500 diff --git a/spaghetti-monster/anduril/cfg-sofirn-sp36.h b/spaghetti-monster/anduril/cfg-sofirn-sp36.h new file mode 100644 index 0000000..11e3735 --- /dev/null +++ b/spaghetti-monster/anduril/cfg-sofirn-sp36.h @@ -0,0 +1,16 @@ +// Sofirn SP36 (small Q8) config options for Anduril + +#define FSM_BLF_Q8_DRIVER +#include "cfg-blf-q8.h" + +// stop panicking at ~50% power or ~2000 lm +#ifdef THERM_FASTER_LEVEL +#undef THERM_FASTER_LEVEL +#endif +#define THERM_FASTER_LEVEL 125 + +// be extra-careful at high levels +#ifndef THERM_HARD_TURBO_DROP +#define THERM_HARD_TURBO_DROP +#endif + diff --git a/spaghetti-monster/baton/baton-simpler.c b/spaghetti-monster/baton/baton-simpler.c deleted file mode 100644 index 96b0ea7..0000000 --- a/spaghetti-monster/baton/baton-simpler.c +++ /dev/null @@ -1,194 +0,0 @@ -/* - * Baton: Olight Baton-like UI for SpaghettiMonster. - * - * Copyright (C) 2017 Selene ToyKeeper - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - */ - -#define FSM_EMISAR_D4_DRIVER -#define USE_LVP -#define USE_THERMAL_REGULATION -#define DEFAULT_THERM_CEIL 45 -#define USE_DELAY_MS -#include "spaghetti-monster.h" - -// FSM states -uint8_t off_state(EventPtr event, uint16_t arg); -uint8_t steady_state(EventPtr event, uint16_t arg); -uint8_t lockout_state(EventPtr event, uint16_t arg); - -// brightness control -uint8_t memorized_level = 1; -uint8_t actual_level = 0; -#ifdef USE_THERMAL_REGULATION -uint8_t target_level = 0; -#endif - -// moon + ../../bin/level_calc.py 2 6 7135 18 10 150 FET 1 10 1500 -uint8_t pwm1_levels[] = { 3, 18, 110, 255, 255, 255, 0, }; -uint8_t pwm2_levels[] = { 0, 0, 0, 9, 58, 138, 255, }; -#define MAX_LEVEL (sizeof(pwm1_levels)-1) - -// set LED brightness -void set_level(uint8_t lvl) { - actual_level = lvl; - PWM1_LVL = pwm1_levels[lvl]; - PWM2_LVL = pwm2_levels[lvl]; -} - -uint8_t off_state(EventPtr event, uint16_t arg) { - // turn emitter off when entering state - if (event == EV_enter_state) { - go_to_standby = 1; // sleep while off (lower power use) - return EVENT_HANDLED; - } - // hold (initially): go to lowest level, but allow abort for regular click - else if (event == EV_click1_press) { - set_level(0); - return EVENT_HANDLED; - } - // 1 click (before timeout): go to memorized level, but allow abort for double click - else if (event == EV_click1_release) { - set_level(memorized_level); - return EVENT_HANDLED; - } - // 1 click: regular mode - else if (event == EV_1click) { - set_state(steady_state, memorized_level); - return EVENT_HANDLED; - } - // 2 clicks: highest mode - else if (event == EV_2clicks) { - set_state(steady_state, MAX_LEVEL); - return EVENT_HANDLED; - } - // 4 clicks: soft lockout - else if (event == EV_4clicks) { - set_state(lockout_state, 0); - return EVENT_HANDLED; - } - // hold: go to lowest level - else if (event == EV_click1_hold) { - set_state(steady_state, 0); - return EVENT_HANDLED; - } - return EVENT_NOT_HANDLED; -} - -uint8_t steady_state(EventPtr event, uint16_t arg) { - // turn LED on when we first enter the mode - if (event == EV_enter_state) { - // remember this level, unless it's moon or turbo - if ((arg > 0) && (arg < MAX_LEVEL)) - memorized_level = arg; - #ifdef USE_THERMAL_REGULATION - target_level = arg; - #endif - set_level(arg); - return EVENT_HANDLED; - } - // 1 click: off - else if (event == EV_1click) { - set_state(off_state, 0); - return EVENT_HANDLED; - } - // 2 clicks: go to/from highest level - else if (event == EV_2clicks) { - if (actual_level < MAX_LEVEL) { // go to turbo - memorized_level = actual_level; // in case we're on moon - #ifdef USE_THERMAL_REGULATION - target_level = MAX_LEVEL; - #endif - set_level(MAX_LEVEL); - } - else { // return from turbo - #ifdef USE_THERMAL_REGULATION - target_level = memorized_level; - #endif - set_level(memorized_level); - } - return EVENT_HANDLED; - } - // hold: change brightness - else if (event == EV_click1_hold) { - if ((arg % HOLD_TIMEOUT) == 0) { - memorized_level = (actual_level+1) % (MAX_LEVEL+1); - #ifdef USE_THERMAL_REGULATION - target_level = memorized_level; - #endif - set_level(memorized_level); - } - return EVENT_HANDLED; - } - #ifdef USE_THERMAL_REGULATION - // overheating: drop by 1 level - else if (event == EV_temperature_high) { - if (actual_level > 1) { - set_level(actual_level - 1); - } - return EVENT_HANDLED; - } - // underheating: increase by 1 level if we're lower than the target - else if (event == EV_temperature_low) { - if (actual_level < target_level) { - set_level(actual_level + 1); - } - return EVENT_HANDLED; - } - #endif - return EVENT_NOT_HANDLED; -} - -uint8_t lockout_state(EventPtr event, uint16_t arg) { - // stay asleep while locked, but allow waking long enough to click 4 times - if (event == EV_tick) { - static uint8_t ticks_spent_awake = 0; - ticks_spent_awake ++; - PWM1_LVL = 0; PWM2_LVL = 0; - if (ticks_spent_awake > 3 * TICKS_PER_SECOND) { - ticks_spent_awake = 0; - go_to_standby = 1; - } - return MISCHIEF_MANAGED; - } - // 4 clicks: exit - else if (event == EV_4clicks) { - set_state(steady_state, 1); - return MISCHIEF_MANAGED; - } - return EVENT_NOT_HANDLED; -} - -void low_voltage() { - // step down by one level or turn off - if (actual_level > 0) { - set_level(actual_level - 1); - } - else { - set_state(off_state, 0); - } -} - -void setup() { - // blink when power is connected - set_level(MAX_LEVEL/2); - delay_ms(10); - set_level(0); - - push_state(off_state, 0); -} - -void loop() { -} diff --git a/spaghetti-monster/baton/baton.c b/spaghetti-monster/baton/baton.c index 1266ddd..d4725ef 100644 --- a/spaghetti-monster/baton/baton.c +++ b/spaghetti-monster/baton/baton.c @@ -20,22 +20,13 @@ #define FSM_EMISAR_D4_DRIVER #define USE_LVP #define USE_THERMAL_REGULATION -#define DEFAULT_THERM_CEIL 45 -#define USE_DEBUG_BLINK #define USE_DELAY_MS -#define USE_DELAY_4MS -#define USE_DELAY_ZERO #include "spaghetti-monster.h" -// moon + ../../bin/level_calc.py 2 6 7135 18 10 150 FET 1 10 1500 -uint8_t pwm1_modes[] = { 3, 18, 110, 255, 255, 255, 0, }; -uint8_t pwm2_modes[] = { 0, 0, 0, 9, 58, 138, 255, }; -#define MAX_LEVEL (sizeof(pwm1_modes)-1) - // FSM states uint8_t off_state(EventPtr event, uint16_t arg); uint8_t steady_state(EventPtr event, uint16_t arg); -uint8_t party_strobe_state(EventPtr event, uint16_t arg); +uint8_t lockout_state(EventPtr event, uint16_t arg); // brightness control uint8_t memorized_level = 1; @@ -44,93 +35,90 @@ uint8_t actual_level = 0; uint8_t target_level = 0; #endif +// moon + ../../bin/level_calc.py 2 6 7135 18 10 150 FET 1 10 1500 +uint8_t pwm1_levels[] = { 3, 18, 110, 255, 255, 255, 0, }; +uint8_t pwm2_levels[] = { 0, 0, 0, 9, 58, 138, 255, }; +#define MAX_LEVEL (sizeof(pwm1_levels)-1) + +// set LED brightness void set_level(uint8_t lvl) { actual_level = lvl; - PWM1_LVL = pwm1_modes[lvl]; - PWM2_LVL = pwm2_modes[lvl]; + PWM1_LVL = pwm1_levels[lvl]; + PWM2_LVL = pwm2_levels[lvl]; } uint8_t off_state(EventPtr event, uint16_t arg) { // turn emitter off when entering state if (event == EV_enter_state) { - PWM1_LVL = 0; - PWM2_LVL = 0; - // sleep while off (lower power use) - go_to_standby = 1; - return 0; + go_to_standby = 1; // sleep while off (lower power use) + return EVENT_HANDLED; } // hold (initially): go to lowest level, but allow abort for regular click else if (event == EV_click1_press) { set_level(0); - return 0; + return EVENT_HANDLED; + } + // hold (longer): go to lowest level + else if (event == EV_click1_hold) { + set_state(steady_state, 0); + return EVENT_HANDLED; } // 1 click (before timeout): go to memorized level, but allow abort for double click else if (event == EV_click1_release) { set_level(memorized_level); - return 0; + return EVENT_HANDLED; } // 1 click: regular mode else if (event == EV_1click) { set_state(steady_state, memorized_level); - return 0; + return EVENT_HANDLED; } // 2 clicks: highest mode else if (event == EV_2clicks) { set_state(steady_state, MAX_LEVEL); - return 0; + return EVENT_HANDLED; } - // 3 clicks: strobe mode - else if (event == EV_3clicks) { - set_state(party_strobe_state, 255); - return 0; + // 4 clicks: soft lockout + else if (event == EV_4clicks) { + set_state(lockout_state, 0); + return EVENT_HANDLED; } - // hold: go to lowest level - else if (event == EV_click1_hold) { - set_state(steady_state, 0); - return 0; - } - return 1; + return EVENT_NOT_HANDLED; } uint8_t steady_state(EventPtr event, uint16_t arg) { // turn LED on when we first enter the mode if (event == EV_enter_state) { // remember this level, unless it's moon or turbo - if ((arg > 0) && (arg < MAX_LEVEL)) - memorized_level = arg; + if ((arg > 0) && (arg < MAX_LEVEL)) memorized_level = arg; // use the requested level even if not memorized #ifdef USE_THERMAL_REGULATION target_level = arg; #endif set_level(arg); - return 0; + return EVENT_HANDLED; } // 1 click: off else if (event == EV_1click) { set_state(off_state, 0); - return 0; + return EVENT_HANDLED; } // 2 clicks: go to/from highest level else if (event == EV_2clicks) { - if (actual_level < MAX_LEVEL) { + if (actual_level < MAX_LEVEL) { // go to turbo memorized_level = actual_level; // in case we're on moon #ifdef USE_THERMAL_REGULATION target_level = MAX_LEVEL; #endif set_level(MAX_LEVEL); } - else { + else { // return from turbo #ifdef USE_THERMAL_REGULATION target_level = memorized_level; #endif set_level(memorized_level); } - return 0; - } - // 3 clicks: go to strobe modes - else if (event == EV_3clicks) { - set_state(party_strobe_state, 0xff); - return 0; + return EVENT_HANDLED; } // hold: change brightness else if (event == EV_click1_hold) { @@ -141,90 +129,60 @@ uint8_t steady_state(EventPtr event, uint16_t arg) { #endif set_level(memorized_level); } - return 0; + return EVENT_HANDLED; } #ifdef USE_THERMAL_REGULATION // overheating: drop by 1 level else if (event == EV_temperature_high) { - if (actual_level > 1) { - set_level(actual_level - 1); - } - return 0; + if (actual_level > 1) { set_level(actual_level - 1); } + return EVENT_HANDLED; } // underheating: increase by 1 level if we're lower than the target else if (event == EV_temperature_low) { - if (actual_level < target_level) { - set_level(actual_level + 1); - } - return 0; + if (actual_level < target_level) { set_level(actual_level + 1); } + return EVENT_HANDLED; } #endif - return 1; + return EVENT_NOT_HANDLED; } -uint8_t party_strobe_state(EventPtr event, uint16_t arg) { - static volatile uint8_t frames = 0; - static volatile uint8_t between = 2; - if (event == EV_enter_state) { - if (arg < 64) between = arg; - frames = 0; - return 0; - } - // tick: strobe the emitter - else if (event == EV_tick) { - if (frames == 0) { - PWM1_LVL = 0; - PWM2_LVL = 255; - if (between < 3) delay_zero(); - else delay_ms(1); - PWM2_LVL = 0; - } - //frames = (frames + 1) % between; - frames++; - if (frames > between) frames = 0; - return 0; - } - // 1 click: off - else if (event == EV_1click) { - set_state(off_state, 0); - return 0; - } - // 2 clicks: go back to regular modes - else if (event == EV_2clicks) { - set_state(steady_state, memorized_level); - return 0; - } - // hold: change speed - else if (event == EV_click1_hold) { - if ((arg % HOLD_TIMEOUT) == 0) { - between = (between+1)%6; - frames = 0; - } - return 0; +uint8_t lockout_state(EventPtr event, uint16_t arg) { + // stay asleep while locked + if (event == EV_tick) { + PWM1_LVL = 0; PWM2_LVL = 0; // make sure emitters are off + // sleep 1 second after user stops pressing buttons + if (arg > TICKS_PER_SECOND) { go_to_standby = 1; } + return MISCHIEF_MANAGED; + } + // 4 clicks: exit, and turn on at "low" level + else if (event == EV_4clicks) { + set_state(steady_state, 1); + return MISCHIEF_MANAGED; } - return 1; + return EVENT_NOT_HANDLED; } void low_voltage() { - // "step down" from strobe to level 2 - if (current_state == party_strobe_state) { - set_state(steady_state, 1); + // step down by one level or turn off + if (actual_level > 0) { + set_level(actual_level - 1); + #ifdef USE_THERMAL_REGULATION + target_level = actual_level; // don't let low temperature override LVP + #endif } - // in normal mode, step down by one level or turn off - else if (current_state == steady_state) { - if (actual_level > 0) { - set_level(actual_level - 1); - } - else { - set_state(off_state, 0); - } + else { + set_state(off_state, 0); } } void setup() { - debug_blink(2); + // blink when power is connected + set_level(MAX_LEVEL/2); + delay_ms(10); + set_level(0); push_state(off_state, 0); } -void loop() { } +void loop() { +} diff --git a/spaghetti-monster/baton/baton.txt b/spaghetti-monster/baton/baton.txt new file mode 100644 index 0000000..2f0c22f --- /dev/null +++ b/spaghetti-monster/baton/baton.txt @@ -0,0 +1,21 @@ +This is a very simple clone of the Olight Baton interface. It is not +exact, but it has the basics. Mostly, it exists for the purposes of +demonstrating how to create interfaces in FSM. + +While off: + + - 1 click: Turn on (at memorized level). + - Hold: Turn on (at moon level). + - 2 clicks: Turn on (at highest level). + - 4 clicks: Soft lockout mode. + +While on: + + - 1 click: Turn off. + - Hold: Change the brightness. Goes up in steps, then wraps around. + - 2 clicks: Go to/from highest level. + +While locked: + + - 4 clicks: Exit lockout mode. + diff --git a/spaghetti-monster/rampingios/Makefile b/spaghetti-monster/rampingios/Makefile new file mode 100644 index 0000000..8db198e --- /dev/null +++ b/spaghetti-monster/rampingios/Makefile @@ -0,0 +1,7 @@ +all: + ./build-all.sh + +clean: + rm -f *.hex cfg-*.h *~ *.elf *.o + +.phony: clean diff --git a/spaghetti-monster/rampingios/build-all.sh b/spaghetti-monster/rampingios/build-all.sh index 22597b7..5b75fe4 100755 --- a/spaghetti-monster/rampingios/build-all.sh +++ b/spaghetti-monster/rampingios/build-all.sh @@ -13,6 +13,6 @@ for TARGET in \ EMISAR_D4S_219C \ ; do echo "===== $TARGET =====" - ../../../bin/build-85.sh "$UI" "-DFSM_${TARGET}_DRIVER" + ../../../bin/build.sh 85 "$UI" "-DFSM_${TARGET}_DRIVER" mv -f "$UI".hex "$UI".$TARGET.hex done |
