summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorSteve Gotthardt <gotthardt@rockbox.org>2007-01-07 06:38:57 +0000
committerSteve Gotthardt <gotthardt@rockbox.org>2007-01-07 06:38:57 +0000
commitc07814fce15b8c48d38bcbf0d55b6800d9a91fd2 (patch)
tree3fe95402d3cb181750bc58675acb133c07a236ec /apps
parent11cdfc6abe733c3288d3d99bce78983ef91f6964 (diff)
downloadrockbox-c07814fce15b8c48d38bcbf0d55b6800d9a91fd2.tar.gz
rockbox-c07814fce15b8c48d38bcbf0d55b6800d9a91fd2.zip
Revamped the backlight state machine and added buttonlight controls. Go to the Info/debug menu and test out the new modes for buttonlights on the Gigabeat - ON, OFF, Faint, and flicker - flickers on touchpad and disk reads.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11935 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/debug_menu.c94
1 files changed, 94 insertions, 0 deletions
diff --git a/apps/debug_menu.c b/apps/debug_menu.c
index 4f2266ff47..3785374338 100644
--- a/apps/debug_menu.c
+++ b/apps/debug_menu.c
@@ -2089,6 +2089,98 @@ static bool dbg_lcd_power_off(void)
return false;
}
+#include "backlight-target.h"
+
+static bool dbg_buttonlights(void)
+{
+ unsigned short mode_changed = 1, mode = 0;
+ unsigned short which_led = BUTTONLIGHT_LED_ALL;
+
+ lcd_setmargins(0, 0);
+ for (;;)
+ {
+ int button;
+
+
+ if (mode_changed)
+ {
+ lcd_clear_display();
+ lcd_puts(0, 0, "Button light support");
+ lcd_puts(0, 1, "Press UP for mode change");
+ lcd_puts(0, 2, "Press DOWN for buttonlight selection");
+
+ switch (mode)
+ {
+ case 0:
+ lcd_puts(1, 3, "Off");
+ __buttonlight_mode(BUTTONLIGHT_OFF);
+ break;
+
+ case 1:
+ lcd_puts(1, 3, "On");
+ __buttonlight_mode(BUTTONLIGHT_ON);
+ break;
+
+ case 2:
+ lcd_puts(1, 3, "Faint");
+ __buttonlight_mode(BUTTONLIGHT_FAINT);
+ break;
+
+ case 3:
+ lcd_puts(1, 3, "Flicker");
+ __buttonlight_mode(BUTTONLIGHT_FLICKER);
+ break;
+
+ }
+ mode_changed = 0;
+ lcd_update();
+ }
+
+
+
+ /* does nothing unless in flicker mode */
+ /* the parameter sets the brightness */
+ __buttonlight_flicker(20);
+ button = get_action(CONTEXT_STD,HZ/5);
+ switch(button)
+ {
+ case ACTION_STD_PREV:
+ mode++;
+ if (mode > 3) mode = 0;
+ mode_changed = 1;
+ break;
+
+ case ACTION_STD_NEXT:
+ if (which_led == BUTTONLIGHT_LED_ALL)
+ {
+ which_led = BUTTONLIGHT_LED_MENU;
+ }
+ else
+ {
+ which_led = BUTTONLIGHT_LED_ALL;
+ }
+
+ __buttonlight_select(which_led);
+
+ break;
+
+
+ case ACTION_STD_OK:
+ case ACTION_STD_CANCEL:
+ action_signalscreenchange();
+ return false;
+
+ default:
+ sleep(HZ/10);
+ break;
+ }
+ }
+ return false;
+}
+
+
+
+
#endif
#if defined(HAVE_EEPROM) && !defined(HAVE_EEPROM_SETTINGS)
@@ -2141,6 +2233,8 @@ bool debug_menu(void)
static const struct menu_item items[] = {
#if defined(TOSHIBA_GIGABEAT_F) && !defined(SIMULATOR)
{ "LCD Power Off", dbg_lcd_power_off },
+ { "Button Light modes", dbg_buttonlights },
+
#endif
#if CONFIG_CPU == SH7034 || defined(CPU_COLDFIRE)
{ "Dump ROM contents", dbg_save_roms },