diff options
author | Michael Chicoine <mc2739@gmail.com> | 2009-12-09 15:32:22 +0000 |
---|---|---|
committer | Michael Chicoine <mc2739@gmail.com> | 2009-12-09 15:32:22 +0000 |
commit | 887d8180d294799c96eb85b50e51bb7a1a48131d (patch) | |
tree | 54830b59bb23fa2e8438fcacdd66f8d4ee4bf365 /apps | |
parent | 360c536fab3a807488ce5d99529e58a41673b48f (diff) | |
download | rockbox-887d8180d294799c96eb85b50e51bb7a1a48131d.tar.gz rockbox-887d8180d294799c96eb85b50e51bb7a1a48131d.zip |
Correct the debug information displayed for SD card to match the CID register layout.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23908 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r-- | apps/debug_menu.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/apps/debug_menu.c b/apps/debug_menu.c index a8a7a3f968..a3b971f3e8 100644 --- a/apps/debug_menu.c +++ b/apps/debug_menu.c | |||
@@ -1724,7 +1724,7 @@ static int disk_callback(int btn, struct gui_synclist *lists) | |||
1724 | { | 1724 | { |
1725 | tCardInfo *card; | 1725 | tCardInfo *card; |
1726 | int *cardnum = (int*)lists->data; | 1726 | int *cardnum = (int*)lists->data; |
1727 | unsigned char card_name[7]; | 1727 | unsigned char card_name[6]; |
1728 | unsigned char pbuf[32]; | 1728 | unsigned char pbuf[32]; |
1729 | char *title = lists->title; | 1729 | char *title = lists->title; |
1730 | static const unsigned char i_vmin[] = { 0, 1, 5, 10, 25, 35, 60, 100 }; | 1730 | static const unsigned char i_vmin[] = { 0, 1, 5, 10, 25, 35, 60, 100 }; |
@@ -1751,15 +1751,21 @@ static int disk_callback(int btn, struct gui_synclist *lists) | |||
1751 | 1751 | ||
1752 | if (card->initialized > 0) | 1752 | if (card->initialized > 0) |
1753 | { | 1753 | { |
1754 | strlcpy(card_name, ((unsigned char*)card->cid) + 3, sizeof(card_name)); | 1754 | char temp[6] = "\0"; |
1755 | unsigned i; | ||
1756 | for (i=0; i<sizeof(card_name); i++) | ||
1757 | { | ||
1758 | temp[i] = card_extract_bits(card->cid, (103-8*i), 8); | ||
1759 | } | ||
1760 | strlcpy(card_name, temp, sizeof(temp)); | ||
1755 | simplelist_addline(SIMPLELIST_ADD_LINE, | 1761 | simplelist_addline(SIMPLELIST_ADD_LINE, |
1756 | "%s Rev %d.%d", card_name, | 1762 | "%s Rev %d.%d", card_name, |
1757 | (int) card_extract_bits(card->cid, 55, 4), | 1763 | (int) card_extract_bits(card->cid, 63, 4), |
1758 | (int) card_extract_bits(card->cid, 51, 4)); | 1764 | (int) card_extract_bits(card->cid, 59, 4)); |
1759 | simplelist_addline(SIMPLELIST_ADD_LINE, | 1765 | simplelist_addline(SIMPLELIST_ADD_LINE, |
1760 | "Prod: %d/%d", | 1766 | "Prod: %d/%d", |
1761 | #if (CONFIG_STORAGE & STORAGE_SD) | 1767 | #if (CONFIG_STORAGE & STORAGE_SD) |
1762 | (int) card_extract_bits(card->cid, 11, 3), | 1768 | (int) card_extract_bits(card->cid, 11, 4), |
1763 | (int) card_extract_bits(card->cid, 19, 8) + 2000 | 1769 | (int) card_extract_bits(card->cid, 19, 8) + 2000 |
1764 | #elif (CONFIG_STORAGE & STORAGE_MMC) | 1770 | #elif (CONFIG_STORAGE & STORAGE_MMC) |
1765 | (int) card_extract_bits(card->cid, 15, 4), | 1771 | (int) card_extract_bits(card->cid, 15, 4), |