Revert "Additional debounce control parameters for rotary encoder settings (f…" (#2846)

This reverts commit bf18851b6b.
This commit is contained in:
gullradriel 2025-10-28 10:34:14 +01:00 committed by GitHub
parent 3b57672dda
commit 0f9d9e589d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 64 additions and 144 deletions

View file

@ -234,11 +234,6 @@ struct data_t {
uint16_t UNUSED : 4;
// Encoder debounce parameters for noisy hardware
uint8_t encoder_consecutive_hits; // Number of consecutive same-direction hits required (1-10)
uint8_t encoder_cooldown_ms; // Cooldown period in ms after movement (0-255ms)
uint8_t encoder_debounce_ms; // Debounce stability window in ms (4-32ms)
// Headphone volume in centibels.
int16_t headphone_volume_cb;
@ -309,10 +304,6 @@ struct data_t {
encoder_rate_multiplier(1),
UNUSED(0),
encoder_consecutive_hits(3), // Default: 3 hits (Version 1 setting)
encoder_cooldown_ms(20), // Default: 20ms (Version 1 setting)
encoder_debounce_ms(16), // Default: 16ms stability window
headphone_volume_cb(-600),
misc_config(),
ui_config2(),
@ -1130,38 +1121,6 @@ void set_encoder_dial_direction(bool v) {
data->encoder_dial_direction = v;
}
// Encoder debounce parameters for noisy hardware
uint8_t encoder_consecutive_hits() {
uint8_t v = data->encoder_consecutive_hits;
if (v == 0) v = 3; // default to 3 if not set
if (v > 10) v = 10; // cap at 10
return v;
}
void set_encoder_consecutive_hits(uint8_t v) {
if (v < 1) v = 1; // minimum 1
if (v > 10) v = 10; // maximum 10
data->encoder_consecutive_hits = v;
}
uint8_t encoder_cooldown_ms() {
return data->encoder_cooldown_ms;
}
void set_encoder_cooldown_ms(uint8_t v) {
data->encoder_cooldown_ms = v;
}
uint8_t encoder_debounce_ms() {
uint8_t v = data->encoder_debounce_ms;
if (v < 4) v = 16; // default to 16ms if not set or too low
if (v > 32) v = 32; // cap at 32ms
return v;
}
void set_encoder_debounce_ms(uint8_t v) {
if (v < 4) v = 4; // minimum 4ms
if (v > 32) v = 32; // maximum 32ms
data->encoder_debounce_ms = v;
}
// Recovery mode magic value storage
static data_t* data_direct_access = reinterpret_cast<data_t*>(memory::map::backup_ram.base());