From c77a7e0add4dec8e0bcefc6027282a24f0a30624 Mon Sep 17 00:00:00 2001 From: Selene ToyKeeper Date: Fri, 18 Sep 2020 23:02:02 -0600 Subject: added USE_2C_MAX_TURBO option from Tom E Makes "Ramp 2C" behave like Anduril1 instead of Anduril2. So it goes to full power turbo in the advanced UI, or ceiling in the simple UI. Otherwise, default Anduril2 behavior is for "Ramp 2C" to go to/from the ceiling level... unless already ramped up to that level in advanced mode, in which case it'll go to full turbo. --- spaghetti-monster/anduril/config-default.h | 7 +++++++ spaghetti-monster/anduril/ramp-mode.c | 16 ++++++++++++---- 2 files changed, 19 insertions(+), 4 deletions(-) (limited to 'spaghetti-monster') diff --git a/spaghetti-monster/anduril/config-default.h b/spaghetti-monster/anduril/config-default.h index 1c2083e..31fcbf4 100644 --- a/spaghetti-monster/anduril/config-default.h +++ b/spaghetti-monster/anduril/config-default.h @@ -66,6 +66,13 @@ #define BLINK_AT_RAMP_CEIL //#define BLINK_AT_STEPS // whenever a discrete ramp mode is passed in smooth mode +// Uncomment for Anduril1 "Ramp 2C" behavior: +// - Ramp 2C goes to turbo (advanced UI) or ceiling (simple UI), like in Anduril1 +// Or comment out to use Anduril2 behavior instead: +// - Ramp 2C goes to ceiling, unless already at ceiling or in simple UI. +// (Advanced UI ceiling 2C goes to turbo) +//#define USE_2C_MAX_TURBO + // make the ramps configurable by the user #define USE_RAMP_CONFIG diff --git a/spaghetti-monster/anduril/ramp-mode.c b/spaghetti-monster/anduril/ramp-mode.c index 6d177cc..944e0e2 100644 --- a/spaghetti-monster/anduril/ramp-mode.c +++ b/spaghetti-monster/anduril/ramp-mode.c @@ -104,12 +104,20 @@ uint8_t steady_state(Event event, uint16_t arg) { // full UI: to/from ceiling if mem < ceiling, // or to/from turbo if mem >= ceiling uint8_t turbo_level; - if ((memorized_level < mode_max) + #ifdef USE_2C_MAX_TURBO // 2C = turbo (Anduril1 behavior) #ifdef USE_SIMPLE_UI - || simple_ui_active + if (simple_ui_active) turbo_level = mode_max; + else #endif - ) { turbo_level = mode_max; } - else { turbo_level = MAX_LEVEL; } + turbo_level = MAX_LEVEL; + #else // 2C = ceiling, unless already at ceiling (Anduril2 default) + if ((memorized_level < mode_max) + #ifdef USE_SIMPLE_UI + || simple_ui_active + #endif + ) { turbo_level = mode_max; } + else { turbo_level = MAX_LEVEL; } + #endif if (actual_level < turbo_level) { // true turbo, not the mode-specific ceiling -- cgit v1.2.3