aboutsummaryrefslogtreecommitdiff
path: root/spaghetti-monster/fsm-ramping.c
diff options
context:
space:
mode:
authorSelene ToyKeeper2023-04-14 20:51:40 -0600
committerSelene ToyKeeper2023-04-14 20:51:40 -0600
commit6142f73db27cef29246291fd09227cc7bc3d4b15 (patch)
treef913ecf4d8f15b478c7ba4a2351d0a1abbaab10c /spaghetti-monster/fsm-ramping.c
parentLT1S Pro: after measuring, perhaps low aux mode is better after all (diff)
downloadanduril-6142f73db27cef29246291fd09227cc7bc3d4b15.tar.gz
anduril-6142f73db27cef29246291fd09227cc7bc3d4b15.tar.bz2
anduril-6142f73db27cef29246291fd09227cc7bc3d4b15.zip
LT1S: added thermal regulation
... and a bunch of gradual_tick functions ... and abstracted out some of the tint calculations ... and moved some UI settings into cfg.h
Diffstat (limited to 'spaghetti-monster/fsm-ramping.c')
-rw-r--r--spaghetti-monster/fsm-ramping.c33
1 files changed, 0 insertions, 33 deletions
diff --git a/spaghetti-monster/fsm-ramping.c b/spaghetti-monster/fsm-ramping.c
index 5096dfd..a55c74b 100644
--- a/spaghetti-monster/fsm-ramping.c
+++ b/spaghetti-monster/fsm-ramping.c
@@ -344,39 +344,6 @@ void gradual_tick() {
}
-// reduce repetition with macros
-// common code at the beginning of every gradual tick handler
-#define GRADUAL_TICK_SETUP() \
- uint8_t gt = gradual_target; \
- if (gt < actual_level) gt = actual_level - 1; \
- else if (gt > actual_level) gt = actual_level + 1; \
- gt --; \
- PWM_DATATYPE target;
-
-// tick the top layer of the stack
-#define GRADUAL_ADJUST_1CH(TABLE,PWM) \
- target = PWM_GET(TABLE, gt); \
- if (PWM < target) PWM ++; \
- else if (PWM > target) PWM --;
-
-// tick a base level of the stack
-// (with support for special DD FET behavior
-// like "low=0, high=255" --> "low=255, high=254")
-#define GRADUAL_ADJUST(TABLE,PWM,TOP) \
- target = PWM_GET(TABLE, gt); \
- if ((gt < actual_level) \
- && (PWM == 0) \
- && (target == TOP)) PWM = TOP; \
- else \
- if (PWM < target) PWM ++; \
- else if (PWM > target) PWM --;
-
-// do this when output exactly matches a ramp level
-#define GRADUAL_IS_ACTUAL() \
- uint8_t orig = gradual_target; \
- set_level(gt + 1); \
- gradual_target = orig;
-
#ifdef USE_GRADUAL_TICK_1CH
void gradual_tick_1ch() {
GRADUAL_TICK_SETUP();