aboutsummaryrefslogtreecommitdiff
path: root/spaghetti-monster
diff options
context:
space:
mode:
authorGabriel Hart2021-06-06 12:37:17 -0500
committerGabriel Hart2021-06-06 12:37:17 -0500
commit194bddf15999455647be5f8ebe28d81031b3dec5 (patch)
treeb072bcc7e75ddfbb5efaa9ee645c9e3fe1a56d72 /spaghetti-monster
parentAdd config option to allow 3C smooth/stepped selection in Simple UI, add that... (diff)
parentadded missing ifdefs for compiling without USE_SIMPLE_UI (diff)
downloadanduril-194bddf15999455647be5f8ebe28d81031b3dec5.tar.gz
anduril-194bddf15999455647be5f8ebe28d81031b3dec5.tar.bz2
anduril-194bddf15999455647be5f8ebe28d81031b3dec5.zip
Updating from TKs recent change (fix for compile without USE_SIMPLE_UI)
Diffstat (limited to 'spaghetti-monster')
-rw-r--r--spaghetti-monster/anduril/ramp-mode.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/spaghetti-monster/anduril/ramp-mode.c b/spaghetti-monster/anduril/ramp-mode.c
index 29a2de2..968b304 100644
--- a/spaghetti-monster/anduril/ramp-mode.c
+++ b/spaghetti-monster/anduril/ramp-mode.c
@@ -433,7 +433,9 @@ void ramp_config_save(uint8_t step, uint8_t value) {
// 0 = smooth ramp, 1 = stepped ramp, 2 = simple UI's ramp
uint8_t style = ramp_style;
+ #ifdef USE_SIMPLE_UI
if (current_state == simple_ui_config_state) style = 2;
+ #endif
// save adjusted value to the correct slot
if (value) {
@@ -488,7 +490,11 @@ uint8_t nearest_level(int16_t target) {
// bounds check
uint8_t mode_min = ramp_floor;
uint8_t mode_max = ramp_ceil;
- uint8_t num_steps = ramp_stepss[1 + simple_ui_active];
+ uint8_t num_steps = ramp_stepss[1
+ #ifdef USE_SIMPLE_UI
+ + simple_ui_active
+ #endif
+ ];
// special case for 1-step ramp... use halfway point between floor and ceiling
if (ramp_style && (1 == num_steps)) {
uint8_t mid = (mode_max + mode_min) >> 1;
@@ -516,7 +522,9 @@ uint8_t nearest_level(int16_t target) {
// ensure ramp globals are correct
void ramp_update_config() {
uint8_t which = ramp_style;
+ #ifdef USE_SIMPLE_UI
if (simple_ui_active) { which = 2; }
+ #endif
ramp_floor = ramp_floors[which];
ramp_ceil = ramp_ceils[which];