diff options
| author | Selene ToyKeeper | 2017-09-09 22:58:26 -0600 |
|---|---|---|
| committer | Selene ToyKeeper | 2017-09-09 22:58:26 -0600 |
| commit | 7315575b2e7506417c2f2e81846e378d09949b5e (patch) | |
| tree | dc903bc915ca0e0bef51725a85dd5fe06e99f794 /spaghetti-monster/fsm-ramping.h | |
| parent | Made "off" mode more vigilant about staying off. (diff) | |
| download | anduril-7315575b2e7506417c2f2e81846e378d09949b5e.tar.gz anduril-7315575b2e7506417c2f2e81846e378d09949b5e.tar.bz2 anduril-7315575b2e7506417c2f2e81846e378d09949b5e.zip | |
Made thermal regulation adjust smoothly (1 PWM step at a time) to make adjustments less noticeable.
Added set_level_gradually() and gradual_tick() to ramping lib.
Not terribly happy with it yet, but it at least works in practice.
Added extra thermal regulation checks because I was running into stupid behavior in edge cases.
Increased lowest thermal stepdown level to MAX_LEVEL/3 because it was going down way too low before.
(is still pretty low, but not quite as bad)
Diffstat (limited to '')
| -rw-r--r-- | spaghetti-monster/fsm-ramping.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/spaghetti-monster/fsm-ramping.h b/spaghetti-monster/fsm-ramping.h index b4054bf..ac4e58c 100644 --- a/spaghetti-monster/fsm-ramping.h +++ b/spaghetti-monster/fsm-ramping.h @@ -26,6 +26,13 @@ // actual_level: last ramp level set by set_level() volatile uint8_t actual_level = 0; +#ifdef USE_SET_LEVEL_GRADUALLY +// adjust brightness very smoothly +volatile uint8_t gradual_target; +inline void set_level_gradually(uint8_t lvl); +void gradual_tick(); +#endif + // ramp tables #if PWM_CHANNELS == 1 #if RAMP_LENGTH == 50 |
