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 | |
| 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')
| -rw-r--r-- | spaghetti-monster/anduril/cfg-blf-lantern.h | 4 | ||||
| -rw-r--r-- | spaghetti-monster/fsm-ramping.c | 5 |
2 files changed, 8 insertions, 1 deletions
diff --git a/spaghetti-monster/anduril/cfg-blf-lantern.h b/spaghetti-monster/anduril/cfg-blf-lantern.h index bdcd893..35f25f1 100644 --- a/spaghetti-monster/anduril/cfg-blf-lantern.h +++ b/spaghetti-monster/anduril/cfg-blf-lantern.h @@ -27,6 +27,10 @@ // (one channel for warm emitters, one channel for cold) // so enable a special ramping mode which changes tint instead of brightness #define USE_TINT_RAMPING +// how much to increase total brightness at middle tint +// (0 = 100% brightness, 64 = 200% brightness) +//#define TINT_RAMPING_CORRECTION 26 // prototype, 140% +#define TINT_RAMPING_CORRECTION 6 // production model, 109% #ifdef RAMP_LENGTH #undef RAMP_LENGTH 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; |
