diff options
Diffstat (limited to 'apps/debug_menu.c')
-rw-r--r-- | apps/debug_menu.c | 65 |
1 files changed, 64 insertions, 1 deletions
diff --git a/apps/debug_menu.c b/apps/debug_menu.c index 0a0627c10f..d266bef6c7 100644 --- a/apps/debug_menu.c +++ b/apps/debug_menu.c | |||
@@ -1022,6 +1022,8 @@ bool dbg_ports(void) | |||
1022 | #elif CONFIG_CPU == PP5020 | 1022 | #elif CONFIG_CPU == PP5020 |
1023 | 1023 | ||
1024 | unsigned int gpio_a, gpio_b, gpio_c, gpio_d; | 1024 | unsigned int gpio_a, gpio_b, gpio_c, gpio_d; |
1025 | unsigned int gpio_e, gpio_f, gpio_g, gpio_h; | ||
1026 | unsigned int gpio_i, gpio_j, gpio_k, gpio_l; | ||
1025 | 1027 | ||
1026 | char buf[128]; | 1028 | char buf[128]; |
1027 | int button; | 1029 | int button; |
@@ -1049,7 +1051,37 @@ bool dbg_ports(void) | |||
1049 | lcd_puts(0, line++, buf); | 1051 | lcd_puts(0, line++, buf); |
1050 | snprintf(buf, sizeof(buf), "GPIO_D: %02x", gpio_d); | 1052 | snprintf(buf, sizeof(buf), "GPIO_D: %02x", gpio_d); |
1051 | lcd_puts(0, line++, buf); | 1053 | lcd_puts(0, line++, buf); |
1052 | 1054 | line++; | |
1055 | |||
1056 | gpio_e = GPIOE_INPUT_VAL; | ||
1057 | gpio_f = GPIOF_INPUT_VAL; | ||
1058 | gpio_g = GPIOG_INPUT_VAL; | ||
1059 | gpio_h = GPIOH_INPUT_VAL; | ||
1060 | |||
1061 | snprintf(buf, sizeof(buf), "GPIO_E: %02x", gpio_e); | ||
1062 | lcd_puts(0, line++, buf); | ||
1063 | snprintf(buf, sizeof(buf), "GPIO_F: %02x", gpio_f); | ||
1064 | lcd_puts(0, line++, buf); | ||
1065 | snprintf(buf, sizeof(buf), "GPIO_G: %02x", gpio_g); | ||
1066 | lcd_puts(0, line++, buf); | ||
1067 | snprintf(buf, sizeof(buf), "GPIO_H: %02x", gpio_h); | ||
1068 | lcd_puts(0, line++, buf); | ||
1069 | line++; | ||
1070 | |||
1071 | gpio_i = GPIOI_INPUT_VAL; | ||
1072 | gpio_j = GPIOJ_INPUT_VAL; | ||
1073 | gpio_k = GPIOK_INPUT_VAL; | ||
1074 | gpio_l = GPIOL_INPUT_VAL; | ||
1075 | |||
1076 | snprintf(buf, sizeof(buf), "GPIO_I: %02x", gpio_i); | ||
1077 | lcd_puts(0, line++, buf); | ||
1078 | snprintf(buf, sizeof(buf), "GPIO_J: %02x", gpio_j); | ||
1079 | lcd_puts(0, line++, buf); | ||
1080 | snprintf(buf, sizeof(buf), "GPIO_K: %02x", gpio_k); | ||
1081 | lcd_puts(0, line++, buf); | ||
1082 | snprintf(buf, sizeof(buf), "GPIO_L: %02x", gpio_l); | ||
1083 | lcd_puts(0, line++, buf); | ||
1084 | |||
1053 | lcd_update(); | 1085 | lcd_update(); |
1054 | button = button_get_w_tmo(HZ/10); | 1086 | button = button_get_w_tmo(HZ/10); |
1055 | 1087 | ||
@@ -1309,9 +1341,40 @@ bool view_battery(void) | |||
1309 | lcd_puts(0, 6, buf); | 1341 | lcd_puts(0, 6, buf); |
1310 | lcd_puts(0, 7, power_message); | 1342 | lcd_puts(0, 7, power_message); |
1311 | #else /* !HAVE_CHARGE_CTRL */ | 1343 | #else /* !HAVE_CHARGE_CTRL */ |
1344 | #if defined IPOD_ARCH | ||
1345 | #if defined APPLE_IPODNANO || defined APPLE_IPODVIDEO | ||
1346 | int usb_pwr = (GPIOL_INPUT_VAL & 0x10)?true:false; | ||
1347 | int ext_pwr = (GPIOL_INPUT_VAL & 0x08)?false:true; | ||
1348 | int dock = (GPIOA_INPUT_VAL & 0x10)?true:false; | ||
1349 | int charging = (GPIOB_INPUT_VAL & 0x01)?false:true; | ||
1350 | int headphone= (GPIOA_INPUT_VAL & 0x80)?true:false; | ||
1351 | |||
1352 | snprintf(buf, 30, "USB pwr: %s", | ||
1353 | usb_pwr ? "present" : "absent"); | ||
1354 | lcd_puts(0, 3, buf); | ||
1355 | snprintf(buf, 30, "EXT pwr: %s", | ||
1356 | ext_pwr ? "present" : "absent"); | ||
1357 | lcd_puts(0, 4, buf); | ||
1358 | snprintf(buf, 30, "Battery: %s", | ||
1359 | charging ? "charging" : (usb_pwr||ext_pwr) ? "charged" : "discharging"); | ||
1360 | lcd_puts(0, 5, buf); | ||
1361 | snprintf(buf, 30, "Dock mode: %s", | ||
1362 | dock ? "enabled" : "disabled"); | ||
1363 | lcd_puts(0, 6, buf); | ||
1364 | snprintf(buf, 30, "Headphone: %s", | ||
1365 | headphone ? "connected" : "disconnected"); | ||
1366 | lcd_puts(0, 7, buf); | ||
1367 | #else | ||
1368 | /* other ipod devices go here */ | ||
1369 | snprintf(buf, 30, "Charger: %s", | ||
1370 | charger_inserted() ? "present" : "absent"); | ||
1371 | lcd_puts(0, 3, buf); | ||
1372 | #endif | ||
1373 | #elif | ||
1312 | snprintf(buf, 30, "Charger: %s", | 1374 | snprintf(buf, 30, "Charger: %s", |
1313 | charger_inserted() ? "present" : "absent"); | 1375 | charger_inserted() ? "present" : "absent"); |
1314 | lcd_puts(0, 3, buf); | 1376 | lcd_puts(0, 3, buf); |
1377 | #endif | ||
1315 | #endif /* !HAVE_CHARGE_CTRL */ | 1378 | #endif /* !HAVE_CHARGE_CTRL */ |
1316 | #endif /* HAVE_CHARGING */ | 1379 | #endif /* HAVE_CHARGING */ |
1317 | break; | 1380 | break; |