summaryrefslogtreecommitdiff
path: root/apps/debug_menu.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/debug_menu.c')
-rw-r--r--apps/debug_menu.c46
1 files changed, 24 insertions, 22 deletions
diff --git a/apps/debug_menu.c b/apps/debug_menu.c
index 0b39430d56..fe7d5b584b 100644
--- a/apps/debug_menu.c
+++ b/apps/debug_menu.c
@@ -59,7 +59,7 @@
59#include "fat.h" 59#include "fat.h"
60#include "mas.h" 60#include "mas.h"
61#include "eeprom_24cxx.h" 61#include "eeprom_24cxx.h"
62#ifdef HAVE_MMC 62#if defined(HAVE_MMC) || defined(HAVE_HOTSWAP)
63#include "ata_mmc.h" 63#include "ata_mmc.h"
64#endif 64#endif
65#if CONFIG_TUNER 65#if CONFIG_TUNER
@@ -1524,8 +1524,8 @@ static bool view_battery(void)
1524#endif 1524#endif
1525 1525
1526#ifndef SIMULATOR 1526#ifndef SIMULATOR
1527#ifdef HAVE_MMC 1527#if defined(HAVE_MMC) || defined(HAVE_HOTSWAP)
1528static bool dbg_mmc_info(void) 1528static bool dbg_card_info(void)
1529{ 1529{
1530 bool done = false; 1530 bool done = false;
1531 int currval = 0; 1531 int currval = 0;
@@ -1548,7 +1548,7 @@ static bool dbg_mmc_info(void)
1548 1548
1549 while (!done) 1549 while (!done)
1550 { 1550 {
1551 card = mmc_card_info(currval / 2); 1551 card = card_get_info(currval / 2);
1552 1552
1553 line = 0; 1553 line = 0;
1554 lcd_clear_display(); 1554 lcd_clear_display();
@@ -1564,29 +1564,29 @@ static bool dbg_mmc_info(void)
1564 1564
1565 strncpy(card_name, ((unsigned char*)card->cid) + 3, 6); 1565 strncpy(card_name, ((unsigned char*)card->cid) + 3, 6);
1566 snprintf(pbuf, sizeof(pbuf), "%s Rev %d.%d", card_name, 1566 snprintf(pbuf, sizeof(pbuf), "%s Rev %d.%d", card_name,
1567 (int) mmc_extract_bits(card->cid, 72, 4), 1567 (int) card_extract_bits(card->cid, 72, 4),
1568 (int) mmc_extract_bits(card->cid, 76, 4)); 1568 (int) card_extract_bits(card->cid, 76, 4));
1569 lcd_puts(0, line++, pbuf); 1569 lcd_puts(0, line++, pbuf);
1570 snprintf(pbuf, sizeof(pbuf), "Prod: %d/%d", 1570 snprintf(pbuf, sizeof(pbuf), "Prod: %d/%d",
1571 (int) mmc_extract_bits(card->cid, 112, 4), 1571 (int) card_extract_bits(card->cid, 112, 4),
1572 (int) mmc_extract_bits(card->cid, 116, 4) + 1997); 1572 (int) card_extract_bits(card->cid, 116, 4) + 1997);
1573 lcd_puts(0, line++, pbuf); 1573 lcd_puts(0, line++, pbuf);
1574 snprintf(pbuf, sizeof(pbuf), "Ser#: 0x%08lx", 1574 snprintf(pbuf, sizeof(pbuf), "Ser#: 0x%08lx",
1575 mmc_extract_bits(card->cid, 80, 32)); 1575 card_extract_bits(card->cid, 80, 32));
1576 lcd_puts(0, line++, pbuf); 1576 lcd_puts(0, line++, pbuf);
1577 snprintf(pbuf, sizeof(pbuf), "M=%02x, O=%04x", 1577 snprintf(pbuf, sizeof(pbuf), "M=%02x, O=%04x",
1578 (int) mmc_extract_bits(card->cid, 0, 8), 1578 (int) card_extract_bits(card->cid, 0, 8),
1579 (int) mmc_extract_bits(card->cid, 8, 16)); 1579 (int) card_extract_bits(card->cid, 8, 16));
1580 lcd_puts(0, line++, pbuf); 1580 lcd_puts(0, line++, pbuf);
1581 temp = mmc_extract_bits(card->csd, 2, 4); 1581 temp = card_extract_bits(card->csd, 2, 4);
1582 snprintf(pbuf, sizeof(pbuf), "MMC v%s", temp < 5 ? 1582 snprintf(pbuf, sizeof(pbuf), "MMC v%s", temp < 5 ?
1583 spec_vers[temp] : "?.?"); 1583 spec_vers[temp] : "?.?");
1584 lcd_puts(0, line++, pbuf); 1584 lcd_puts(0, line++, pbuf);
1585 snprintf(pbuf, sizeof(pbuf), "Blocks: 0x%06lx", card->numblocks); 1585 snprintf(pbuf, sizeof(pbuf), "Blocks: 0x%06lx", card->numblocks);
1586 lcd_puts(0, line++, pbuf); 1586 lcd_puts(0, line++, pbuf);
1587 snprintf(pbuf, sizeof(pbuf), "Blksz.: %d P:%c%c", card->blocksize, 1587 snprintf(pbuf, sizeof(pbuf), "Blksz.: %d P:%c%c", card->blocksize,
1588 mmc_extract_bits(card->csd, 48, 1) ? 'R' : '-', 1588 card_extract_bits(card->csd, 48, 1) ? 'R' : '-',
1589 mmc_extract_bits(card->csd, 106, 1) ? 'W' : '-'); 1589 card_extract_bits(card->csd, 106, 1) ? 'W' : '-');
1590 lcd_puts(0, line++, pbuf); 1590 lcd_puts(0, line++, pbuf);
1591 } 1591 }
1592 else /* Technical details */ 1592 else /* Technical details */
@@ -1606,12 +1606,12 @@ static bool dbg_mmc_info(void)
1606 snprintf(pbuf, sizeof(pbuf), "R2W: *%d", card->r2w_factor); 1606 snprintf(pbuf, sizeof(pbuf), "R2W: *%d", card->r2w_factor);
1607 lcd_puts(0, line++, pbuf); 1607 lcd_puts(0, line++, pbuf);
1608 snprintf(pbuf, sizeof(pbuf), "IRmax: %d..%d mA", 1608 snprintf(pbuf, sizeof(pbuf), "IRmax: %d..%d mA",
1609 i_vmin[mmc_extract_bits(card->csd, 66, 3)], 1609 i_vmin[card_extract_bits(card->csd, 66, 3)],
1610 i_vmax[mmc_extract_bits(card->csd, 69, 3)]); 1610 i_vmax[card_extract_bits(card->csd, 69, 3)]);
1611 lcd_puts(0, line++, pbuf); 1611 lcd_puts(0, line++, pbuf);
1612 snprintf(pbuf, sizeof(pbuf), "IWmax: %d..%d mA", 1612 snprintf(pbuf, sizeof(pbuf), "IWmax: %d..%d mA",
1613 i_vmin[mmc_extract_bits(card->csd, 72, 3)], 1613 i_vmin[card_extract_bits(card->csd, 72, 3)],
1614 i_vmax[mmc_extract_bits(card->csd, 75, 3)]); 1614 i_vmax[card_extract_bits(card->csd, 75, 3)]);
1615 lcd_puts(0, line++, pbuf); 1615 lcd_puts(0, line++, pbuf);
1616 } 1616 }
1617 } 1617 }
@@ -1642,7 +1642,7 @@ static bool dbg_mmc_info(void)
1642 action_signalscreenchange(); 1642 action_signalscreenchange();
1643 return false; 1643 return false;
1644} 1644}
1645#else /* !HAVE_MMC */ 1645#else /* !defined(HAVE_MMC) && !defined(HAVE_HOTSWAP) */
1646static bool dbg_disk_info(void) 1646static bool dbg_disk_info(void)
1647{ 1647{
1648 char buf[128]; 1648 char buf[128];
@@ -1799,7 +1799,7 @@ static bool dbg_disk_info(void)
1799 action_signalscreenchange(); 1799 action_signalscreenchange();
1800 return false; 1800 return false;
1801} 1801}
1802#endif /* !HAVE_MMC */ 1802#endif /* !defined(HAVE_MMC) && !defined(HAVE_HOTSWAP) */
1803#endif /* !SIMULATOR */ 1803#endif /* !SIMULATOR */
1804 1804
1805#ifdef HAVE_DIRCACHE 1805#ifdef HAVE_DIRCACHE
@@ -2278,8 +2278,10 @@ static const struct the_menu_item menuitems[] = {
2278 { "View partitions", dbg_partitions }, 2278 { "View partitions", dbg_partitions },
2279#endif 2279#endif
2280#ifndef SIMULATOR 2280#ifndef SIMULATOR
2281#ifdef HAVE_MMC 2281#if defined(HAVE_MMC)
2282 { "View MMC info", dbg_mmc_info }, 2282 { "View MMC info", dbg_card_info },
2283#elif defined(HAVE_HOTSWAP)
2284 { "View microSD info", dbg_card_info },
2283#else 2285#else
2284 { "View disk info", dbg_disk_info }, 2286 { "View disk info", dbg_disk_info },
2285#endif 2287#endif