diff options
author | Björn Stenberg <bjorn@haxx.se> | 2006-03-24 13:47:24 +0000 |
---|---|---|
committer | Björn Stenberg <bjorn@haxx.se> | 2006-03-24 13:47:24 +0000 |
commit | da5fb18bca90ec09b99f28186787d10378a92109 (patch) | |
tree | 606690b331740a1a1f022cb8f5fce71fa06ddd10 /firmware/drivers | |
parent | 86f1e2ead283d86f6896ca0f98c0b711da5e2cfe (diff) | |
download | rockbox-da5fb18bca90ec09b99f28186787d10378a92109.tar.gz rockbox-da5fb18bca90ec09b99f28186787d10378a92109.zip |
New option: First keypress enables backlight only. Patch #2920 by Nicolas Pennequin.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9228 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/drivers')
-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 | ============================= |