aboutsummaryrefslogtreecommitdiff
path: root/spaghetti-monster/fsm-ramping.c
diff options
context:
space:
mode:
authorSelene ToyKeeper2019-08-11 15:16:23 -0600
committerSelene ToyKeeper2019-08-11 15:16:23 -0600
commit89a86871aa6330218043586f0347c0c1e7c79dab (patch)
treee3a4cc2a4517e5563e91cdaaf86718170d4f0a37 /spaghetti-monster/fsm-ramping.c
parentAdded setup info for Fedora. (diff)
parentadded scripts to flash attiny1634, which were missing before (diff)
downloadanduril-89a86871aa6330218043586f0347c0c1e7c79dab.tar.gz
anduril-89a86871aa6330218043586f0347c0c1e7c79dab.tar.bz2
anduril-89a86871aa6330218043586f0347c0c1e7c79dab.zip
merged fsm to trunk... lots of updates:
+ attiny1634 support + Emisar D4v2 support + Mateminco MF01S / MT18 support + Fireflies E01 and E07v2 support + RGB aux LED support + added factory reset function + added manual / automatic memory toggle + added 2-level brightness during lockout + added Fireflies UI + made momentary mode also support strobe-group modes * thermal regulation rewritten, behaves mostly better now * strobe modes auto-reverse their ramp now * muggle mode fixes * UI diagram and manual updated * button timing adjusted, and compile-time options added for it * general refactoring
Diffstat (limited to 'spaghetti-monster/fsm-ramping.c')
-rw-r--r--spaghetti-monster/fsm-ramping.c26
1 files changed, 17 insertions, 9 deletions
diff --git a/spaghetti-monster/fsm-ramping.c b/spaghetti-monster/fsm-ramping.c
index 082f8c9..efa07e4 100644
--- a/spaghetti-monster/fsm-ramping.c
+++ b/spaghetti-monster/fsm-ramping.c
@@ -30,17 +30,25 @@ void set_level(uint8_t level) {
gradual_target = level;
#endif
- #ifdef USE_INDICATOR_LED
#ifdef USE_INDICATOR_LED_WHILE_RAMPING
- if (! go_to_standby)
- indicator_led((level > 0) + (level > MAX_1x7135));
- //if (level > MAX_1x7135) indicator_led(2);
- //else if (level > 0) indicator_led(1);
- //else if (! go_to_standby) indicator_led(0);
+ #ifdef USE_INDICATOR_LED
+ if (! go_to_standby)
+ indicator_led((level > 0) + (level > MAX_1x7135));
+ #endif
+ //if (level > MAX_1x7135) indicator_led(2);
+ //else if (level > 0) indicator_led(1);
+ //else if (! go_to_standby) indicator_led(0);
#else
- if (! go_to_standby)
- indicator_led(0);
- #endif
+ #if defined(USE_INDICATOR_LED) || defined(USE_AUX_RGB_LEDS)
+ if (! go_to_standby) {
+ #ifdef USE_INDICATOR_LED
+ indicator_led(0);
+ #endif
+ #ifdef USE_AUX_RGB_LEDS
+ rgb_led_set(0);
+ #endif
+ }
+ #endif
#endif
//TCCR0A = PHASE;