diff options
Diffstat (limited to 'spaghetti-monster')
27 files changed, 54 insertions, 185 deletions
diff --git a/spaghetti-monster/anduril/anduril.c b/spaghetti-monster/anduril/anduril.c index 3987d92..c99ea82 100644 --- a/spaghetti-monster/anduril/anduril.c +++ b/spaghetti-monster/anduril/anduril.c @@ -19,20 +19,8 @@ */ /********* User-configurable options *********/ -// Physical driver type (uncomment one of the following or define it at the gcc command line) -//#define FSM_BLF_GT_DRIVER -//#define FSM_BLF_GT_MINI_DRIVER -//#define FSM_BLF_Q8_DRIVER -//#define FSM_EMISAR_D1_DRIVER -//#define FSM_EMISAR_D1S_DRIVER -//#define FSM_EMISAR_D4_DRIVER -//#define FSM_EMISAR_D4_219C_DRIVER -//#define FSM_EMISAR_D4S_DRIVER -//#define FSM_EMISAR_D4S_219C_DRIVER -//#define FSM_FF_ROT66_DRIVER -//#define FSM_FF_ROT66_219_DRIVER -//#define FSM_FW3A_DRIVER -//#define FSM_SOFIRN_SP36_DRIVER +// Anduril config file name (set it here or define it at the gcc command line) +//#define CONFIGFILE cfg-blf-q8.h #define USE_LVP // FIXME: won't build when this option is turned off @@ -76,55 +64,8 @@ //#define START_AT_MEMORIZED_LEVEL /***** specific settings for known driver types *****/ -#if defined(FSM_BLF_GT_DRIVER) -#include "cfg-blf-gt.h" - -#elif defined(FSM_BLF_GT_MINI_DRIVER) -#include "cfg-blf-gt-mini.h" - -#elif defined(FSM_BLF_LANTERN_DRIVER) -#include "cfg-blf-lantern.h" - -#elif defined(FSM_BLF_Q8_DRIVER) -#include "cfg-blf-q8.h" - -#elif defined(FSM_EMISAR_D1_DRIVER) -#include "cfg-emisar-d1.h" - -#elif defined(FSM_EMISAR_D1S_DRIVER) -#include "cfg-emisar-d1s.h" - -#elif defined(FSM_EMISAR_D4_219C_DRIVER) -#include "cfg-emisar-d4-219c.h" - -#elif defined(FSM_EMISAR_D4_DRIVER) -#include "cfg-emisar-d4.h" - -#elif defined(FSM_EMISAR_D4S_219C_DRIVER) -#include "cfg-emisar-d4s-219c.h" - -#elif defined(FSM_EMISAR_D4S_DRIVER) -#include "cfg-emisar-d4s.h" - -#elif defined(FSM_FF_PL47_DRIVER) -#include "cfg-ff-pl47.h" - -#elif defined(FSM_FF_PL47_219_DRIVER) -#include "cfg-ff-pl47-219.h" - -#elif defined(FSM_FF_ROT66_DRIVER) -#include "cfg-ff-rot66.h" - -#elif defined(FSM_FF_ROT66_219_DRIVER) -#include "cfg-ff-rot66-219.h" - -#elif defined(FSM_FW3A_DRIVER) -#include "cfg-fw3a.h" - -#elif defined(FSM_SOFIRN_SP36_DRIVER) -#include "cfg-sofirn-sp36.h" - -#endif +#include "tk.h" +#include incfile(CONFIGFILE) // thermal properties, if not defined per-driver diff --git a/spaghetti-monster/anduril/build-all.sh b/spaghetti-monster/anduril/build-all.sh index ea79347..c355f1e 100755 --- a/spaghetti-monster/anduril/build-all.sh +++ b/spaghetti-monster/anduril/build-all.sh @@ -2,26 +2,10 @@ UI=anduril -for TARGET in \ - BLF_GT \ - BLF_GT_MINI \ - BLF_LANTERN \ - BLF_Q8 \ - EMISAR_D1 \ - EMISAR_D1S \ - EMISAR_D4 \ - EMISAR_D4_219C \ - EMISAR_D4S \ - EMISAR_D4S_219C \ - FF_PL47 \ - FF_PL47_219 \ - FF_ROT66 \ - FF_ROT66_219 \ - FW3A \ - SOFIRN_SP36 \ - ; do - echo "===== $TARGET =====" - echo ../../../bin/build.sh 85 "$UI" "-DFSM_${TARGET}_DRIVER" - ../../../bin/build.sh 85 "$UI" "-DFSM_${TARGET}_DRIVER" - mv -f "$UI".hex "$UI".$TARGET.hex +for TARGET in cfg-*.h ; do + NAME=$(echo "$TARGET" | perl -ne '/cfg-(.*).h/ && print "$1\n";') + echo "===== $NAME =====" + echo ../../../bin/build.sh 85 "$UI" "-DCONFIGFILE=${TARGET}" + ../../../bin/build.sh 85 "$UI" "-DCONFIGFILE=${TARGET}" + mv -f "$UI".hex "$UI".$NAME.hex done diff --git a/spaghetti-monster/anduril/cfg-blf-gt-mini.h b/spaghetti-monster/anduril/cfg-blf-gt-mini.h index 885024a..3728f98 100644 --- a/spaghetti-monster/anduril/cfg-blf-gt-mini.h +++ b/spaghetti-monster/anduril/cfg-blf-gt-mini.h @@ -1,4 +1,5 @@ // BLF/Lumintop GT Mini config options for Anduril +#include "hwdef-BLF_GT_Mini.h" // Same as an Emisar D1S, except it has a lighted button #include "cfg-emisar-d1s.h" diff --git a/spaghetti-monster/anduril/cfg-blf-gt.h b/spaghetti-monster/anduril/cfg-blf-gt.h index a29d7e7..b8f4d6d 100644 --- a/spaghetti-monster/anduril/cfg-blf-gt.h +++ b/spaghetti-monster/anduril/cfg-blf-gt.h @@ -1,4 +1,5 @@ // BLF GT config options for Anduril +#include "hwdef-BLF_GT.h" // the button lights up #define USE_INDICATOR_LED diff --git a/spaghetti-monster/anduril/cfg-blf-lantern.h b/spaghetti-monster/anduril/cfg-blf-lantern.h index 26e5b5a..de593d4 100644 --- a/spaghetti-monster/anduril/cfg-blf-lantern.h +++ b/spaghetti-monster/anduril/cfg-blf-lantern.h @@ -9,7 +9,7 @@ */ // basically the same as a Q8... sort of -#define FSM_BLF_Q8_DRIVER +#include "hwdef-BLF_Q8.h" // the button lights up #define USE_INDICATOR_LED diff --git a/spaghetti-monster/anduril/cfg-blf-q8.h b/spaghetti-monster/anduril/cfg-blf-q8.h index 90099c3..970fedb 100644 --- a/spaghetti-monster/anduril/cfg-blf-q8.h +++ b/spaghetti-monster/anduril/cfg-blf-q8.h @@ -1,4 +1,5 @@ // BLF Q8 config options for Anduril +#include "hwdef-BLF_Q8.h" // the button lights up #define USE_INDICATOR_LED diff --git a/spaghetti-monster/anduril/cfg-emisar-d1.h b/spaghetti-monster/anduril/cfg-emisar-d1.h index d35480c..35e91db 100644 --- a/spaghetti-monster/anduril/cfg-emisar-d1.h +++ b/spaghetti-monster/anduril/cfg-emisar-d1.h @@ -1,4 +1,6 @@ // Emisar D1 config options for Anduril +#include "hwdef-Emisar_D1.h" +// same as Emisar D4, mostly #include "cfg-emisar-d4.h" // stop panicking at ~75% power or ~1000 lm (D1 has a decent power-to-thermal-mass ratio) diff --git a/spaghetti-monster/anduril/cfg-emisar-d1s.h b/spaghetti-monster/anduril/cfg-emisar-d1s.h index eb98c2e..56200a2 100644 --- a/spaghetti-monster/anduril/cfg-emisar-d1s.h +++ b/spaghetti-monster/anduril/cfg-emisar-d1s.h @@ -1,4 +1,6 @@ // Emisar D1S config options for Anduril +#include "hwdef-Emisar_D1S.h" +// same as Emisar D4, mostly #include "cfg-emisar-d4.h" // stop panicking at ~90% power or ~1200 lm (D1S has a good power-to-thermal-mass ratio) diff --git a/spaghetti-monster/anduril/cfg-emisar-d4-219c.h b/spaghetti-monster/anduril/cfg-emisar-d4-219c.h index 55ae1eb..cf245a2 100644 --- a/spaghetti-monster/anduril/cfg-emisar-d4-219c.h +++ b/spaghetti-monster/anduril/cfg-emisar-d4-219c.h @@ -1,7 +1,6 @@ // Emisar D4-219C config options for Anduril // same as D4S but with FET modes limited to 80% power // to avoid destroying the LEDs -#define FSM_EMISAR_D4_DRIVER #include "cfg-emisar-d4.h" #undef PWM2_LEVELS diff --git a/spaghetti-monster/anduril/cfg-emisar-d4.h b/spaghetti-monster/anduril/cfg-emisar-d4.h index e83c62d..2f4df49 100644 --- a/spaghetti-monster/anduril/cfg-emisar-d4.h +++ b/spaghetti-monster/anduril/cfg-emisar-d4.h @@ -1,4 +1,5 @@ // Emisar D4 config options for Anduril +#include "hwdef-Emisar_D4.h" // ../../bin/level_calc.py 1 65 7135 1 0.8 150 // ... mixed with this: diff --git a/spaghetti-monster/anduril/cfg-emisar-d4s-219c.h b/spaghetti-monster/anduril/cfg-emisar-d4s-219c.h index c02274d..0c68bc4 100644 --- a/spaghetti-monster/anduril/cfg-emisar-d4s-219c.h +++ b/spaghetti-monster/anduril/cfg-emisar-d4s-219c.h @@ -1,7 +1,6 @@ // Emisar D4S-219C config options for Anduril // same as D4S but with FET modes limited to 80% power // to avoid destroying the LEDs -#define FSM_EMISAR_D4S_DRIVER #include "cfg-emisar-d4s.h" #undef PWM2_LEVELS diff --git a/spaghetti-monster/anduril/cfg-emisar-d4s.h b/spaghetti-monster/anduril/cfg-emisar-d4s.h index 1070ee7..e26634a 100644 --- a/spaghetti-monster/anduril/cfg-emisar-d4s.h +++ b/spaghetti-monster/anduril/cfg-emisar-d4s.h @@ -1,4 +1,5 @@ // Emisar D4S config options for Anduril +#include "hwdef-Emisar_D4S.h" // the button lights up #define USE_INDICATOR_LED diff --git a/spaghetti-monster/anduril/cfg-ff-pl47-219.h b/spaghetti-monster/anduril/cfg-ff-pl47-219.h index ea701bd..3ded2aa 100644 --- a/spaghetti-monster/anduril/cfg-ff-pl47-219.h +++ b/spaghetti-monster/anduril/cfg-ff-pl47-219.h @@ -1,7 +1,6 @@ // Fireflies PL47-219B config options for Anduril // same as PL47 but with FET modes limited to 67% power // to avoid destroying the LEDs -#define FSM_FF_PL47_DRIVER #include "cfg-ff-pl47.h" #undef PWM2_LEVELS diff --git a/spaghetti-monster/anduril/cfg-ff-pl47.h b/spaghetti-monster/anduril/cfg-ff-pl47.h index 2e5647d..8e21013 100644 --- a/spaghetti-monster/anduril/cfg-ff-pl47.h +++ b/spaghetti-monster/anduril/cfg-ff-pl47.h @@ -1,4 +1,5 @@ // Fireflies PL47 config options for Anduril +#include "hwdef-FF_PL47.h" // the button lights up #define USE_INDICATOR_LED diff --git a/spaghetti-monster/anduril/cfg-ff-rot66-219.h b/spaghetti-monster/anduril/cfg-ff-rot66-219.h index 46ceb9f..efaad94 100644 --- a/spaghetti-monster/anduril/cfg-ff-rot66-219.h +++ b/spaghetti-monster/anduril/cfg-ff-rot66-219.h @@ -1,6 +1,5 @@ // Fireflies ROT66-219 (7x7135) config options for Anduril // same as regular ROT66, but calibrated for Nichia 219B with 7x7135 chips -#define FSM_FF_ROT66_DRIVER #include "cfg-ff-rot66.h" // driver is a FET+N+1, diff --git a/spaghetti-monster/anduril/cfg-ff-rot66.h b/spaghetti-monster/anduril/cfg-ff-rot66.h index 165b2ba..78d7f66 100644 --- a/spaghetti-monster/anduril/cfg-ff-rot66.h +++ b/spaghetti-monster/anduril/cfg-ff-rot66.h @@ -1,4 +1,5 @@ // Fireflies ROT66 (14x7135) config options for Anduril +#include "hwdef-FF_ROT66.h" // the button lights up #define USE_INDICATOR_LED diff --git a/spaghetti-monster/anduril/cfg-fw3a.h b/spaghetti-monster/anduril/cfg-fw3a.h index efa70ae..dd77137 100644 --- a/spaghetti-monster/anduril/cfg-fw3a.h +++ b/spaghetti-monster/anduril/cfg-fw3a.h @@ -1,4 +1,5 @@ // FW3A config options for Anduril +#include "hwdef-FW3A.h" // ../../bin/level_calc.py 1 65 7135 1 0.8 150 // ... mixed with this: diff --git a/spaghetti-monster/anduril/cfg-sofirn-sp36.h b/spaghetti-monster/anduril/cfg-sofirn-sp36.h index 2d6717f..1150a62 100644 --- a/spaghetti-monster/anduril/cfg-sofirn-sp36.h +++ b/spaghetti-monster/anduril/cfg-sofirn-sp36.h @@ -1,11 +1,11 @@ // Sofirn SP36 (small Q8) config options for Anduril +// same as the BLF Q8, mostly +#include "cfg-blf-q8.h" // voltage readings were a little high with the Q8 value +#undef VOLTAGE_FUDGE_FACTOR #define VOLTAGE_FUDGE_FACTOR 5 // add 0.25V, not 0.35V -#define FSM_BLF_Q8_DRIVER -#include "cfg-blf-q8.h" - // the high button LED mode on this light uses too much power // off mode: low (1) // lockout: blinking (3) diff --git a/spaghetti-monster/baton/baton.c b/spaghetti-monster/baton/baton.c index d138297..8a80134 100644 --- a/spaghetti-monster/baton/baton.c +++ b/spaghetti-monster/baton/baton.c @@ -17,7 +17,7 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#define FSM_EMISAR_D4_DRIVER +#include "hwdef-Emisar_D4.h" #define USE_LVP #define USE_THERMAL_REGULATION #define USE_DELAY_MS diff --git a/spaghetti-monster/darkhorse/darkhorse.c b/spaghetti-monster/darkhorse/darkhorse.c index d76afc2..ce1db2b 100644 --- a/spaghetti-monster/darkhorse/darkhorse.c +++ b/spaghetti-monster/darkhorse/darkhorse.c @@ -17,7 +17,7 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#define FSM_EMISAR_D4_DRIVER +#include "hwdef-Emisar_D4.h" #define USE_LVP #define USE_THERMAL_REGULATION #define DEFAULT_THERM_CEIL 45 diff --git a/spaghetti-monster/meteor/meteor.c b/spaghetti-monster/meteor/meteor.c index a50b034..5e925e2 100644 --- a/spaghetti-monster/meteor/meteor.c +++ b/spaghetti-monster/meteor/meteor.c @@ -18,7 +18,7 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#define FSM_EMISAR_D4_DRIVER +#include "hwdef-Emisar_D4.h" #define USE_LVP #define USE_THERMAL_REGULATION #define DEFAULT_THERM_CEIL 45 diff --git a/spaghetti-monster/momentary/momentary.c b/spaghetti-monster/momentary/momentary.c index 0372b3d..26acd44 100644 --- a/spaghetti-monster/momentary/momentary.c +++ b/spaghetti-monster/momentary/momentary.c @@ -19,7 +19,7 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#define FSM_EMISAR_D4_DRIVER +#include "hwdef-Emisar_D4.h" #define USE_LVP #define USE_DEBUG_BLINK #define USE_DELAY_4MS diff --git a/spaghetti-monster/ramping-ui/ramping-ui.c b/spaghetti-monster/ramping-ui/ramping-ui.c index 234cdf4..18f488d 100644 --- a/spaghetti-monster/ramping-ui/ramping-ui.c +++ b/spaghetti-monster/ramping-ui/ramping-ui.c @@ -17,7 +17,7 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#define FSM_EMISAR_D4_DRIVER +#include "hwdef-Emisar_D4.h" #define USE_LVP #define USE_THERMAL_REGULATION #define DEFAULT_THERM_CEIL 32 diff --git a/spaghetti-monster/rampingios/build-all.sh b/spaghetti-monster/rampingios/build-all.sh index 5b75fe4..106dc15 100755 --- a/spaghetti-monster/rampingios/build-all.sh +++ b/spaghetti-monster/rampingios/build-all.sh @@ -1,18 +1,13 @@ #!/bin/sh -cp -av ../anduril/cfg*.h . +cp -av ../anduril/cfg-emisar*.h . UI=rampingiosv3 -for TARGET in \ - EMISAR_D1 \ - EMISAR_D1S \ - EMISAR_D4 \ - EMISAR_D4_219C \ - EMISAR_D4S \ - EMISAR_D4S_219C \ - ; do - echo "===== $TARGET =====" - ../../../bin/build.sh 85 "$UI" "-DFSM_${TARGET}_DRIVER" - mv -f "$UI".hex "$UI".$TARGET.hex +for TARGET in cfg-*.h ; do + NAME=$(echo "$TARGET" | perl -ne '/cfg-(.*).h/ && print "$1\n";') + echo "===== $NAME =====" + echo ../../../bin/build.sh 85 "$UI" "-DCONFIGFILE=${TARGET}" + ../../../bin/build.sh 85 "$UI" "-DCONFIGFILE=${TARGET}" + mv -f "$UI".hex "$UI".$NAME.hex done diff --git a/spaghetti-monster/rampingios/rampingiosv3.c b/spaghetti-monster/rampingios/rampingiosv3.c index 4142121..ff81f61 100644 --- a/spaghetti-monster/rampingios/rampingiosv3.c +++ b/spaghetti-monster/rampingios/rampingiosv3.c @@ -18,18 +18,8 @@ */ /********* User-configurable options *********/ -// Physical driver type (uncomment one of the following or define it at the gcc command line) -//#define FSM_BLF_GT_DRIVER -//#define FSM_BLF_GT_MINI_DRIVER -//#define FSM_BLF_Q8_DRIVER -//#define FSM_EMISAR_D1_DRIVER -//#define FSM_EMISAR_D1S_DRIVER -//#define FSM_EMISAR_D4_DRIVER -//#define FSM_EMISAR_D4_219C_DRIVER -//#define FSM_EMISAR_D4S_DRIVER -//#define FSM_EMISAR_D4S_219C_DRIVER -//#define FSM_FF_ROT66_DRIVER -//#define FSM_FW3A_DRIVER +// Anduril config file name (set it here or define it at the gcc command line) +//#define CONFIGFILE cfg-emisar-d4s.h #define USE_LVP // FIXME: won't build when this option is turned off @@ -57,40 +47,8 @@ //#define BATTCHECK_4bars // FIXME: breaks build /***** specific settings for known driver types *****/ -#if defined(FSM_BLF_GT_DRIVER) -#include "cfg-blf-gt.h" - -#elif defined(FSM_BLF_GT_MINI_DRIVER) -#include "cfg-blf-gt-mini.h" - -#elif defined(FSM_BLF_Q8_DRIVER) -#include "cfg-blf-q8.h" - -#elif defined(FSM_EMISAR_D1_DRIVER) -#include "cfg-emisar-d1.h" - -#elif defined(FSM_EMISAR_D1S_DRIVER) -#include "cfg-emisar-d1s.h" - -#elif defined(FSM_EMISAR_D4_219C_DRIVER) -#include "cfg-emisar-d4-219c.h" - -#elif defined(FSM_EMISAR_D4_DRIVER) -#include "cfg-emisar-d4.h" - -#elif defined(FSM_EMISAR_D4S_219C_DRIVER) -#include "cfg-emisar-d4s-219c.h" - -#elif defined(FSM_EMISAR_D4S_DRIVER) -#include "cfg-emisar-d4s.h" - -#elif defined(FSM_FF_ROT66_DRIVER) -#include "cfg-ff-rot66.h" - -#elif defined(FSM_FW3A_DRIVER) -#include "cfg-fw3a.h" - -#endif +#include "tk.h" +#include incfile(CONFIGFILE) // thermal properties, if not defined per-driver diff --git a/spaghetti-monster/werner/build-all.sh b/spaghetti-monster/werner/build-all.sh index 43879bb..87d4f0d 100755 --- a/spaghetti-monster/werner/build-all.sh +++ b/spaghetti-monster/werner/build-all.sh @@ -4,16 +4,10 @@ cp -av ../anduril/cfg*.h . UI=werner -for TARGET in \ - BLF_GT \ - BLF_Q8 \ - EMISAR_D1 \ - EMISAR_D1S \ - EMISAR_D4 \ - EMISAR_D4S \ - FW3A \ - ; do - echo "===== $TARGET =====" - ../../../bin/build.sh 85 "$UI" "-DFSM_${TARGET}_DRIVER" - mv -f "$UI".hex "$UI".$TARGET.hex +for TARGET in cfg-*.h ; do + NAME=$(echo "$TARGET" | perl -ne '/cfg-(.*).h/ && print "$1\n";') + echo "===== $NAME =====" + echo ../../../bin/build.sh 85 "$UI" "-DCONFIGFILE=${TARGET}" + ../../../bin/build.sh 85 "$UI" "-DCONFIGFILE=${TARGET}" + mv -f "$UI".hex "$UI".$NAME.hex done diff --git a/spaghetti-monster/werner/werner.c b/spaghetti-monster/werner/werner.c index b6cdf12..7c47cd7 100644 --- a/spaghetti-monster/werner/werner.c +++ b/spaghetti-monster/werner/werner.c @@ -20,10 +20,7 @@ /********* User-configurable options *********/ // Physical driver type (uncomment one of the following or define it at the gcc command line) -//#define FSM_EMISAR_D4_DRIVER -//#define FSM_BLF_Q8_DRIVER -//#define FSM_FW3A_DRIVER -//#define FSM_BLF_GT_DRIVER +//#define CONFIGFILE cfg-emisar-d4.h #define USE_LVP // FIXME: won't build when this option is turned off @@ -37,21 +34,13 @@ //#define BATTCHECK_4bars // FIXME: breaks build /***** specific settings for known driver types *****/ -#if defined(FSM_BLF_GT_DRIVER) -#include "cfg-blf-gt.h" - -#elif defined(FSM_BLF_Q8_DRIVER) -#include "cfg-blf-q8.h" - -#elif defined(FSM_EMISAR_D4_DRIVER) -#include "cfg-emisar-d4.h" - -#elif defined(FSM_FW3A_DRIVER) -#include "cfg-fw3a.h" - +#ifdef CONFIGFILE +#include "tk.h" +#include incfile(CONFIGFILE) +#else +#error You need to define CONFIGFILE #endif - // thermal properties, if not defined per-driver #ifndef MIN_THERM_STEPDOWN #define MIN_THERM_STEPDOWN MAX_1x7135 // lowest value it'll step down to |
