aboutsummaryrefslogtreecommitdiff
path: root/spaghetti-monster
diff options
context:
space:
mode:
authorSelene ToyKeeper2021-10-31 02:51:38 -0600
committerSelene ToyKeeper2021-10-31 02:51:38 -0600
commitc890237f5ed6fba2f200cba23cff5622818a9ad0 (patch)
treef99095e6d9706e9da8d01b7293bdd57f92e9c496 /spaghetti-monster
parentadded "200%" turbo on tint-ramping lights: D4S and LT1 (diff)
downloadanduril-c890237f5ed6fba2f200cba23cff5622818a9ad0.tar.gz
anduril-c890237f5ed6fba2f200cba23cff5622818a9ad0.tar.bz2
anduril-c890237f5ed6fba2f200cba23cff5622818a9ad0.zip
fixed flicker on inactive tint ramp channel during ramping
Diffstat (limited to 'spaghetti-monster')
-rw-r--r--spaghetti-monster/fsm-ramping.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/spaghetti-monster/fsm-ramping.c b/spaghetti-monster/fsm-ramping.c
index ee72cd7..49e173f 100644
--- a/spaghetti-monster/fsm-ramping.c
+++ b/spaghetti-monster/fsm-ramping.c
@@ -102,6 +102,7 @@ void set_level(uint8_t level) {
#endif
} else {
// enable the power channel, if relevant
+ #ifndef USE_TINT_RAMPING // update_tint handles this better
#ifdef LED_ENABLE_PIN
#ifndef LED_ENABLE_PIN_LEVEL_MIN
LED_ENABLE_PORT |= (1 << LED_ENABLE_PIN);
@@ -117,6 +118,7 @@ void set_level(uint8_t level) {
#ifdef LED2_ENABLE_PIN
LED2_ENABLE_PORT |= (1 << LED2_ENABLE_PIN);
#endif
+ #endif // ifndef USE_TINT_RAMPING
// PWM array index = level - 1
level --;
@@ -354,11 +356,15 @@ void update_tint() {
// disable the power channel, if relevant
#ifdef LED_ENABLE_PIN
- if (! warm_PWM)
+ if (warm_PWM)
+ LED_ENABLE_PORT |= (1 << LED_ENABLE_PIN);
+ else
LED_ENABLE_PORT &= ~(1 << LED_ENABLE_PIN);
#endif
#ifdef LED2_ENABLE_PIN
- if (! cool_PWM)
+ if (cool_PWM)
+ LED2_ENABLE_PORT |= (1 << LED2_ENABLE_PIN);
+ else
LED2_ENABLE_PORT &= ~(1 << LED2_ENABLE_PIN);
#endif
}