diff options
| author | Selene ToyKeeper | 2021-01-24 22:21:06 -0700 |
|---|---|---|
| committer | Selene ToyKeeper | 2021-01-24 22:21:06 -0700 |
| commit | ecd711cf477ec1a25d08e3f5c35b86e306cbc7a5 (patch) | |
| tree | 081970215e165a45672d7d724cbd2c4644156e49 /spaghetti-monster/fsm-ramping.c | |
| parent | added model number to Lume1 FW3X build target (diff) | |
| parent | noctigon k9.3: default to aux RGB rainbow mode, and automatic memory (diff) | |
| download | anduril-ecd711cf477ec1a25d08e3f5c35b86e306cbc7a5.tar.gz anduril-ecd711cf477ec1a25d08e3f5c35b86e306cbc7a5.tar.bz2 anduril-ecd711cf477ec1a25d08e3f5c35b86e306cbc7a5.zip | |
merged noctigon k9.3 branch
Diffstat (limited to 'spaghetti-monster/fsm-ramping.c')
| -rw-r--r-- | spaghetti-monster/fsm-ramping.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/spaghetti-monster/fsm-ramping.c b/spaghetti-monster/fsm-ramping.c index 8ad4b65..0768f8d 100644 --- a/spaghetti-monster/fsm-ramping.c +++ b/spaghetti-monster/fsm-ramping.c @@ -54,6 +54,10 @@ void set_level(uint8_t level) { #endif #endif + #ifdef OVERRIDE_SET_LEVEL + set_level_override(level); + #else + //TCCR0A = PHASE; if (level == 0) { #if PWM_CHANNELS >= 1 @@ -72,8 +76,8 @@ void set_level(uint8_t level) { #ifdef LED_ENABLE_PIN LED_ENABLE_PORT &= ~(1 << LED_ENABLE_PIN); #endif - #ifdef LED_ENABLE2_PIN - LED_ENABLE2_PORT &= ~(1 << LED_ENABLE2_PIN); + #ifdef LED2_ENABLE_PIN + LED2_ENABLE_PORT &= ~(1 << LED2_ENABLE_PIN); #endif } else { // enable the power channel, if relevant @@ -89,8 +93,8 @@ void set_level(uint8_t level) { LED_ENABLE_PORT &= ~(1 << LED_ENABLE_PIN); #endif #endif - #ifdef LED_ENABLE2_PIN - LED_ENABLE2_PORT |= (1 << LED_ENABLE2_PIN); + #ifdef LED2_ENABLE_PIN + LED2_ENABLE_PORT |= (1 << LED2_ENABLE_PIN); #endif level --; @@ -148,6 +152,7 @@ void set_level(uint8_t level) { #endif // ifdef USE_TINT_RAMPING } + #endif // ifdef OVERRIDE_SET_LEVEL #ifdef USE_DYNAMIC_UNDERCLOCKING auto_clock_speed(); #endif @@ -158,6 +163,7 @@ inline void set_level_gradually(uint8_t lvl) { gradual_target = lvl; } +#ifndef OVERRIDE_GRADUAL_TICK // call this every frame or every few frames to change brightness very smoothly void gradual_tick() { // go by only one ramp level at a time instead of directly to the target @@ -222,7 +228,8 @@ void gradual_tick() { auto_clock_speed(); #endif } -#endif +#endif // ifdef OVERRIDE_GRADUAL_TICK +#endif // ifdef USE_SET_LEVEL_GRADUALLY #endif // ifdef USE_RAMPING #endif |
