From b3017c8701b9b4e4ed041e224d163e82f198c10c Mon Sep 17 00:00:00 2001 From: Jens Arnold Date: Sat, 12 Feb 2005 23:09:00 +0000 Subject: Fixed calculation of MMC sector count. Display sector count instead of (rough) size info for debugging. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5937 a1c6a512-1295-4272-9138-f99709370657 --- firmware/drivers/ata_mmc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'firmware') diff --git a/firmware/drivers/ata_mmc.c b/firmware/drivers/ata_mmc.c index b528bdb1e3..7149e111cd 100644 --- a/firmware/drivers/ata_mmc.c +++ b/firmware/drivers/ata_mmc.c @@ -477,8 +477,8 @@ static int initialize_card(int card_no) card->write_timeout = card->read_timeout * card->r2w_factor; /* card size */ - card->numsectors = mmc_extract_bits(card->csd, 54, 12) - * (1 << (mmc_extract_bits(card->csd, 78, 3)+2)); + card->numsectors = (mmc_extract_bits(card->csd, 54, 12) + 1) + * (1 << (mmc_extract_bits(card->csd, 78, 3)+2)); /* switch to full speed */ setup_sci1(card->bitrate_register); -- cgit v1.2.3