diff options
| author | Selene ToyKeeper | 2019-05-14 03:16:33 -0600 |
|---|---|---|
| committer | Selene ToyKeeper | 2019-05-14 03:16:33 -0600 |
| commit | 1961c3a6950cefa05cdb6e4b0d1967371f7da9f4 (patch) | |
| tree | 40ccaf6d31352a9a0a5c1b34bb8744c01648a36d /spaghetti-monster/fsm-ramping.c | |
| parent | added tint ramping power correction for middle tints (diff) | |
| download | anduril-1961c3a6950cefa05cdb6e4b0d1967371f7da9f4.tar.gz anduril-1961c3a6950cefa05cdb6e4b0d1967371f7da9f4.tar.bz2 anduril-1961c3a6950cefa05cdb6e4b0d1967371f7da9f4.zip | |
the lantern middle-tint power correction factor wasn't quite right...
... so I adjusted it to make the result closer to a flat curve
Diffstat (limited to 'spaghetti-monster/fsm-ramping.c')
| -rw-r--r-- | spaghetti-monster/fsm-ramping.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/spaghetti-monster/fsm-ramping.c b/spaghetti-monster/fsm-ramping.c index 1dbb969..082f8c9 100644 --- a/spaghetti-monster/fsm-ramping.c +++ b/spaghetti-monster/fsm-ramping.c @@ -85,7 +85,7 @@ void set_level(uint8_t level) { // correction is only necessary when PWM is fast if (level > HALFSPEED_LEVEL) { base_PWM = brightness - + ((brightness>>1) * triangle_wave(mytint) / 255); + + ((((uint16_t)brightness) * 26 / 64) * triangle_wave(mytint) / 255); } cool_PWM = (((uint16_t)mytint * (uint16_t)base_PWM) + 127) / 255; |
