From 8c040be13393c3235a0ebe0d4277f77c753a73bd Mon Sep 17 00:00:00 2001 From: nvt-se Date: Sat, 7 Nov 2009 01:05:23 +0000 Subject: [PATCH] Changed the name of the declaration of the default block size. Reduced the OCR reading timeout. --- platform/msb430/dev/sd.c | 5 +++-- platform/msb430/dev/sd.h | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/platform/msb430/dev/sd.c b/platform/msb430/dev/sd.c index 2a39b654b..b1ef4c21b 100755 --- a/platform/msb430/dev/sd.c +++ b/platform/msb430/dev/sd.c @@ -211,7 +211,7 @@ sd_initialize(void) LOCK_SPI(); - for(i = 0; i < 10000; i++) { + for(i = 0; i < SD_TRANSACTION_ATTEMPTS; i++) { LOWER_CS(); send_command(READ_OCR, 0); r = get_response(R3); @@ -235,7 +235,8 @@ sd_initialize(void) read_bl_len = reg[5] & 0x0f; block_size = 1 << read_bl_len; - rw_block_size = (block_size > 512) ? 512 : block_size; + rw_block_size = (block_size > SD_DEFAULT_BLOCK_SIZE) ? + SD_DEFAULT_BLOCK_SIZE : block_size; PRINTF("Found block size %d\n", block_size); /* XXX Arbitrary wait time here. Need to investigate why this is needed. */ diff --git a/platform/msb430/dev/sd.h b/platform/msb430/dev/sd.h index 5b08d392b..8efc33305 100644 --- a/platform/msb430/dev/sd.h +++ b/platform/msb430/dev/sd.h @@ -42,7 +42,7 @@ #include "sd-arch.h" -#define SD_BLOCK_SIZE 512 +#define SD_DEFAULT_BLOCK_SIZE 512 #define SD_REGISTER_SIZE 16 /* API return codes. */