Sub: remove manual control button debounce timer
This was a really long time for a debounce, and this code belongs to the program actually polling for input.
This commit is contained in:
parent
e648564e74
commit
e8326ef120
@ -59,10 +59,7 @@ void Sub::transform_manual_control_to_rc_override(int16_t x, int16_t y, int16_t
|
||||
int16_t throttleBase = 1500-500*throttleScale;
|
||||
|
||||
bool shift = false;
|
||||
static uint32_t buttonDebounce;
|
||||
|
||||
// Debouncing timer
|
||||
if (tnow_ms - buttonDebounce > 100) {
|
||||
// Detect if any shift button is pressed
|
||||
for (uint8_t i = 0 ; i < 16 ; i++) {
|
||||
if ((buttons & (1 << i)) && get_button(i)->function() == JSButton::button_function_t::k_shift) {
|
||||
@ -75,12 +72,10 @@ void Sub::transform_manual_control_to_rc_override(int16_t x, int16_t y, int16_t
|
||||
for (uint8_t i = 0 ; i < 16 ; i++) {
|
||||
if ((buttons & (1 << i))) {
|
||||
handle_jsbutton_press(i,shift,(buttons_prev & (1 << i)));
|
||||
buttonDebounce = tnow_ms;
|
||||
}
|
||||
}
|
||||
|
||||
buttons_prev = buttons;
|
||||
}
|
||||
|
||||
// Set channels to override
|
||||
if (!roll_pitch_flag) {
|
||||
|
Loading…
Reference in New Issue
Block a user