diff options
| author | Selene ToyKeeper | 2021-05-23 17:14:20 -0600 |
|---|---|---|
| committer | Selene ToyKeeper | 2021-05-23 17:14:20 -0600 |
| commit | 6307931300db00a46a5cc8e2c4d835cc6bcb8f62 (patch) | |
| tree | 014e873efc1a7aa8d7fb32d5c44f43c925823b15 /spaghetti-monster | |
| parent | oops, somehow I forgot to add this earlier... Hank's UI preferences (applies... (diff) | |
| download | anduril-6307931300db00a46a5cc8e2c4d835cc6bcb8f62.tar.gz anduril-6307931300db00a46a5cc8e2c4d835cc6bcb8f62.tar.bz2 anduril-6307931300db00a46a5cc8e2c4d835cc6bcb8f62.zip | |
added missing ifdefs for compiling without USE_SIMPLE_UI
(compiles now, but isn't tested on hardware)
Diffstat (limited to 'spaghetti-monster')
| -rw-r--r-- | spaghetti-monster/anduril/ramp-mode.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/spaghetti-monster/anduril/ramp-mode.c b/spaghetti-monster/anduril/ramp-mode.c index b0a86a0..0baffde 100644 --- a/spaghetti-monster/anduril/ramp-mode.c +++ b/spaghetti-monster/anduril/ramp-mode.c @@ -425,7 +425,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) { @@ -480,7 +482,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; @@ -508,7 +514,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]; |
