diff options
Diffstat (limited to 'firmware/drivers')
-rw-r--r-- | firmware/drivers/button.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/firmware/drivers/button.c b/firmware/drivers/button.c index 3286760aa6..6513fb4a3a 100644 --- a/firmware/drivers/button.c +++ b/firmware/drivers/button.c @@ -1212,11 +1212,29 @@ static int button_read(void) btn |= BUTTON_ON; #elif (CONFIG_KEYPAD == IPOD_4G_PAD) + static bool hold_button = false; + + /* light handling */ + if (hold_button && !button_hold()) + { + backlight_on(); + } + hold_button = button_hold(); + (void)data; /* The int_btn variable is set in the button interrupt handler */ btn = int_btn; #elif (CONFIG_KEYPAD == IPOD_3G_PAD) + static bool hold_button = false; + + /* light handling */ + if (hold_button && !button_hold()) + { + backlight_on(); + } + hold_button = button_hold(); + (void)data; btn = ipod_3g_button_read(); @@ -1224,6 +1242,13 @@ static int button_read(void) static bool hold_button = false; static bool remote_hold_button = false; + /* light handling */ + if (hold_button && !button_hold()) + { + backlight_on(); + } + /* TODO: add light handling for the remote */ + hold_button = button_hold(); remote_hold_button = remote_button_hold(); |