From 020bf4bea3a08a1ffe7fe1f21a8ae0dae4b13f43 Mon Sep 17 00:00:00 2001
From: Selene ToyKeeper
Date: Wed, 14 Nov 2018 17:58:16 -0700
Subject: Made build script print the command it runs, so it'll be easier to
copy/paste individual parts for single builds.
---
spaghetti-monster/anduril/build-all.sh | 1 +
1 file changed, 1 insertion(+)
(limited to 'spaghetti-monster')
diff --git a/spaghetti-monster/anduril/build-all.sh b/spaghetti-monster/anduril/build-all.sh
index 34df732..754835f 100755
--- a/spaghetti-monster/anduril/build-all.sh
+++ b/spaghetti-monster/anduril/build-all.sh
@@ -19,6 +19,7 @@ for TARGET in \
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
done
--
cgit v1.2.3
From 75e17a578a8c7a7138f8557b08aa0ffa23453a53 Mon Sep 17 00:00:00 2001
From: Selene ToyKeeper
Date: Wed, 14 Nov 2018 18:03:04 -0700
Subject: added a fancier blinking mode for button/aux LEDs, enabled on D4S /
Q8 / SP36
---
spaghetti-monster/anduril/anduril.c | 11 +++++++++++
spaghetti-monster/anduril/cfg-blf-q8.h | 2 ++
spaghetti-monster/anduril/cfg-emisar-d4s.h | 2 ++
3 files changed, 15 insertions(+)
(limited to 'spaghetti-monster')
diff --git a/spaghetti-monster/anduril/anduril.c b/spaghetti-monster/anduril/anduril.c
index ec16497..d1d2a1a 100644
--- a/spaghetti-monster/anduril/anduril.c
+++ b/spaghetti-monster/anduril/anduril.c
@@ -1687,12 +1687,23 @@ void blink_confirm(uint8_t num) {
#if defined(USE_INDICATOR_LED) && defined(TICK_DURING_STANDBY)
// beacon-like mode for the indicator LED
void indicator_blink(uint8_t arg) {
+ #ifdef USE_FANCIER_BLINKING_INDICATOR
+
+ // fancy blink, set off/low/high levels here:
+ uint8_t seq[] = {0, 1, 2, 1, 0, 0, 0, 0,
+ 0, 0, 1, 0, 0, 0, 0, 0};
+ indicator_led(seq[arg & 15]);
+
+ #else // basic blink, 1/8th duty cycle
+
if (! (arg & 7)) {
indicator_led(2);
}
else {
indicator_led(0);
}
+
+ #endif
}
#endif
diff --git a/spaghetti-monster/anduril/cfg-blf-q8.h b/spaghetti-monster/anduril/cfg-blf-q8.h
index 1b9b971..84c6dcd 100644
--- a/spaghetti-monster/anduril/cfg-blf-q8.h
+++ b/spaghetti-monster/anduril/cfg-blf-q8.h
@@ -6,6 +6,8 @@
#define USE_INDICATOR_LED_WHILE_RAMPING
// enable blinking indicator LED while off
#define TICK_DURING_STANDBY
+#define STANDBY_TICK_SPEED 3 // every 0.128 s
+#define USE_FANCIER_BLINKING_INDICATOR
// copied from Emisar D4 ramp
// ../../bin/level_calc.py 1 65 7135 1 0.8 150
diff --git a/spaghetti-monster/anduril/cfg-emisar-d4s.h b/spaghetti-monster/anduril/cfg-emisar-d4s.h
index ef55668..1070ee7 100644
--- a/spaghetti-monster/anduril/cfg-emisar-d4s.h
+++ b/spaghetti-monster/anduril/cfg-emisar-d4s.h
@@ -8,6 +8,8 @@
#endif
// enable blinking indicator LED while off
#define TICK_DURING_STANDBY
+#define STANDBY_TICK_SPEED 3 // every 0.128 s
+#define USE_FANCIER_BLINKING_INDICATOR
#ifdef RAMP_LENGTH
#undef RAMP_LENGTH
--
cgit v1.2.3
From 4f909ae95e4374edf30eebbe49a3d2597b645333 Mon Sep 17 00:00:00 2001
From: Selene ToyKeeper
Date: Mon, 19 Nov 2018 17:00:39 -0700
Subject: Added FF PL47-219 build target, with the FET ramp multiplied by
0.6666. I guess it doesn't react well to high-amp cells, so this helps avoid
issues.
---
spaghetti-monster/anduril/anduril.c | 3 +++
spaghetti-monster/anduril/build-all.sh | 1 +
spaghetti-monster/anduril/cfg-ff-pl47-219.h | 8 ++++++++
3 files changed, 12 insertions(+)
create mode 100644 spaghetti-monster/anduril/cfg-ff-pl47-219.h
(limited to 'spaghetti-monster')
diff --git a/spaghetti-monster/anduril/anduril.c b/spaghetti-monster/anduril/anduril.c
index d1d2a1a..6d9d78e 100644
--- a/spaghetti-monster/anduril/anduril.c
+++ b/spaghetti-monster/anduril/anduril.c
@@ -106,6 +106,9 @@
#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"
diff --git a/spaghetti-monster/anduril/build-all.sh b/spaghetti-monster/anduril/build-all.sh
index 754835f..2f94c00 100755
--- a/spaghetti-monster/anduril/build-all.sh
+++ b/spaghetti-monster/anduril/build-all.sh
@@ -13,6 +13,7 @@ for TARGET in \
EMISAR_D4S \
EMISAR_D4S_219C \
FF_PL47 \
+ FF_PL47_219 \
FF_ROT66 \
FF_ROT66_219 \
FW3A \
diff --git a/spaghetti-monster/anduril/cfg-ff-pl47-219.h b/spaghetti-monster/anduril/cfg-ff-pl47-219.h
new file mode 100644
index 0000000..ea701bd
--- /dev/null
+++ b/spaghetti-monster/anduril/cfg-ff-pl47-219.h
@@ -0,0 +1,8 @@
+// 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
+#define PWM2_LEVELS 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,15,16,17,19,20,22,23,25,27,28,30,31,33,35,37,39,41,43,45,47,50,52,55,57,60,63,65,68,71,74,77,80,83,87,90,93,97,101,105,108,112,116,121,125,129,134,139,143,148,153,159,164,169
--
cgit v1.2.3
From 197f0dee351579a298fda8688bc8bc7d54eee813 Mon Sep 17 00:00:00 2001
From: Selene ToyKeeper
Date: Fri, 14 Dec 2018 09:42:41 -0700
Subject: Enable fancier aux LED blinking mode on BLF Q8 and Sofirn SP36.
---
spaghetti-monster/anduril/cfg-blf-q8.h | 3 +++
spaghetti-monster/anduril/cfg-sofirn-sp36.h | 3 +++
2 files changed, 6 insertions(+)
(limited to 'spaghetti-monster')
diff --git a/spaghetti-monster/anduril/cfg-blf-q8.h b/spaghetti-monster/anduril/cfg-blf-q8.h
index 84c6dcd..90099c3 100644
--- a/spaghetti-monster/anduril/cfg-blf-q8.h
+++ b/spaghetti-monster/anduril/cfg-blf-q8.h
@@ -8,6 +8,9 @@
#define TICK_DURING_STANDBY
#define STANDBY_TICK_SPEED 3 // every 0.128 s
#define USE_FANCIER_BLINKING_INDICATOR
+// off mode: high (2)
+// lockout: blinking (3)
+#define INDICATOR_LED_DEFAULT_MODE ((3<<2) + 2)
// copied from Emisar D4 ramp
// ../../bin/level_calc.py 1 65 7135 1 0.8 150
diff --git a/spaghetti-monster/anduril/cfg-sofirn-sp36.h b/spaghetti-monster/anduril/cfg-sofirn-sp36.h
index f6f7447..2d6717f 100644
--- a/spaghetti-monster/anduril/cfg-sofirn-sp36.h
+++ b/spaghetti-monster/anduril/cfg-sofirn-sp36.h
@@ -9,7 +9,10 @@
// the high button LED mode on this light uses too much power
// off mode: low (1)
// lockout: blinking (3)
+#ifdef INDICATOR_LED_DEFAULT_MODE
+#undef INDICATOR_LED_DEFAULT_MODE
#define INDICATOR_LED_DEFAULT_MODE ((3<<2) + 1)
+#endif
// don't blink during the ramp; the button LED brightness is sufficient
// to indicate which power channel(s) are being used
--
cgit v1.2.3
From fc2038da32259753b6398735a8a6a242c903f4d5 Mon Sep 17 00:00:00 2001
From: Selene ToyKeeper
Date: Sat, 15 Dec 2018 05:19:32 -0700
Subject: Updated Anduril text file, mostly.
---
spaghetti-monster/anduril/anduril.c | 2 ++
spaghetti-monster/anduril/anduril.txt | 57 ++++++++++++++++++-----------------
2 files changed, 32 insertions(+), 27 deletions(-)
(limited to 'spaghetti-monster')
diff --git a/spaghetti-monster/anduril/anduril.c b/spaghetti-monster/anduril/anduril.c
index 6d9d78e..ed4cb6d 100644
--- a/spaghetti-monster/anduril/anduril.c
+++ b/spaghetti-monster/anduril/anduril.c
@@ -1795,6 +1795,8 @@ void save_config_wl() {
void low_voltage() {
StatePtr state = current_state;
+ // TODO: turn off aux LED(s) when power is really low
+
if (0) {} // placeholder
#ifdef USE_STROBE_STATE
diff --git a/spaghetti-monster/anduril/anduril.txt b/spaghetti-monster/anduril/anduril.txt
index f0f0b4d..3e0328c 100644
--- a/spaghetti-monster/anduril/anduril.txt
+++ b/spaghetti-monster/anduril/anduril.txt
@@ -21,7 +21,7 @@ From off:
* 7 clicks: Change aux LED mode used in "off" mode.
(the modes are usually off/low/high/blinking)
-In steady mode:
+In steady / ramping mode:
* 1 click: off
* Hold: ramp up
* Click, hold: ramp down
@@ -30,19 +30,17 @@ In steady mode:
* 4 clicks: configure current ramp
Smooth ramp config mode:
- - Setting 1: memory on/off (not implemented yet)
- * Setting 2: low end
+ * Setting 1: low end
(click N times to set ramp floor to level N)
- * Setting 3: high end
+ * Setting 2: high end
(click N times to set ramp ceiling to level "151 - N")
Discrete ramp config mode:
- - Setting 1: memory on/off (not implemented yet)
- * Setting 2: low end
+ * Setting 1: low end
(click N times to set ramp floor to level N)
- * Setting 3: high end
+ * Setting 2: high end
(click N times to set ramp ceiling to level "151 - N")
- * Setting 4: number of levels in discrete ramp
+ * Setting 3: number of levels in discrete ramp
(click N times to make discrete mode have N stair-steps)
(minimum 2, maximum 150)
@@ -96,7 +94,6 @@ Discrete ramp config mode:
* 1 click: off
* 2 clicks: battcheck mode
* 4 clicks: thermal config mode
- - Hold: thermal calibration mode
Thermal config mode:
* Setting 1: calibrate sensor:
@@ -106,10 +103,6 @@ Discrete ramp config mode:
* Setting 2: temperature limit:
At buzz, click N times to set thermal limit to roughly 30 C + N.
- Thermal calibration mode:
- - Hold until hot: set new ceiling value
- - ... don't hold: blink out current ceiling value and exit
-
Lockout mode:
* Hold: momentary moon
* 4 clicks: exit lockout (return to regular "off" mode)
@@ -127,24 +120,33 @@ Muggle mode:
* Hold: Ramp up / down.
* 6 clicks: Exit muggle mode.
-Indicator LED support:
+Indicator LED / aux LED support:
+
+ The indicator LED (button LED), if there is one, tracks the brightness
+ of the main LED(s) during use. It'll be off, low, or high depending
+ on whether the main emitter is off, using only the first power
+ channel, or using a higher level.
- The indicator LED, if there is one, tracks the brightness of the main
- LED(s) during use. It'll be off, low, or high depending on whether
- the main emitter is off, using only the first power channel, or using
- a higher level.
+ If front-facing aux LEDs are present, they stay off while the main
+ light is on. They only turn on when the main emitters are off.
The indicator LED can stay on when the light is in the "off" state or
- lockout state. The user can configure each state to be low, high, or
- off. To configure it:
+ "lockout" state. These modes can have different settings, to make it
+ easier to see which one the light is in. To configure it:
+
+ 1. Go to the standby mode you want to configure. This is either
+ "off" or "lockout".
+ 2. In "off" mode, click 7 times to switch to the next aux LED mode.
+ Or in "lockout" mode, click 3 times.
+ 3. Repeat step 2 until the desired mode is reached.
+
+ The available aux LED / indicator LED modes vary depending on the type
+ of light, but they typically have the following modes:
- 1. Go to lockout mode. (4 clicks)
- 2. Click 3 times, optionally holding the third press, to change the
- value:
- * 3 fast clicks: Change lockout mode button brightness.
- * Hold the third click: Change regular "off" mode button
- brightness. Let go when desired level is reached.
- 3. Exit lockout mode. (4 clicks)
+ - Off
+ - Low
+ - High
+ - Blinking
TODO:
@@ -168,3 +170,4 @@ TODO:
- candle mode: smoother adjustments?
- make sunset mode timer and brightness configurable?
- make beacon mode actually sleep between pulses
+ - add a toggle for memory?
--
cgit v1.2.3
From c401894ebea3ed1f9313448324e897b2bf37b8e4 Mon Sep 17 00:00:00 2001
From: Selene ToyKeeper
Date: Tue, 18 Dec 2018 14:43:52 -0700
Subject: Reworked the config file include system so it'll include the #defined
value instead of having to hard-code a bunch of specific recognized values.
---
spaghetti-monster/anduril/anduril.c | 64 ++-----------------------
spaghetti-monster/anduril/build-all.sh | 27 +++--------
spaghetti-monster/anduril/cfg-blf-gt-mini.h | 1 +
spaghetti-monster/anduril/cfg-blf-gt.h | 1 +
spaghetti-monster/anduril/cfg-blf-q8.h | 1 +
spaghetti-monster/anduril/cfg-emisar-d1.h | 2 +
spaghetti-monster/anduril/cfg-emisar-d1s.h | 2 +
spaghetti-monster/anduril/cfg-emisar-d4-219c.h | 1 -
spaghetti-monster/anduril/cfg-emisar-d4.h | 1 +
spaghetti-monster/anduril/cfg-emisar-d4s-219c.h | 1 -
spaghetti-monster/anduril/cfg-emisar-d4s.h | 1 +
spaghetti-monster/anduril/cfg-ff-pl47-219.h | 1 -
spaghetti-monster/anduril/cfg-ff-pl47.h | 1 +
spaghetti-monster/anduril/cfg-ff-rot66-219.h | 1 -
spaghetti-monster/anduril/cfg-ff-rot66.h | 1 +
spaghetti-monster/anduril/cfg-fw3a.h | 1 +
spaghetti-monster/anduril/cfg-sofirn-sp36.h | 6 +--
17 files changed, 25 insertions(+), 88 deletions(-)
(limited to 'spaghetti-monster')
diff --git a/spaghetti-monster/anduril/anduril.c b/spaghetti-monster/anduril/anduril.c
index ed4cb6d..85390e2 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,52 +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_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 2f94c00..c355f1e 100755
--- a/spaghetti-monster/anduril/build-all.sh
+++ b/spaghetti-monster/anduril/build-all.sh
@@ -2,25 +2,10 @@
UI=anduril
-for TARGET in \
- BLF_GT \
- BLF_GT_MINI \
- 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-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)
--
cgit v1.2.3
From f144b83fbbd2c6a36600ed27291d0816543df34b Mon Sep 17 00:00:00 2001
From: Selene ToyKeeper
Date: Tue, 18 Dec 2018 14:59:40 -0700
Subject: Updated the rest of the FSM interfaces to use the new config file
system.
---
spaghetti-monster/baton/baton.c | 2 +-
spaghetti-monster/darkhorse/darkhorse.c | 2 +-
spaghetti-monster/meteor/meteor.c | 2 +-
spaghetti-monster/momentary/momentary.c | 2 +-
spaghetti-monster/ramping-ui/ramping-ui.c | 2 +-
spaghetti-monster/rampingios/build-all.sh | 19 ++++-------
spaghetti-monster/rampingios/rampingiosv3.c | 50 +++--------------------------
spaghetti-monster/werner/build-all.sh | 18 ++++-------
spaghetti-monster/werner/werner.c | 23 ++++---------
9 files changed, 28 insertions(+), 92 deletions(-)
(limited to 'spaghetti-monster')
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 .
*/
-#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 .
*/
-#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 .
*/
-#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 .
*/
-#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 .
*/
-#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
--
cgit v1.2.3
From 7c5d1fa5627ac58d954147e453965402ea61a5bb Mon Sep 17 00:00:00 2001
From: Selene ToyKeeper
Date: Sat, 22 Dec 2018 10:38:47 -0700
Subject: Turn off at beginning of 3rd click, not 2nd click. Makes
off-to-ceiling transition smoother.
---
spaghetti-monster/anduril/anduril.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
(limited to 'spaghetti-monster')
diff --git a/spaghetti-monster/anduril/anduril.c b/spaghetti-monster/anduril/anduril.c
index 85390e2..a0d587b 100644
--- a/spaghetti-monster/anduril/anduril.c
+++ b/spaghetti-monster/anduril/anduril.c
@@ -394,11 +394,6 @@ uint8_t off_state(Event event, uint16_t arg) {
set_state(steady_state, memorized_level);
return MISCHIEF_MANAGED;
}
- // 2 clicks (initial press): off, to prep for later events
- else if (event == EV_click2_press) {
- set_level(0);
- return MISCHIEF_MANAGED;
- }
// click, hold: go to highest level (ceiling) (for ramping down)
else if (event == EV_click2_hold) {
set_state(steady_state, MAX_LEVEL);
@@ -409,6 +404,11 @@ uint8_t off_state(Event event, uint16_t arg) {
set_state(steady_state, MAX_LEVEL);
return MISCHIEF_MANAGED;
}
+ // 3 clicks (initial press): off, to prep for later events
+ else if (event == EV_click3_press) {
+ set_level(0);
+ return MISCHIEF_MANAGED;
+ }
#ifdef USE_BATTCHECK
// 3 clicks: battcheck mode / blinky mode group 1
else if (event == EV_3clicks) {
--
cgit v1.2.3
From 8c23428528805a54c8cbb97409b8852dcb1d43de Mon Sep 17 00:00:00 2001
From: Selene ToyKeeper
Date: Sat, 22 Dec 2018 10:45:12 -0700
Subject: copied Anduril off-to-ceiling improvement to RampingIOS V3
---
spaghetti-monster/rampingios/rampingiosv3.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
(limited to 'spaghetti-monster')
diff --git a/spaghetti-monster/rampingios/rampingiosv3.c b/spaghetti-monster/rampingios/rampingiosv3.c
index ff81f61..894b405 100644
--- a/spaghetti-monster/rampingios/rampingiosv3.c
+++ b/spaghetti-monster/rampingios/rampingiosv3.c
@@ -274,11 +274,6 @@ uint8_t off_state(Event event, uint16_t arg) {
set_state(steady_state, memorized_level);
return MISCHIEF_MANAGED;
}
- // 2 clicks (initial press): off, to prep for later events
- else if (event == EV_click2_press) {
- set_level(0);
- return MISCHIEF_MANAGED;
- }
// click, hold: go to highest level (ceiling) (for ramping down)
else if (event == EV_click2_hold) {
set_state(steady_state, MAX_LEVEL);
@@ -289,6 +284,11 @@ uint8_t off_state(Event event, uint16_t arg) {
set_state(steady_state, MAX_LEVEL);
return MISCHIEF_MANAGED;
}
+ // 3 clicks (initial press): off, to prep for later events
+ else if (event == EV_click3_press) {
+ set_level(0);
+ return MISCHIEF_MANAGED;
+ }
#ifdef USE_BATTCHECK
// 3 clicks: battcheck mode / blinky mode group 1
else if (event == EV_3clicks) {
--
cgit v1.2.3
From aa97ec520c079eeb44ab581ecc6e2dd67eecd425 Mon Sep 17 00:00:00 2001
From: Selene ToyKeeper
Date: Thu, 3 Jan 2019 11:03:43 -0700
Subject: removed redundant clock speed lines, updated some comments
---
spaghetti-monster/anduril/anduril.c | 4 ----
spaghetti-monster/darkhorse/darkhorse.c | 1 +
spaghetti-monster/fsm-adc.c | 2 +-
3 files changed, 2 insertions(+), 5 deletions(-)
(limited to 'spaghetti-monster')
diff --git a/spaghetti-monster/anduril/anduril.c b/spaghetti-monster/anduril/anduril.c
index a0d587b..4816fcd 100644
--- a/spaghetti-monster/anduril/anduril.c
+++ b/spaghetti-monster/anduril/anduril.c
@@ -1817,9 +1817,6 @@ void loop() {
StatePtr state = current_state;
- #ifdef USE_DYNAMIC_UNDERCLOCKING
- auto_clock_speed();
- #endif
if (0) {}
#ifdef USE_STROBE_STATE
@@ -1838,7 +1835,6 @@ void loop() {
uint8_t del = strobe_delays[st];
// TODO: make tac strobe brightness configurable?
set_level(STROBE_BRIGHTNESS);
- CLKPR = 1<
+ inkscape:export-xdpi="342.78015"
+ inkscape:export-ydpi="342.78015">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -3017,10 +3225,11 @@
style="opacity:1;fill:#c0c0c0;fill-opacity:1;stroke:#040000;stroke-width:1;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="cc" />
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="cc" />
-
-
- OFF
-
@@ -3592,244 +3780,52 @@
inkscape:connector-curvature="0"
sodipodi:nodetypes="cc" />
+ id="g14617"
+ transform="translate(-13.294351,-32.815344)">
-
-
-
-
-
-
- Bike
-
- Flasher
-
-
- Party
-
- Strobe
-
-
- Tactical
-
- Strobe
-
-
- Lightning
-
- Storm
-
-
- Candle
-
-
-
-
-
-
- Brighter/ Faster
-
-
-
- Dimmer/ Slower
+ id="path5213-6-8-4-9-9-9-4-6-4-2"
+ d="m 1215.6497,872.07607 c -92.2951,14.34989 -90.2875,-65.11743 -29.8514,-66.50842 51.6628,-1.18906 77.3999,68.69862 -5.9066,54.96341"
+ style="fill:none;stroke:#000000;stroke-width:2.13333344;stroke-miterlimit:4;stroke-dasharray:12.8, 2.13333333;stroke-dashoffset:0;stroke-opacity:1;marker-end:url(#Arrow1Mend-31-1-0-9)" />
+ Brighter/ Faster
+
+
+
+ Dimmer/ Slower
-
-
-
-
- +30 min
-
-
-
+ id="g25629">
+
+
+ sodipodi:nodetypes="cc" />
+ id="path5213-6-8-4-9-9-56-6-28-7"
+ d="m 1099.1838,1002.8716 c -10.8263,-13.32961 -17.2825,-22.994 -19.3174,-41.90761"
+ style="fill:none;stroke:#009d00;stroke-width:2.13333344;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker-end:url(#Arrow1Mend-367-3-5-2)" />
+ id="path5213-6-8-4-9-9-56-6-28-8"
+ d="m 1386.1562,953.29137 c -0.01,16.47992 -3.5377,27.95532 -16.4966,45.71352"
+ style="fill:none;stroke:#009d00;stroke-width:2.13333344;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker-end:url(#Arrow1Mend-367-3-5-6)" />
+ id="path5213-6-8-4-9-9-56-6-9-6"
+ d="m 1286.1122,1044.9041 c -32.6374,7.6868 -68.0318,7.3275 -98.7961,1.9808"
+ style="fill:none;stroke:#009d00;stroke-width:2.13333344;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker-end:url(#Arrow1Mend-367-3-8-4)" />
+ sodipodi:nodetypes="cc" />
+ sodipodi:nodetypes="cc" />
+ sodipodi:nodetypes="cc" />
+ sodipodi:nodetypes="cc" />
+
+
+ Bike
+
+ Flasher
+
+
+ Party
+
+ Strobe
+
+
+ Tactical
+
+ Strobe
+
+
+ Lightning
+
+ Storm
+
+
+ Candle
+
+
+
+
+ +30 min
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ OFF
+
+
+
+
+
+
+
--
cgit v1.2.3
From 0fa81f7412245e28c03aac8d72c38bab5557586a Mon Sep 17 00:00:00 2001
From: Selene ToyKeeper
Date: Tue, 8 Jan 2019 23:50:47 -0700
Subject: Wrote up a basic user manual for Anduril.
---
spaghetti-monster/anduril/anduril-manual.txt | 349 +++++++++++++++++++++++++++
1 file changed, 349 insertions(+)
create mode 100644 spaghetti-monster/anduril/anduril-manual.txt
(limited to 'spaghetti-monster')
diff --git a/spaghetti-monster/anduril/anduril-manual.txt b/spaghetti-monster/anduril/anduril-manual.txt
new file mode 100644
index 0000000..65aebee
--- /dev/null
+++ b/spaghetti-monster/anduril/anduril-manual.txt
@@ -0,0 +1,349 @@
+Anduril User Manual
+-------------------
+
+Anduril is an open-source firmware for flashlights, distributed under
+the terms of the GPL v3. The sources can be obtained here:
+
+ http://FIXME
+
+
+Quick Start
+-----------
+
+After putting a battery in the light and tightening the parts together,
+the light should quickly blink once to confirm it has power and is now
+operational. After that, basic usage is simple:
+
+ - Click to turn the light on or off.
+ - Hold the button to change brightness.
+ - Release and hold again to change brightness the other way.
+
+That is all the user needs to know for basic use, but there are many
+more modes and features available for people who want more.
+
+Before reading the rest of this manual, it is recommended that users
+look at the Anduril UI diagram, which should be provided along with the
+flashlight.
+
+
+Ramping / Stepped Ramping Modes
+-------------------------------
+
+Anduril's normal operation mode uses a smooth ramp or a stepped ramp,
+depending on which style the user prefers.
+
+Each ramp has its own settings -- floor (lowest level), ceiling (highest
+level), and the stepped ramp can also have a configurable number of
+steps.
+
+There are four ways to access this mode when the light is off:
+
+ - Click: Turn on at the memorized brightness.
+ - Hold: Turn on at the floor level. The light should give a very
+ subtle dark blink when the user can let go of the button to stay at
+ the floor, or keep holding the button to ramp up.
+ - 2 clicks: Turn on at the ceiling level.
+ - Click, hold: Turn on at the ceiling level, then ramp down.
+
+While the light is on, a few basic actions are available:
+
+ - Click: Turn off.
+ - 2 clicks: Go to or from turbo (full power).
+ - Hold: Change brightness (up). If the button was released less than
+ 1 second ago, or if it's already at the ceiling, it goes down
+ instead.
+ - Click, hold: Change brightness (down).
+ - 3 clicks: Switch to the other ramp.
+ - 4 clicks: Go to ramp config mode.
+
+
+Other Modes
+-----------
+
+Anduril has several other modes too. To access these, press the button
+more than 2 times when the light is off:
+
+ - 3 clicks: Access the blinky / utility modes.
+ - Click, click, hold: Access the strobe modes.
+ - 4 clicks: Lockout mode.
+ - 5 clicks: Momentary mode.
+ - 6 clicks: Muggle mode.
+
+
+Blinky / Utility Modes
+----------------------
+
+Click 3 times from Off to access Anduril's blinky / utility modes. This
+always starts at battery check and the user can proceed to other blinky
+modes from there. The sequence is:
+
+ 1. Battery check.
+ 2. Sunset mode.
+ 3. Beacon mode.
+ 4. Temperature check.
+
+In all of these modes, some basic actions are available:
+
+ - Click: Turn off.
+ - 2 clicks: Next blinky mode.
+
+Additionally, in beacon and temperature check modes:
+
+ - 4 clicks: Go to the beacon config mode or thermal config mode.
+
+In more detail, this is what each blinky / utility mode does:
+
+ 1. Battery check.
+
+ Blinks out the battery voltage per cell. Full is 4.2V, empty is
+ about 3.0V. The light blinks the whole-number digit first, pauses,
+ then blinks out the "tenths" digit. Then a longer pause, and it
+ repeats.
+ So for 4.2V, it would be "blink-blink-blink-blink .. blink-blink".
+
+ A "zero" digit is represented by a very quick blink.
+
+ 2. Sunset mode.
+
+ This starts at a low level, then dims gradually for an hour, and
+ then shuts off. It is intended for use when going to bed.
+
+ 3. Beacon mode.
+
+ Blinks at a slow speed. The light stays on for half a second, and
+ then stays off until the next blink. The brightness and the number
+ of seconds between pulses is configurable:
+
+ - Brightness is the user's last-ramped level, so set this in
+ ramping mode before starting beacon mode.
+
+ - Speed is configured in beacon config mode. Click 4 times to
+ enter beacon config mode, wait for the light to stutter, then
+ click to enter the number of seconds per blink. For example,
+ to do a 10-second alpine beacon, click 10 times.
+
+ 4. Temperature check.
+
+ Blinks out the current temperature in degrees C. This number
+ should be pretty close to what a real thermometer says. If not, it
+ would be a good idea to click 4 times to enter thermal config mode,
+ and calibrate the sensor.
+
+ Thermal config mode has two settings:
+
+ - Current temperature. Click once per degree C to calibrate the
+ sensor. For example, if the ambient temperature is 21 C, then
+ click 21 times.
+
+ - Temperature limit. This sets the maximum temperature the light
+ can reach before it will start doing thermal regulation to keep
+ itself from overheating. Click once per degree C above 30. For
+ example, to set the limit to 50 C, click 20 times. The default
+ is 45 C.
+
+
+Strobe / Mood Modes
+-------------------
+
+Anduril includes a few extra modes for a variety of purposes:
+
+ - Candle mode
+ - Bike flasher
+ - Party strobe
+ - Tactical strobe
+ - Lightning storm mode
+
+Click 3 times from Off to access these, but hold the third click for a
+moment. Click, click, hold. The last-used strobe mode is remembered,
+so it will return to whichever one you used last.
+
+In all of these modes, a few actions are available:
+
+ - Click: Turn off.
+ - 2 Clicks: Next strobe / mood mode.
+ - Hold: Increase brightness, or strobe faster. (except lightning)
+ - Click, hold: Decrease brightness, or strobe slower. (except lightning)
+
+Additionally, candle mode has one more action:
+
+ - 3 clicks: Add 30 minutes to the timer.
+
+In more detail, here is what each mode does:
+
+ - Candle mode
+
+ Brightness changes randomly in a pattern resembling a candle flame.
+ If a timer is set, it will run until the timer expires, then get
+ dimmer for one minute, then sputter and turn itself off. Without a
+ timer, candle mode runs until the user turns it off. Brightness is
+ configurable.
+
+ - Bike flasher
+
+ Runs at a medium level, but stutters to a brighter level once per
+ second. Designed to be more visible than a normal ramping mode, but
+ otherwise works mostly the same. Brightness is configurable.
+
+ - Party strobe
+
+ Motion-freezing strobe light. Can be used to freeze spinning fans
+ and falling water. Speed is configurable.
+
+ - Tactical strobe
+
+ Disorienting strobe light. Can be used to irritate people. Speed
+ is configurable, and the duty cycle is always 33%.
+
+ - Lightning storm mode
+
+ Flashes at random brightness and random speed to simulate lightning
+ strikes during a busy lightning storm. Do not look directly at the
+ flashlight when this mode is running, because it may suddenly go to
+ full power without warning.
+
+
+Lockout Mode
+------------
+
+Click 4 times from Off to enter Lockout mode. This makes the light safe
+to carry in a pocket or a bag or anywhere else the button might be
+pressed by accident.
+
+To exit lockout mode, click 4 times. The light should blink briefly and
+then return to the regular "off" mode.
+
+Lockout mode also doubles as a momentary moon mode, so the user can do
+quick tasks without having to unlock the light. The brightness in
+lockout mode is determined by the floor setting of the current ramp.
+
+
+Momentary Mode
+--------------
+
+Click 5 times from Off to enter Momentary mode. This locks the
+flashlight into a single-mode interface where the LEDs are only on when
+the button is held down. It is intended for Morse code and other
+signalling tasks.
+
+Brightness is the last-ramped level, so adjust that before entering
+momentary mode.
+
+To exit this mode, physically disconnect power by unscrewing the tailcap
+or battery tube.
+
+
+Muggle Mode
+-----------
+
+Click 6 times from Off to enter Muggle mode. This is a simpler and
+less-bright interface which makes the light relatively safe to lend to
+children or other people who could use the light unsafely.
+
+In Muggle mode, there are only a few available actions:
+
+ - Click: Turn the light on or off.
+ - Hold: Change brightness.
+ - 6 clicks: Exit Muggle mode.
+
+The brightness in this mode usually goes from about 10 lm to 300 lm.
+
+Muggle mode is remembered even after changing the battery. This helps
+prevent children from exiting the mode by unscrewing the tailcap.
+However, be sure to supervise children whenever they are using any
+powerful tools, including a bright flashlight.
+
+
+Configuration Modes
+-------------------
+
+Every config mode has the same interface. The menu has one or more
+options the user can configure, and it will go through them in order.
+For each menu item, the light will follow the same pattern:
+
+ - Blink one or more times, corresponding to the item number.
+
+ - Stutter or "buzz" quickly between two brightness levels for a few
+ seconds. This indicates that the user can click one or more times
+ to enter a number. It will keep buzzing until the user stops
+ clicking, so there is no need to hurry.
+
+ - Pause, and then go to the next option.
+
+After the light has gone through all of the menu options, it should
+return to whatever mode the light was in before entering the config
+mode.
+
+If the user doesn't press a button during a menu item's "buzz" phase,
+that item remains unchanged from its previous value.
+
+
+Ramp Config Mode
+----------------
+
+While the light is on in a ramping mode, click 4 times to enter the
+config mode for the current ramp.
+
+For smooth ramping mode, there are two menu options:
+
+ 1. Floor. (default = 1/150)
+ 2. Ceiling. (default = 120/150)
+
+For the stepped ramping mode, there are three menu options:
+
+ 1. Floor. (default = 20/150)
+ 2. Ceiling. (default = 120/150)
+ 3. Number of steps. (default = 7)
+
+To configure the floor level, click the button equal to the number of
+ramp levels (out of 150) at which the floor should be. To set the
+lowest possible level, click once.
+
+To configure the ceiling level, each click goes one level lower. So 1
+click sets the highest possible level, 2 clicks is the 2nd-highest, 3
+clicks is the 3rd-highest level, etc. To set the default of 120/150,
+click 31 times.
+
+When configuring the number of steps, the value can be anything from 2
+to 150.
+
+
+Protection Features
+-------------------
+
+Anduril includes low voltage protection (LVP) and thermal regulation.
+
+LVP makes the light step down to a lower level when the battery is low,
+and if the light is already at the lowest level, it shuts itself off.
+This activates at 2.8V. LVP adjustments happen suddenly, in large
+steps.
+
+Thermal regulation attempts to keep the light from overheating, and
+otherwise adjusts output to stay as close as possible to the
+user-configured temperature limit. Thermal adjustments happen
+gradually, in steps so small they are difficult for humans to perceive.
+
+
+Aux LEDs / Button LEDs
+----------------------
+
+Some lights have aux LEDs or button LEDs. These can be configured to do
+different things while the main emitters are off. There is one aux LED
+mode for the regular "off" mode, and another aux LED mode for "lockout"
+mode. This allows the user to see at a glance whether the light is
+locked.
+
+Aux LED modes typically include:
+
+ - Off
+ - Low
+ - High
+ - Blinking
+
+To configure the aux LEDs, go to the mode you want to configure and then
+click the button a few times:
+
+ - Off mode: 7 clicks.
+ - Lockout mode: 3 clicks.
+
+This should change the aux LEDs to the next mode supported on this
+light.
--
cgit v1.2.3
From 9d5e6e6a5862d8a0551674e6abdb15639df9458f Mon Sep 17 00:00:00 2001
From: Selene ToyKeeper
Date: Wed, 9 Jan 2019 00:12:25 -0700
Subject: Added missing URL (oops).
---
spaghetti-monster/anduril/anduril-manual.txt | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
(limited to 'spaghetti-monster')
diff --git a/spaghetti-monster/anduril/anduril-manual.txt b/spaghetti-monster/anduril/anduril-manual.txt
index 65aebee..66a8ba0 100644
--- a/spaghetti-monster/anduril/anduril-manual.txt
+++ b/spaghetti-monster/anduril/anduril-manual.txt
@@ -4,7 +4,8 @@ Anduril User Manual
Anduril is an open-source firmware for flashlights, distributed under
the terms of the GPL v3. The sources can be obtained here:
- http://FIXME
+ http://tiny.cc/TKAnduril
+ https://bazaar.launchpad.net/~toykeeper/flashlight-firmware/trunk/files/head:/ToyKeeper/spaghetti-monster/anduril/
Quick Start
--
cgit v1.2.3
From 6d7523f32093815e6dca02ee8e043be4710c62e6 Mon Sep 17 00:00:00 2001
From: Selene ToyKeeper
Date: Sat, 12 Jan 2019 15:50:37 -0700
Subject: Small updates to the manual.
---
spaghetti-monster/anduril/anduril-manual.txt | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
(limited to 'spaghetti-monster')
diff --git a/spaghetti-monster/anduril/anduril-manual.txt b/spaghetti-monster/anduril/anduril-manual.txt
index 66a8ba0..cd4fe3e 100644
--- a/spaghetti-monster/anduril/anduril-manual.txt
+++ b/spaghetti-monster/anduril/anduril-manual.txt
@@ -51,7 +51,7 @@ While the light is on, a few basic actions are available:
- Click: Turn off.
- 2 clicks: Go to or from turbo (full power).
- Hold: Change brightness (up). If the button was released less than
- 1 second ago, or if it's already at the ceiling, it goes down
+ a second ago, or if it's already at the ceiling, it goes down
instead.
- Click, hold: Change brightness (down).
- 3 clicks: Switch to the other ramp.
@@ -113,7 +113,7 @@ In more detail, this is what each blinky / utility mode does:
Blinks at a slow speed. The light stays on for half a second, and
then stays off until the next blink. The brightness and the number
- of seconds between pulses is configurable:
+ of seconds between pulses are configurable:
- Brightness is the user's last-ramped level, so set this in
ramping mode before starting beacon mode.
@@ -348,3 +348,11 @@ click the button a few times:
This should change the aux LEDs to the next mode supported on this
light.
+
+For lights with a button LED, the button LED typically stays on while
+the main emitters are on. Its brightness level is set in a way which
+mirrors the main LED -- off, low, or high.
+
+For lights with front-facing aux LEDs, the aux LEDs typically stay off
+when the main emitters are on, and when the light is otherwise awake.
+The aux LEDs on most lights only turn on when the light is asleep.
--
cgit v1.2.3
From a5d824071d0152afb085f71301251c8ba455c361 Mon Sep 17 00:00:00 2001
From: Selene ToyKeeper
Date: Sat, 12 Jan 2019 15:51:56 -0700
Subject: Added an option for a "fancy" moon mode during lockout. 2nd click
goes to the other ramp's floor level.
---
spaghetti-monster/anduril/anduril.c | 9 +++++++++
1 file changed, 9 insertions(+)
(limited to 'spaghetti-monster')
diff --git a/spaghetti-monster/anduril/anduril.c b/spaghetti-monster/anduril/anduril.c
index 4816fcd..09c7927 100644
--- a/spaghetti-monster/anduril/anduril.c
+++ b/spaghetti-monster/anduril/anduril.c
@@ -192,6 +192,8 @@ uint8_t beacon_state(Event event, uint16_t arg);
uint8_t beacon_config_state(Event event, uint16_t arg);
// soft lockout
#define MOON_DURING_LOCKOUT_MODE
+// if enabled, 2nd lockout click goes to the other ramp's floor level
+//#define LOCKOUT_MOON_FANCY
uint8_t lockout_state(Event event, uint16_t arg);
// momentary / signalling mode
uint8_t momentary_state(Event event, uint16_t arg);
@@ -1111,6 +1113,13 @@ uint8_t lockout_state(Event event, uint16_t arg) {
uint8_t lvl = ramp_smooth_floor;
if (ramp_discrete_floor < lvl) lvl = ramp_discrete_floor;
set_level(lvl);
+ #elif defined(LOCKOUT_MOON_FANCY)
+ uint8_t levels[] = { ramp_smooth_floor, ramp_discrete_floor };
+ if ((event & 0x0f) == 2) {
+ set_level(levels[ramp_style^1]);
+ } else {
+ set_level(levels[ramp_style]);
+ }
#else
// Use moon from current ramp
set_level(nearest_level(1));
--
cgit v1.2.3