From d34d0e7acb1f1e49d21af7cf1c9e08161ce95dd4 Mon Sep 17 00:00:00 2001 From: Selene ToyKeeper Date: Sun, 17 Sep 2023 04:37:25 -0600 Subject: fixed builds which weren't using set_level_zero() yet... - emisar-d4 - emisar-d4v2 - emisar-d4v2-nofet - emisar-d4sv2 - emisar-2ch - emisar-2ch-fet - noctigon-dm11-boost - noctigon-k1 - noctigon-kr4 - noctigon-kr4-nofet - sofirn-lt1s-pro ... and removed old build targets for d4sv2-tintramp, because it was replaced by emisar-2ch a while ago. --- hwdef-emisar-2ch.c | 26 ++++++-------------------- 1 file changed, 6 insertions(+), 20 deletions(-) (limited to 'hwdef-emisar-2ch.c') diff --git a/hwdef-emisar-2ch.c b/hwdef-emisar-2ch.c index 7955cf6..31d27af 100644 --- a/hwdef-emisar-2ch.c +++ b/hwdef-emisar-2ch.c @@ -7,6 +7,8 @@ #include "chan-rgbaux.c" +void set_level_zero(); + void set_level_ch1(uint8_t level); void set_level_ch2(uint8_t level); void set_level_both(uint8_t level); @@ -90,41 +92,29 @@ void set_pwms(uint16_t ch1_pwm, uint16_t ch2_pwm, uint16_t top) { if (! was_on) PWM_CNT = 0; } -void set_level_ch1(uint8_t level) { - if (0 == level) - return set_pwms(0, 0, PWM_TOP_INIT); +void set_level_zero() { + return set_pwms(0, 0, PWM_TOP_INIT); +} - level --; +void set_level_ch1(uint8_t level) { uint16_t pwm = PWM_GET(pwm1_levels, level); uint16_t top = PWM_GET(pwm_tops, level); set_pwms(pwm, 0, top); } void set_level_ch2(uint8_t level) { - if (0 == level) - return set_pwms(0, 0, PWM_TOP_INIT); - - level --; uint16_t pwm = PWM_GET(pwm1_levels, level); uint16_t top = PWM_GET(pwm_tops, level); set_pwms(0, pwm, top); } void set_level_both(uint8_t level) { - if (0 == level) - return set_pwms(0, 0, PWM_TOP_INIT); - - level --; uint16_t pwm = PWM_GET(pwm1_levels, level); uint16_t top = PWM_GET(pwm_tops, level); set_pwms(pwm, pwm, top); } void set_level_blend(uint8_t level) { - if (0 == level) - return set_pwms(0, 0, PWM_TOP_INIT); - - level --; PWM_DATATYPE ch1_pwm, ch2_pwm; PWM_DATATYPE brightness = PWM_GET(pwm1_levels, level); PWM_DATATYPE top = PWM_GET(pwm_tops, level); @@ -136,10 +126,6 @@ void set_level_blend(uint8_t level) { } void set_level_auto(uint8_t level) { - if (0 == level) - return set_pwms(0, 0, PWM_TOP_INIT); - - level --; PWM_DATATYPE ch1_pwm, ch2_pwm; PWM_DATATYPE brightness = PWM_GET(pwm1_levels, level); PWM_DATATYPE top = PWM_GET(pwm_tops, level); -- cgit v1.2.3