diff options
Diffstat (limited to 'apps/debug_menu.c')
-rw-r--r-- | apps/debug_menu.c | 39 |
1 files changed, 33 insertions, 6 deletions
diff --git a/apps/debug_menu.c b/apps/debug_menu.c index 26534cc101..b6038e7c89 100644 --- a/apps/debug_menu.c +++ b/apps/debug_menu.c | |||
@@ -59,13 +59,16 @@ | |||
59 | #include "power.h" | 59 | #include "power.h" |
60 | #include "usb.h" | 60 | #include "usb.h" |
61 | #include "rtc.h" | 61 | #include "rtc.h" |
62 | #include "ata.h" | 62 | #include "storage.h" |
63 | #include "fat.h" | 63 | #include "fat.h" |
64 | #include "mas.h" | 64 | #include "mas.h" |
65 | #include "eeprom_24cxx.h" | 65 | #include "eeprom_24cxx.h" |
66 | #if (CONFIG_STORAGE & STORAGE_MMC) || (CONFIG_STORAGE & STORAGE_SD) | 66 | #if (CONFIG_STORAGE & STORAGE_MMC) || (CONFIG_STORAGE & STORAGE_SD) |
67 | #include "hotswap.h" | 67 | #include "hotswap.h" |
68 | #endif | 68 | #endif |
69 | #if (CONFIG_STORAGE & STORAGE_ATA) | ||
70 | #include "ata.h" | ||
71 | #endif | ||
69 | #if CONFIG_TUNER | 72 | #if CONFIG_TUNER |
70 | #include "tuner.h" | 73 | #include "tuner.h" |
71 | #include "radio.h" | 74 | #include "radio.h" |
@@ -1731,11 +1734,13 @@ static bool view_battery(void) | |||
1731 | 1734 | ||
1732 | #ifndef SIMULATOR | 1735 | #ifndef SIMULATOR |
1733 | #if (CONFIG_STORAGE & STORAGE_MMC) || (CONFIG_STORAGE & STORAGE_SD) | 1736 | #if (CONFIG_STORAGE & STORAGE_MMC) || (CONFIG_STORAGE & STORAGE_SD) |
1737 | |||
1734 | #if (CONFIG_STORAGE & STORAGE_MMC) | 1738 | #if (CONFIG_STORAGE & STORAGE_MMC) |
1735 | #define CARDTYPE "MMC" | 1739 | #define CARDTYPE "MMC" |
1736 | #else | 1740 | #elif (CONFIG_STORAGE & STORAGE_SD) |
1737 | #define CARDTYPE "microSD" | 1741 | #define CARDTYPE "microSD" |
1738 | #endif | 1742 | #endif |
1743 | |||
1739 | static int disk_callback(int btn, struct gui_synclist *lists) | 1744 | static int disk_callback(int btn, struct gui_synclist *lists) |
1740 | { | 1745 | { |
1741 | tCardInfo *card; | 1746 | tCardInfo *card; |
@@ -1826,7 +1831,7 @@ static int disk_callback(int btn, struct gui_synclist *lists) | |||
1826 | } | 1831 | } |
1827 | return btn; | 1832 | return btn; |
1828 | } | 1833 | } |
1829 | #else /* !(CONFIG_STORAGE & STORAGE_MMC) && !(CONFIG_STORAGE & STORAGE_SD) */ | 1834 | #elif (CONFIG_STORAGE & STORAGE_ATA) |
1830 | static int disk_callback(int btn, struct gui_synclist *lists) | 1835 | static int disk_callback(int btn, struct gui_synclist *lists) |
1831 | { | 1836 | { |
1832 | (void)lists; | 1837 | (void)lists; |
@@ -1860,7 +1865,7 @@ static int disk_callback(int btn, struct gui_synclist *lists) | |||
1860 | simplelist_addline(SIMPLELIST_ADD_LINE, | 1865 | simplelist_addline(SIMPLELIST_ADD_LINE, |
1861 | "Free: %ld MB", free / 1024); | 1866 | "Free: %ld MB", free / 1024); |
1862 | simplelist_addline(SIMPLELIST_ADD_LINE, | 1867 | simplelist_addline(SIMPLELIST_ADD_LINE, |
1863 | "Spinup time: %d ms", ata_spinup_time * (1000/HZ)); | 1868 | "Spinup time: %d ms", storage_spinup_time() * (1000/HZ)); |
1864 | i = identify_info[83] & (1<<3); | 1869 | i = identify_info[83] & (1<<3); |
1865 | simplelist_addline(SIMPLELIST_ADD_LINE, | 1870 | simplelist_addline(SIMPLELIST_ADD_LINE, |
1866 | "Power mgmt: %s", i ? "enabled" : "unsupported"); | 1871 | "Power mgmt: %s", i ? "enabled" : "unsupported"); |
@@ -1945,7 +1950,29 @@ static int disk_callback(int btn, struct gui_synclist *lists) | |||
1945 | "Cluster size: %d bytes", fat_get_cluster_size(IF_MV(0))); | 1950 | "Cluster size: %d bytes", fat_get_cluster_size(IF_MV(0))); |
1946 | return btn; | 1951 | return btn; |
1947 | } | 1952 | } |
1953 | #else /* No SD, MMC or ATA */ | ||
1954 | static int disk_callback(int btn, struct gui_synclist *lists) | ||
1955 | { | ||
1956 | (void)btn; | ||
1957 | (void)lists; | ||
1958 | struct storage_info info; | ||
1959 | storage_get_info(IF_MV2(0,)&info); | ||
1960 | simplelist_addline(SIMPLELIST_ADD_LINE, "Vendor: %s", info.vendor); | ||
1961 | simplelist_addline(SIMPLELIST_ADD_LINE, "Model: %s", info.product); | ||
1962 | simplelist_addline(SIMPLELIST_ADD_LINE, "Firmware: %s", info.revision); | ||
1963 | simplelist_addline(SIMPLELIST_ADD_LINE, | ||
1964 | "Size: %ld MB", info.num_sectors*(info.sector_size/512)/2024); | ||
1965 | unsigned long free; | ||
1966 | fat_size( IF_MV2(0,) NULL, &free ); | ||
1967 | simplelist_addline(SIMPLELIST_ADD_LINE, | ||
1968 | "Free: %ld MB", free / 1024); | ||
1969 | simplelist_addline(SIMPLELIST_ADD_LINE, | ||
1970 | "Cluster size: %d bytes", fat_get_cluster_size(IF_MV(0))); | ||
1971 | return btn; | ||
1972 | } | ||
1973 | #endif | ||
1948 | 1974 | ||
1975 | #if (CONFIG_STORAGE & STORAGE_ATA) | ||
1949 | static bool dbg_identify_info(void) | 1976 | static bool dbg_identify_info(void) |
1950 | { | 1977 | { |
1951 | int fd = creat("/identify_info.bin"); | 1978 | int fd = creat("/identify_info.bin"); |
@@ -1960,7 +1987,7 @@ static bool dbg_identify_info(void) | |||
1960 | } | 1987 | } |
1961 | return false; | 1988 | return false; |
1962 | } | 1989 | } |
1963 | #endif /* !(CONFIG_STORAGE & STORAGE_MMC) && !(CONFIG_STORAGE & STORAGE_SD) */ | 1990 | #endif |
1964 | 1991 | ||
1965 | static bool dbg_disk_info(void) | 1992 | static bool dbg_disk_info(void) |
1966 | { | 1993 | { |
@@ -2504,7 +2531,7 @@ static const struct the_menu_item menuitems[] = { | |||
2504 | #endif | 2531 | #endif |
2505 | #ifndef SIMULATOR | 2532 | #ifndef SIMULATOR |
2506 | { "View disk info", dbg_disk_info }, | 2533 | { "View disk info", dbg_disk_info }, |
2507 | #if !(CONFIG_STORAGE & STORAGE_MMC) && !(CONFIG_STORAGE & STORAGE_SD) | 2534 | #if (CONFIG_STORAGE & STORAGE_ATA) |
2508 | { "Dump ATA identify info", dbg_identify_info}, | 2535 | { "Dump ATA identify info", dbg_identify_info}, |
2509 | #endif | 2536 | #endif |
2510 | #endif | 2537 | #endif |