diff options
author | Steve Gotthardt <gotthardt@rockbox.org> | 2007-01-08 08:53:36 +0000 |
---|---|---|
committer | Steve Gotthardt <gotthardt@rockbox.org> | 2007-01-08 08:53:36 +0000 |
commit | 93b047fffec9b6d3b5ef1697c3034caa83944182 (patch) | |
tree | 430b4482bd77c6d860a14048b25310db5aa8943d /apps | |
parent | 2446b22db971668f8d6ba5cb2361aabbda286da1 (diff) | |
download | rockbox-93b047fffec9b6d3b5ef1697c3034caa83944182.tar.gz rockbox-93b047fffec9b6d3b5ef1697c3034caa83944182.zip |
Updated buttonlights for the Gigabeat port. Added LCD controller off and on for extra power savings - thanks to Greg White. Incorporated feedback from Gary Allen. Added 'battery charging' mode: shows leds during charging. Added 'follow' mode that turns off leds when backlight goes off. Flicker mode and new solid mode only show during disk access. Access settings from Info/debug menu for now.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11945 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r-- | apps/debug_menu.c | 41 |
1 files changed, 27 insertions, 14 deletions
diff --git a/apps/debug_menu.c b/apps/debug_menu.c index 3785374338..083dddbd74 100644 --- a/apps/debug_menu.c +++ b/apps/debug_menu.c | |||
@@ -2094,14 +2094,14 @@ static bool dbg_lcd_power_off(void) | |||
2094 | static bool dbg_buttonlights(void) | 2094 | static bool dbg_buttonlights(void) |
2095 | { | 2095 | { |
2096 | unsigned short mode_changed = 1, mode = 0; | 2096 | unsigned short mode_changed = 1, mode = 0; |
2097 | unsigned short which_led = BUTTONLIGHT_LED_ALL; | 2097 | enum buttonlight_selection which_led = BUTTONLIGHT_LED_ALL; |
2098 | unsigned short brightness = DEFAULT_BRIGHTNESS_SETTING; | ||
2098 | 2099 | ||
2099 | lcd_setmargins(0, 0); | 2100 | lcd_setmargins(0, 0); |
2100 | for (;;) | 2101 | for (;;) |
2101 | { | 2102 | { |
2102 | int button; | 2103 | int button; |
2103 | 2104 | ||
2104 | |||
2105 | if (mode_changed) | 2105 | if (mode_changed) |
2106 | { | 2106 | { |
2107 | lcd_clear_display(); | 2107 | lcd_clear_display(); |
@@ -2113,22 +2113,37 @@ static bool dbg_buttonlights(void) | |||
2113 | { | 2113 | { |
2114 | case 0: | 2114 | case 0: |
2115 | lcd_puts(1, 3, "Off"); | 2115 | lcd_puts(1, 3, "Off"); |
2116 | __buttonlight_mode(BUTTONLIGHT_OFF); | 2116 | __buttonlight_mode(BUTTONLIGHT_OFF, which_led, brightness); |
2117 | break; | 2117 | break; |
2118 | 2118 | ||
2119 | case 1: | 2119 | case 1: |
2120 | lcd_puts(1, 3, "On"); | 2120 | lcd_puts(1, 3, "On - Set to brightness"); |
2121 | __buttonlight_mode(BUTTONLIGHT_ON); | 2121 | __buttonlight_mode(BUTTONLIGHT_ON, which_led, brightness); |
2122 | break; | 2122 | break; |
2123 | 2123 | ||
2124 | case 2: | 2124 | case 2: |
2125 | lcd_puts(1, 3, "Faint"); | 2125 | lcd_puts(1, 3, "Faint - Always on at lowest brightness"); |
2126 | __buttonlight_mode(BUTTONLIGHT_FAINT); | 2126 | __buttonlight_mode(BUTTONLIGHT_FAINT, which_led, brightness); |
2127 | break; | 2127 | break; |
2128 | 2128 | ||
2129 | case 3: | 2129 | case 3: |
2130 | lcd_puts(1, 3, "Flicker"); | 2130 | lcd_puts(1, 3, "Flicker on disk access"); |
2131 | __buttonlight_mode(BUTTONLIGHT_FLICKER); | 2131 | __buttonlight_mode(BUTTONLIGHT_FLICKER, which_led, brightness); |
2132 | break; | ||
2133 | |||
2134 | case 4: | ||
2135 | lcd_puts(1, 3, "Solid on disk access"); | ||
2136 | __buttonlight_mode(BUTTONLIGHT_SIGNAL, which_led, brightness); | ||
2137 | break; | ||
2138 | |||
2139 | case 5: | ||
2140 | lcd_puts(1, 3, "Follows backlight"); | ||
2141 | __buttonlight_mode(BUTTONLIGHT_FOLLOW, which_led, brightness); | ||
2142 | break; | ||
2143 | |||
2144 | case 6: | ||
2145 | lcd_puts(1, 3, "Shows 'battery charging'"); | ||
2146 | __buttonlight_mode(BUTTONLIGHT_CHARGING, which_led, brightness); | ||
2132 | break; | 2147 | break; |
2133 | 2148 | ||
2134 | } | 2149 | } |
@@ -2140,13 +2155,12 @@ static bool dbg_buttonlights(void) | |||
2140 | 2155 | ||
2141 | /* does nothing unless in flicker mode */ | 2156 | /* does nothing unless in flicker mode */ |
2142 | /* the parameter sets the brightness */ | 2157 | /* the parameter sets the brightness */ |
2143 | __buttonlight_flicker(20); | 2158 | __buttonlight_trigger(); |
2144 | button = get_action(CONTEXT_STD,HZ/5); | 2159 | button = get_action(CONTEXT_STD,HZ/5); |
2145 | switch(button) | 2160 | switch(button) |
2146 | { | 2161 | { |
2147 | case ACTION_STD_PREV: | 2162 | case ACTION_STD_PREV: |
2148 | mode++; | 2163 | if (++mode > 6) mode = 0; |
2149 | if (mode > 3) mode = 0; | ||
2150 | mode_changed = 1; | 2164 | mode_changed = 1; |
2151 | break; | 2165 | break; |
2152 | 2166 | ||
@@ -2159,8 +2173,7 @@ static bool dbg_buttonlights(void) | |||
2159 | { | 2173 | { |
2160 | which_led = BUTTONLIGHT_LED_ALL; | 2174 | which_led = BUTTONLIGHT_LED_ALL; |
2161 | } | 2175 | } |
2162 | 2176 | mode_changed = 1; | |
2163 | __buttonlight_select(which_led); | ||
2164 | 2177 | ||
2165 | break; | 2178 | break; |
2166 | 2179 | ||