From 9765caab66ab628d763a5148efde80b3c3930b31 Mon Sep 17 00:00:00 2001 From: Selene ToyKeeper Date: Sat, 29 Apr 2023 01:19:42 -0600 Subject: Noctigon KR4: updated to use new channel system (also tweaked D4v2 build to match KR4 as much as possible) (also added Extended Simple UI to Hank's config) --- spaghetti-monster/fsm-ramping.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'spaghetti-monster/fsm-ramping.h') diff --git a/spaghetti-monster/fsm-ramping.h b/spaghetti-monster/fsm-ramping.h index 7b3722d..3003ecb 100644 --- a/spaghetti-monster/fsm-ramping.h +++ b/spaghetti-monster/fsm-ramping.h @@ -109,6 +109,13 @@ void gradual_tick(); if (PWM < TARGET) PWM ++; \ else if (PWM > TARGET) PWM --; +// tick to a specific value, except when immediate 0 to 255 is needed +#define GRADUAL_ADJUST_STACKED(TARGET,PWM,TOP) \ + if ( ((PWM == 0) && (TARGET == TOP)) \ + || ((PWM == TOP) && (TARGET == 0))) \ + PWM = TOP; \ + else GRADUAL_ADJUST_SIMPLE(TARGET,PWM) + // tick the top layer of the stack #define GRADUAL_ADJUST_1CH(TABLE,PWM) \ target = PWM_GET(TABLE, gt); \ -- cgit v1.2.3