diff options
Diffstat (limited to 'firmware/target/arm/tcc780x/cowond2/button-cowond2.c')
-rw-r--r-- | firmware/target/arm/tcc780x/cowond2/button-cowond2.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/firmware/target/arm/tcc780x/cowond2/button-cowond2.c b/firmware/target/arm/tcc780x/cowond2/button-cowond2.c index 290058b78a..6ff87dd49c 100644 --- a/firmware/target/arm/tcc780x/cowond2/button-cowond2.c +++ b/firmware/target/arm/tcc780x/cowond2/button-cowond2.c @@ -103,9 +103,22 @@ int button_read_device(int *data) { int btn = BUTTON_NONE; int adc; - *data = 0; + + static bool hold_button = false; + bool hold_button_old; - if (button_hold()) return BUTTON_NONE; + *data = 0; + + hold_button_old = hold_button; + hold_button = button_hold(); + +#ifndef BOOTLOADER + if (hold_button != hold_button_old) + backlight_hold_changed(hold_button); +#endif + + if (hold_button) + return BUTTON_NONE; if (GPIOB & 0x4) { |