summaryrefslogtreecommitdiff
path: root/apps/debug_menu.c
diff options
context:
space:
mode:
authorMichael Chicoine <mc2739@gmail.com>2009-12-09 15:32:22 +0000
committerMichael Chicoine <mc2739@gmail.com>2009-12-09 15:32:22 +0000
commit887d8180d294799c96eb85b50e51bb7a1a48131d (patch)
tree54830b59bb23fa2e8438fcacdd66f8d4ee4bf365 /apps/debug_menu.c
parent360c536fab3a807488ce5d99529e58a41673b48f (diff)
downloadrockbox-887d8180d294799c96eb85b50e51bb7a1a48131d.zip
rockbox-887d8180d294799c96eb85b50e51bb7a1a48131d.tar.gz
rockbox-887d8180d294799c96eb85b50e51bb7a1a48131d.tar.bz2
rockbox-887d8180d294799c96eb85b50e51bb7a1a48131d.tar.xz
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/debug_menu.c')
-rw-r--r--apps/debug_menu.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/apps/debug_menu.c b/apps/debug_menu.c
index a8a7a3f..a3b971f 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)
{
tCardInfo *card;
int *cardnum = (int*)lists->data;
- unsigned char card_name[7];
+ unsigned char card_name[6];
unsigned char pbuf[32];
char *title = lists->title;
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)
if (card->initialized > 0)
{
- strlcpy(card_name, ((unsigned char*)card->cid) + 3, sizeof(card_name));
+ char temp[6] = "\0";
+ unsigned i;
+ for (i=0; i<sizeof(card_name); i++)
+ {
+ temp[i] = card_extract_bits(card->cid, (103-8*i), 8);
+ }
+ strlcpy(card_name, temp, sizeof(temp));
simplelist_addline(SIMPLELIST_ADD_LINE,
"%s Rev %d.%d", card_name,
- (int) card_extract_bits(card->cid, 55, 4),
- (int) card_extract_bits(card->cid, 51, 4));
+ (int) card_extract_bits(card->cid, 63, 4),
+ (int) card_extract_bits(card->cid, 59, 4));
simplelist_addline(SIMPLELIST_ADD_LINE,
"Prod: %d/%d",
#if (CONFIG_STORAGE & STORAGE_SD)
- (int) card_extract_bits(card->cid, 11, 3),
+ (int) card_extract_bits(card->cid, 11, 4),
(int) card_extract_bits(card->cid, 19, 8) + 2000
#elif (CONFIG_STORAGE & STORAGE_MMC)
(int) card_extract_bits(card->cid, 15, 4),