From 26804a2c198266d79ee5597859089cb1954e3974 Mon Sep 17 00:00:00 2001 From: SammysHP Date: Tue, 8 Jan 2019 19:42:26 +0100 Subject: [PATCH] Fix #4: Reverse levels if start high is enabled --- rampinglight.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rampinglight.c b/rampinglight.c index 69bb2e2..3fff24d 100644 --- a/rampinglight.c +++ b/rampinglight.c @@ -180,7 +180,7 @@ void set_level(const uint8_t level) { disable_output(); } else { if (options.fixed_mode) { - set_pwm(fixed_values[level - 1]); + set_pwm(fixed_values[options.start_high ? FIXED_SIZE - level : level - 1]); } else { set_pwm(ramp_values[level - 1]); } @@ -405,8 +405,8 @@ int main(void) { if (options.mode_memory && output_eeprom) { output = output_eeprom; } else { - if (options.start_high) { - output = options.fixed_mode ? FIXED_SIZE : RAMP_SIZE; + if (!options.fixed_mode && options.start_high) { + output = RAMP_SIZE; } else { output = 1; } -- GitLab