diff options
| author | Selene ToyKeeper | 2019-11-29 15:01:34 -0700 |
|---|---|---|
| committer | Selene ToyKeeper | 2019-11-29 15:01:34 -0700 |
| commit | 255133f7a652796e4386f469c90f6d71b5755088 (patch) | |
| tree | f0203fbed33766f4a85adaf720b5a622b0d94753 /spaghetti-monster/fsm-ramping.c | |
| parent | enabled muggle mode again in all build targets, since it fits now (diff) | |
| download | anduril-255133f7a652796e4386f469c90f6d71b5755088.tar.gz anduril-255133f7a652796e4386f469c90f6d71b5755088.tar.bz2 anduril-255133f7a652796e4386f469c90f6d71b5755088.zip | |
adjusted BLF Lantern (Sofirn LT1) tint ramping power correction factor to match production units
(also made the factor configurable per build target)
Diffstat (limited to 'spaghetti-monster/fsm-ramping.c')
| -rw-r--r-- | spaghetti-monster/fsm-ramping.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/spaghetti-monster/fsm-ramping.c b/spaghetti-monster/fsm-ramping.c index 37c8073..8515885 100644 --- a/spaghetti-monster/fsm-ramping.c +++ b/spaghetti-monster/fsm-ramping.c @@ -72,6 +72,9 @@ void set_level(uint8_t level) { level --; #ifdef USE_TINT_RAMPING + #ifndef TINT_RAMPING_CORRECTION + #define TINT_RAMPING_CORRECTION 26 // 140% brightness at middle tint + #endif // calculate actual PWM levels based on a single-channel ramp // and a global tint value uint8_t brightness = pgm_read_byte(pwm1_levels + level); @@ -96,7 +99,7 @@ void set_level(uint8_t level) { // correction is only necessary when PWM is fast if (level > HALFSPEED_LEVEL) { base_PWM = brightness - + ((((uint16_t)brightness) * 26 / 64) * triangle_wave(mytint) / 255); + + ((((uint16_t)brightness) * TINT_RAMPING_CORRECTION / 64) * triangle_wave(mytint) / 255); } cool_PWM = (((uint16_t)mytint * (uint16_t)base_PWM) + 127) / 255; |
