diff options
| author | Selene ToyKeeper | 2019-07-30 20:15:06 -0600 |
|---|---|---|
| committer | Selene ToyKeeper | 2019-07-30 20:15:06 -0600 |
| commit | 775a114098b9db17fe52ddff5ed080e0b24e5a38 (patch) | |
| tree | 60553b7ee6ff68a454c69b7ed5409f5ce7008e5a /spaghetti-monster | |
| parent | added an early version of Emisar D1S v2 hwdef and cfg files (diff) | |
| download | anduril-775a114098b9db17fe52ddff5ed080e0b24e5a38.tar.gz anduril-775a114098b9db17fe52ddff5ed080e0b24e5a38.tar.bz2 anduril-775a114098b9db17fe52ddff5ed080e0b24e5a38.zip | |
fsm-ramping: turn opamp chip on and off automatically based on ramp level
Diffstat (limited to '')
| -rw-r--r-- | spaghetti-monster/fsm-ramping.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/spaghetti-monster/fsm-ramping.c b/spaghetti-monster/fsm-ramping.c index 69e20bc..52a7246 100644 --- a/spaghetti-monster/fsm-ramping.c +++ b/spaghetti-monster/fsm-ramping.c @@ -65,9 +65,18 @@ void set_level(uint8_t level) { #if PWM_CHANNELS >= 4 PWM4_LVL = 0; #endif + // disable the power channel, if relevant + #ifdef LED_ENABLE_PIN + LED_ENABLE_PORT &= ~(1 << LED_ENABLE_PIN); + #endif } else { level --; + // enable the power channel, if relevant + #ifdef LED_ENABLE_PIN + LED_ENABLE_PORT |= (1 << LED_ENABLE_PIN); + #endif + #ifdef USE_TINT_RAMPING // calculate actual PWM levels based on a single-channel ramp // and a global tint value |
