Reduced application buffer size for SD and switched parameter in cfs-coffee-arch.c

This commit is contained in:
nvt-se 2009-11-11 14:59:33 +00:00
parent 27bca64fe0
commit b909a62265
2 changed files with 6 additions and 4 deletions

View file

@ -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;

View file

@ -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;
}