aboutsummaryrefslogtreecommitdiff
path: root/spaghetti-monster/fsm-ramping.h
diff options
context:
space:
mode:
authorSelene ToyKeeper2023-04-29 01:19:42 -0600
committerSelene ToyKeeper2023-04-29 01:19:42 -0600
commit9765caab66ab628d763a5148efde80b3c3930b31 (patch)
tree5ec21fdf9a521b0d72820540e81263efc3028da3 /spaghetti-monster/fsm-ramping.h
parentjust a todo note for later (diff)
downloadanduril-9765caab66ab628d763a5148efde80b3c3930b31.tar.gz
anduril-9765caab66ab628d763a5148efde80b3c3930b31.tar.bz2
anduril-9765caab66ab628d763a5148efde80b3c3930b31.zip
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)
Diffstat (limited to 'spaghetti-monster/fsm-ramping.h')
-rw-r--r--spaghetti-monster/fsm-ramping.h7
1 files changed, 7 insertions, 0 deletions
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); \