diff options
Diffstat (limited to 'firmware/drivers/button.c')
-rw-r--r-- | firmware/drivers/button.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/firmware/drivers/button.c b/firmware/drivers/button.c index dbdb171bf2..9e649ead5a 100644 --- a/firmware/drivers/button.c +++ b/firmware/drivers/button.c | |||
@@ -52,6 +52,9 @@ static long last_read; /* Last button status, for debouncing/filtering */ | |||
52 | #ifdef HAVE_LCD_BITMAP | 52 | #ifdef HAVE_LCD_BITMAP |
53 | static bool flipped; /* buttons can be flipped to match the LCD flip */ | 53 | static bool flipped; /* buttons can be flipped to match the LCD flip */ |
54 | #endif | 54 | #endif |
55 | #ifdef CONFIG_BACKLIGHT | ||
56 | static bool filter_first_keypress; | ||
57 | #endif | ||
55 | 58 | ||
56 | /* how often we check to see if a button is pressed */ | 59 | /* how often we check to see if a button is pressed */ |
57 | #define POLL_FREQUENCY HZ/100 | 60 | #define POLL_FREQUENCY HZ/100 |
@@ -504,7 +507,10 @@ static void button_tick(void) | |||
504 | } | 507 | } |
505 | else | 508 | else |
506 | { | 509 | { |
507 | queue_post(&button_queue, btn, NULL); | 510 | #ifdef CONFIG_BACKLIGHT |
511 | if ( !filter_first_keypress || is_backlight_on()) | ||
512 | #endif | ||
513 | queue_post(&button_queue, btn, NULL); | ||
508 | post = false; | 514 | post = false; |
509 | } | 515 | } |
510 | #ifdef HAVE_REMOTE_LCD | 516 | #ifdef HAVE_REMOTE_LCD |
@@ -629,6 +635,9 @@ void button_init(void) | |||
629 | #ifdef HAVE_LCD_BITMAP | 635 | #ifdef HAVE_LCD_BITMAP |
630 | flipped = false; | 636 | flipped = false; |
631 | #endif | 637 | #endif |
638 | #ifdef CONFIG_BACKLIGHT | ||
639 | filter_first_keypress = false; | ||
640 | #endif | ||
632 | } | 641 | } |
633 | 642 | ||
634 | #ifdef HAVE_LCD_BITMAP /* only bitmap displays can be flipped */ | 643 | #ifdef HAVE_LCD_BITMAP /* only bitmap displays can be flipped */ |
@@ -687,6 +696,13 @@ void button_set_flip(bool flip) | |||
687 | } | 696 | } |
688 | #endif /* HAVE_LCD_BITMAP */ | 697 | #endif /* HAVE_LCD_BITMAP */ |
689 | 698 | ||
699 | #ifdef CONFIG_BACKLIGHT | ||
700 | void set_backlight_filter_keypress(bool value) | ||
701 | { | ||
702 | filter_first_keypress = value; | ||
703 | } | ||
704 | #endif | ||
705 | |||
690 | /* | 706 | /* |
691 | Archos hardware button hookup | 707 | Archos hardware button hookup |
692 | ============================= | 708 | ============================= |