diff options
Diffstat (limited to 'apps/debug_menu.c')
-rw-r--r-- | apps/debug_menu.c | 160 |
1 files changed, 30 insertions, 130 deletions
diff --git a/apps/debug_menu.c b/apps/debug_menu.c index 0176b7405d..9e654b1d45 100644 --- a/apps/debug_menu.c +++ b/apps/debug_menu.c | |||
@@ -1132,7 +1132,7 @@ bool dbg_ports(void) | |||
1132 | return false; | 1132 | return false; |
1133 | } | 1133 | } |
1134 | #elif CONFIG_CPU == S3C2440 | 1134 | #elif CONFIG_CPU == S3C2440 |
1135 | char buf[128]; | 1135 | char buf[50]; |
1136 | int line; | 1136 | int line; |
1137 | 1137 | ||
1138 | lcd_setmargins(0, 0); | 1138 | lcd_setmargins(0, 0); |
@@ -1142,28 +1142,36 @@ bool dbg_ports(void) | |||
1142 | while(1) | 1142 | while(1) |
1143 | { | 1143 | { |
1144 | line = 0; | 1144 | line = 0; |
1145 | snprintf(buf, sizeof(buf), "GPACON: %08x GPBCON: %08x", GPACON, GPBCON); lcd_puts(0, line++, buf); | 1145 | snprintf(buf, sizeof(buf), "[Ports and Registers]"); lcd_puts(0, line++, buf); |
1146 | snprintf(buf, sizeof(buf), "GPADAT: %08x GPBDAT: %08x", GPADAT, GPBDAT); lcd_puts(0, line++, buf); | 1146 | |
1147 | snprintf(buf, sizeof(buf), "GPAUP: %08x GPBUP: %08x", 0, GPBUP); lcd_puts(0, line++, buf); | 1147 | snprintf(buf, sizeof(buf), "GPACON: %08x GPBCON: %08x", GPACON, GPBCON); lcd_puts(0, line++, buf); |
1148 | snprintf(buf, sizeof(buf), "GPCCON: %08x GPDCON: %08x", GPCCON, GPDCON); lcd_puts(0, line++, buf); | 1148 | snprintf(buf, sizeof(buf), "GPADAT: %08x GPBDAT: %08x", GPADAT, GPBDAT); lcd_puts(0, line++, buf); |
1149 | snprintf(buf, sizeof(buf), "GPCDAT: %08x GPDDAT: %08x", GPCDAT, GPDDAT); lcd_puts(0, line++, buf); | 1149 | snprintf(buf, sizeof(buf), "GPAUP: %08x GPBUP: %08x", 0, GPBUP); lcd_puts(0, line++, buf); |
1150 | snprintf(buf, sizeof(buf), "GPCUP: %08x GPDUP: %08x", GPCUP, GPDUP); lcd_puts(0, line++, buf); | 1150 | snprintf(buf, sizeof(buf), "GPCCON: %08x GPDCON: %08x", GPCCON, GPDCON); lcd_puts(0, line++, buf); |
1151 | 1151 | snprintf(buf, sizeof(buf), "GPCDAT: %08x GPDDAT: %08x", GPCDAT, GPDDAT); lcd_puts(0, line++, buf); | |
1152 | snprintf(buf, sizeof(buf), "GPCCON: %08x GPDCON: %08x", GPCCON, GPDCON); lcd_puts(0, line++, buf); | 1152 | snprintf(buf, sizeof(buf), "GPCUP: %08x GPDUP: %08x", GPCUP, GPDUP); lcd_puts(0, line++, buf); |
1153 | snprintf(buf, sizeof(buf), "GPCDAT: %08x GPDDAT: %08x", GPCDAT, GPDDAT); lcd_puts(0, line++, buf); | 1153 | |
1154 | snprintf(buf, sizeof(buf), "GPCUP: %08x GPDUP: %08x", GPCUP, GPDUP); lcd_puts(0, line++, buf); | 1154 | snprintf(buf, sizeof(buf), "GPCCON: %08x GPDCON: %08x", GPCCON, GPDCON); lcd_puts(0, line++, buf); |
1155 | 1155 | snprintf(buf, sizeof(buf), "GPCDAT: %08x GPDDAT: %08x", GPCDAT, GPDDAT); lcd_puts(0, line++, buf); | |
1156 | snprintf(buf, sizeof(buf), "GPECON: %08x GPFCON: %08x", GPECON, GPFCON); lcd_puts(0, line++, buf); | 1156 | snprintf(buf, sizeof(buf), "GPCUP: %08x GPDUP: %08x", GPCUP, GPDUP); lcd_puts(0, line++, buf); |
1157 | snprintf(buf, sizeof(buf), "GPEDAT: %08x GPFDAT: %08x", GPEDAT, GPFDAT); lcd_puts(0, line++, buf); | 1157 | |
1158 | snprintf(buf, sizeof(buf), "GPEUP: %08x GPFUP: %08x", GPEUP, GPFUP); lcd_puts(0, line++, buf); | 1158 | snprintf(buf, sizeof(buf), "GPECON: %08x GPFCON: %08x", GPECON, GPFCON); lcd_puts(0, line++, buf); |
1159 | 1159 | snprintf(buf, sizeof(buf), "GPEDAT: %08x GPFDAT: %08x", GPEDAT, GPFDAT); lcd_puts(0, line++, buf); | |
1160 | snprintf(buf, sizeof(buf), "GPGCON: %08x GPHCON: %08x", GPGCON, GPHCON); lcd_puts(0, line++, buf); | 1160 | snprintf(buf, sizeof(buf), "GPEUP: %08x GPFUP: %08x", GPEUP, GPFUP); lcd_puts(0, line++, buf); |
1161 | snprintf(buf, sizeof(buf), "GPGDAT: %08x GPHDAT: %08x", GPGDAT, GPHDAT); lcd_puts(0, line++, buf); | 1161 | |
1162 | snprintf(buf, sizeof(buf), "GPGUP: %08x GPHUP: %08x", GPGUP, GPHUP); lcd_puts(0, line++, buf); | 1162 | snprintf(buf, sizeof(buf), "GPGCON: %08x GPHCON: %08x", GPGCON, GPHCON); lcd_puts(0, line++, buf); |
1163 | snprintf(buf, sizeof(buf), "GPGDAT: %08x GPHDAT: %08x", GPGDAT, GPHDAT); lcd_puts(0, line++, buf); | ||
1164 | snprintf(buf, sizeof(buf), "GPGUP: %08x GPHUP: %08x", GPGUP, GPHUP); lcd_puts(0, line++, buf); | ||
1165 | |||
1166 | snprintf(buf, sizeof(buf), "GPJCON: %08x", GPJCON); lcd_puts(0, line++, buf); | ||
1167 | snprintf(buf, sizeof(buf), "GPJDAT: %08x", GPJDAT); lcd_puts(0, line++, buf); | ||
1168 | snprintf(buf, sizeof(buf), "GPJUP: %08x", GPJUP); lcd_puts(0, line++, buf); | ||
1163 | 1169 | ||
1164 | snprintf(buf, sizeof(buf), "GPJCON: %08x", GPJCON); lcd_puts(0, line++, buf); | 1170 | line++; |
1165 | snprintf(buf, sizeof(buf), "GPJDAT: %08x", GPJDAT); lcd_puts(0, line++, buf); | 1171 | |
1166 | snprintf(buf, sizeof(buf), "GPJUP: %08x", GPJUP); lcd_puts(0, line++, buf); | 1172 | snprintf(buf, sizeof(buf), "SRCPND: %08x INTMOD: %08x", SRCPND, INTMOD); lcd_puts(0, line++, buf); |
1173 | snprintf(buf, sizeof(buf), "INTMSK: %08x INTPND: %08x", INTMSK, INTPND); lcd_puts(0, line++, buf); | ||
1174 | snprintf(buf, sizeof(buf), "CLKCON: %08x CLKSLOW: %08x", CLKCON, CLKSLOW); lcd_puts(0, line++, buf); | ||
1167 | lcd_update(); | 1175 | lcd_update(); |
1168 | if (button_get_w_tmo(HZ/10) == (DEBUG_CANCEL|BUTTON_REL)) | 1176 | if (button_get_w_tmo(HZ/10) == (DEBUG_CANCEL|BUTTON_REL)) |
1169 | return false; | 1177 | return false; |
@@ -2093,112 +2101,6 @@ static bool dbg_lcd_power_off(void) | |||
2093 | } | 2101 | } |
2094 | return false; | 2102 | return false; |
2095 | } | 2103 | } |
2096 | |||
2097 | #include "backlight-target.h" | ||
2098 | |||
2099 | static bool dbg_buttonlights(void) | ||
2100 | { | ||
2101 | unsigned short mode_changed = 1, mode = 0; | ||
2102 | enum buttonlight_selection which_led = BUTTONLIGHT_LED_ALL; | ||
2103 | unsigned short brightness = DEFAULT_BRIGHTNESS_SETTING; | ||
2104 | |||
2105 | lcd_setmargins(0, 0); | ||
2106 | for (;;) | ||
2107 | { | ||
2108 | int button; | ||
2109 | |||
2110 | if (mode_changed) | ||
2111 | { | ||
2112 | lcd_clear_display(); | ||
2113 | lcd_puts(0, 0, "Button light support"); | ||
2114 | lcd_puts(0, 1, "Press UP for mode change"); | ||
2115 | lcd_puts(0, 2, "Press DOWN for buttonlight selection"); | ||
2116 | |||
2117 | switch (mode) | ||
2118 | { | ||
2119 | case 0: | ||
2120 | lcd_puts(1, 3, "Off"); | ||
2121 | __buttonlight_mode(BUTTONLIGHT_OFF, which_led, brightness); | ||
2122 | break; | ||
2123 | |||
2124 | case 1: | ||
2125 | lcd_puts(1, 3, "On - Set to brightness"); | ||
2126 | __buttonlight_mode(BUTTONLIGHT_ON, which_led, brightness); | ||
2127 | break; | ||
2128 | |||
2129 | case 2: | ||
2130 | lcd_puts(1, 3, "Faint - Always on at lowest brightness"); | ||
2131 | __buttonlight_mode(BUTTONLIGHT_FAINT, which_led, brightness); | ||
2132 | break; | ||
2133 | |||
2134 | case 3: | ||
2135 | lcd_puts(1, 3, "Flicker on disk access"); | ||
2136 | __buttonlight_mode(BUTTONLIGHT_FLICKER, which_led, brightness); | ||
2137 | break; | ||
2138 | |||
2139 | case 4: | ||
2140 | lcd_puts(1, 3, "Solid on disk access"); | ||
2141 | __buttonlight_mode(BUTTONLIGHT_SIGNAL, which_led, brightness); | ||
2142 | break; | ||
2143 | |||
2144 | case 5: | ||
2145 | lcd_puts(1, 3, "Follows backlight"); | ||
2146 | __buttonlight_mode(BUTTONLIGHT_FOLLOW, which_led, brightness); | ||
2147 | break; | ||
2148 | |||
2149 | case 6: | ||
2150 | lcd_puts(1, 3, "Shows 'battery charging'"); | ||
2151 | __buttonlight_mode(BUTTONLIGHT_CHARGING, which_led, brightness); | ||
2152 | break; | ||
2153 | |||
2154 | } | ||
2155 | mode_changed = 0; | ||
2156 | lcd_update(); | ||
2157 | } | ||
2158 | |||
2159 | |||
2160 | |||
2161 | /* does nothing unless in flicker mode */ | ||
2162 | /* the parameter sets the brightness */ | ||
2163 | __buttonlight_trigger(); | ||
2164 | button = get_action(CONTEXT_STD,HZ/5); | ||
2165 | switch(button) | ||
2166 | { | ||
2167 | case ACTION_STD_PREV: | ||
2168 | if (++mode > 6) mode = 0; | ||
2169 | mode_changed = 1; | ||
2170 | break; | ||
2171 | |||
2172 | case ACTION_STD_NEXT: | ||
2173 | if (which_led == BUTTONLIGHT_LED_ALL) | ||
2174 | { | ||
2175 | which_led = BUTTONLIGHT_LED_MENU; | ||
2176 | } | ||
2177 | else | ||
2178 | { | ||
2179 | which_led = BUTTONLIGHT_LED_ALL; | ||
2180 | } | ||
2181 | mode_changed = 1; | ||
2182 | |||
2183 | break; | ||
2184 | |||
2185 | |||
2186 | case ACTION_STD_OK: | ||
2187 | case ACTION_STD_CANCEL: | ||
2188 | action_signalscreenchange(); | ||
2189 | return false; | ||
2190 | |||
2191 | default: | ||
2192 | sleep(HZ/10); | ||
2193 | break; | ||
2194 | } | ||
2195 | } | ||
2196 | return false; | ||
2197 | } | ||
2198 | |||
2199 | |||
2200 | |||
2201 | |||
2202 | #endif | 2104 | #endif |
2203 | 2105 | ||
2204 | #if defined(HAVE_EEPROM) && !defined(HAVE_EEPROM_SETTINGS) | 2106 | #if defined(HAVE_EEPROM) && !defined(HAVE_EEPROM_SETTINGS) |
@@ -2302,8 +2204,6 @@ struct the_menu_item { | |||
2302 | static const struct the_menu_item menuitems[] = { | 2204 | static const struct the_menu_item menuitems[] = { |
2303 | #if defined(TOSHIBA_GIGABEAT_F) && !defined(SIMULATOR) | 2205 | #if defined(TOSHIBA_GIGABEAT_F) && !defined(SIMULATOR) |
2304 | { "LCD Power Off", dbg_lcd_power_off }, | 2206 | { "LCD Power Off", dbg_lcd_power_off }, |
2305 | { "Button Light modes", dbg_buttonlights }, | ||
2306 | |||
2307 | #endif | 2207 | #endif |
2308 | #if CONFIG_CPU == SH7034 || defined(CPU_COLDFIRE) || \ | 2208 | #if CONFIG_CPU == SH7034 || defined(CPU_COLDFIRE) || \ |
2309 | (defined(CPU_PP) && !defined(SANSA_E200)) | 2209 | (defined(CPU_PP) && !defined(SANSA_E200)) |