From 274b615fc35b0c6256fc647422e98f721a06e8ce Mon Sep 17 00:00:00 2001 From: Selene ToyKeeper Date: Mon, 13 Dec 2021 15:54:30 -0700 Subject: fixed bug where tint-ramping could end up 1 brightness ramp step different than it started --- spaghetti-monster/anduril/tint-ramping.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spaghetti-monster/anduril/tint-ramping.c b/spaghetti-monster/anduril/tint-ramping.c index 6cc0616..d270d9d 100644 --- a/spaghetti-monster/anduril/tint-ramping.c +++ b/spaghetti-monster/anduril/tint-ramping.c @@ -22,7 +22,6 @@ #include "tint-ramping.h" - uint8_t tint_ramping_state(Event event, uint16_t arg) { static int8_t tint_ramp_direction = 1; static uint8_t prev_tint = 0; @@ -92,6 +91,9 @@ uint8_t tint_ramping_state(Event event, uint16_t arg) { else if (tint >= 254) tint_ramp_direction = -1; // remember tint after battery change save_config(); + // bug?: for some reason, brightness can seemingly change + // from 1/150 to 2/150 without this next line... not sure why + set_level(actual_level); return EVENT_HANDLED; } -- cgit v1.2.3