From b909a62265682afb9a92ce5253a26f65032f99e3 Mon Sep 17 00:00:00 2001 From: nvt-se Date: Wed, 11 Nov 2009 14:59:33 +0000 Subject: [PATCH] Reduced application buffer size for SD and switched parameter in cfs-coffee-arch.c --- platform/msb430/apps/sd-test.c | 6 ++++-- platform/msb430/cfs-coffee-arch.c | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/platform/msb430/apps/sd-test.c b/platform/msb430/apps/sd-test.c index c5ff6db85..a5cb1db7f 100644 --- a/platform/msb430/apps/sd-test.c +++ b/platform/msb430/apps/sd-test.c @@ -28,7 +28,7 @@ * * This file is part of the Contiki operating system. * - * $Id: sd-test.c,v 1.7 2009/11/06 15:11:52 nvt-se Exp $ + * $Id: sd-test.c,v 1.8 2009/11/11 14:59:34 nvt-se Exp $ */ /** @@ -49,11 +49,13 @@ PROCESS(sd_test, "SD test process"); AUTOSTART_PROCESSES(&sd_test); +#define BUF_SIZE 64 + PROCESS_THREAD(sd_test, event, data) { static unsigned long iter; static unsigned long offset; - char buf[SD_BLOCK_SIZE]; + char buf[BUF_SIZE]; static struct etimer et; int r, buflen; diff --git a/platform/msb430/cfs-coffee-arch.c b/platform/msb430/cfs-coffee-arch.c index 0db47488e..605ee79ff 100644 --- a/platform/msb430/cfs-coffee-arch.c +++ b/platform/msb430/cfs-coffee-arch.c @@ -45,7 +45,7 @@ int cfs_coffee_arch_erase(unsigned sector) { - char buf[SD_BLOCK_SIZE]; + char buf[SD_DEFAULT_BLOCK_SIZE]; sd_offset_t start_offset; sd_offset_t end_offset; sd_offset_t offset; @@ -55,7 +55,7 @@ cfs_coffee_arch_erase(unsigned sector) start_offset = COFFEE_START + sector * COFFEE_SECTOR_SIZE; end_offset = start_offset + COFFEE_SECTOR_SIZE; - for(offset = start_offset; offset < end_offset; offset += SD_BLOCK_SIZE) { + for(offset = start_offset; offset < end_offset; offset += SD_DEFAULT_BLOCK_SIZE) { if(sd_write(offset, buf, sizeof(buf)) < 0) { return -1; }