From 6415a13625eadb2793b888c3fa2c92e115b9a335 Mon Sep 17 00:00:00 2001 From: Selene ToyKeeper Date: Tue, 30 May 2023 06:12:18 -0600 Subject: gradual adjustments: handle 0-to-255 in one step on the way up too, not just down --- spaghetti-monster/fsm-ramping.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spaghetti-monster/fsm-ramping.h b/spaghetti-monster/fsm-ramping.h index 8d5ed27..36cf89c 100644 --- a/spaghetti-monster/fsm-ramping.h +++ b/spaghetti-monster/fsm-ramping.h @@ -115,7 +115,7 @@ void gradual_tick(); #define GRADUAL_ADJUST_STACKED(TARGET,PWM,TOP) \ if ( ((PWM == 0) && (TARGET == TOP)) \ || ((PWM == TOP) && (TARGET == 0))) \ - PWM = TOP; \ + PWM = TARGET; \ else GRADUAL_ADJUST_SIMPLE(TARGET,PWM) // tick the top layer of the stack -- cgit v1.2.3