aboutsummaryrefslogtreecommitdiff
path: root/spaghetti-monster
diff options
context:
space:
mode:
Diffstat (limited to 'spaghetti-monster')
-rw-r--r--spaghetti-monster/anduril/candle-mode.c2
-rw-r--r--spaghetti-monster/anduril/config-default.h3
-rw-r--r--spaghetti-monster/anduril/ramp-mode.c2
-rw-r--r--spaghetti-monster/anduril/strobe-modes.c2
4 files changed, 6 insertions, 3 deletions
diff --git a/spaghetti-monster/anduril/candle-mode.c b/spaghetti-monster/anduril/candle-mode.c
index 3704ee6..d15195e 100644
--- a/spaghetti-monster/anduril/candle-mode.c
+++ b/spaghetti-monster/anduril/candle-mode.c
@@ -98,7 +98,7 @@ uint8_t candle_mode_state(Event event, uint16_t arg) {
// clock tick: animate candle brightness
else if (event == EV_tick) {
// un-reverse after 1 second
- if (arg == TICKS_PER_SECOND) ramp_direction = 1;
+ if (arg == AUTO_REVERSE_TIME) ramp_direction = 1;
// 3-oscillator synth for a relatively organic pattern
uint8_t add;
diff --git a/spaghetti-monster/anduril/config-default.h b/spaghetti-monster/anduril/config-default.h
index 9c194f9..5b9897c 100644
--- a/spaghetti-monster/anduril/config-default.h
+++ b/spaghetti-monster/anduril/config-default.h
@@ -71,6 +71,9 @@
// smooth ramp speed: 1, 2, 3, 4, ... for 1X speed, 1/2, 1/3rd, 1/4th, ...
#define USE_RAMP_SPEED_CONFIG
+// after ramping, how long until the direction resets to "up"?
+#define AUTO_REVERSE_TIME (TICKS_PER_SECOND * 2 / 3)
+
// add runtime option for whether hold-from-off should ramp or stay at moon
#define USE_RAMP_AFTER_MOON_CONFIG
diff --git a/spaghetti-monster/anduril/ramp-mode.c b/spaghetti-monster/anduril/ramp-mode.c
index 31f959b..6d85480 100644
--- a/spaghetti-monster/anduril/ramp-mode.c
+++ b/spaghetti-monster/anduril/ramp-mode.c
@@ -258,7 +258,7 @@ uint8_t steady_state(Event event, uint16_t arg) {
else if (event == EV_tick) {
// un-reverse after 1 second
- if (arg == TICKS_PER_SECOND) ramp_direction = 1;
+ if (arg == AUTO_REVERSE_TIME) ramp_direction = 1;
#ifdef USE_SUNSET_TIMER
// reduce output if shutoff timer is active
diff --git a/spaghetti-monster/anduril/strobe-modes.c b/spaghetti-monster/anduril/strobe-modes.c
index b27f298..d5f12c0 100644
--- a/spaghetti-monster/anduril/strobe-modes.c
+++ b/spaghetti-monster/anduril/strobe-modes.c
@@ -153,7 +153,7 @@ uint8_t strobe_state(Event event, uint16_t arg) {
// clock tick: bump the random seed
else if (event == EV_tick) {
// un-reverse after 1 second
- if (arg == TICKS_PER_SECOND) ramp_direction = 1;
+ if (arg == AUTO_REVERSE_TIME) ramp_direction = 1;
pseudo_rand_seed += arg;
return MISCHIEF_MANAGED;