Reduced application buffer size for SD and switched parameter in cfs-coffee-arch.c
This commit is contained in:
parent
27bca64fe0
commit
b909a62265
|
@ -28,7 +28,7 @@
|
||||||
*
|
*
|
||||||
* This file is part of the Contiki operating system.
|
* 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");
|
PROCESS(sd_test, "SD test process");
|
||||||
AUTOSTART_PROCESSES(&sd_test);
|
AUTOSTART_PROCESSES(&sd_test);
|
||||||
|
|
||||||
|
#define BUF_SIZE 64
|
||||||
|
|
||||||
PROCESS_THREAD(sd_test, event, data)
|
PROCESS_THREAD(sd_test, event, data)
|
||||||
{
|
{
|
||||||
static unsigned long iter;
|
static unsigned long iter;
|
||||||
static unsigned long offset;
|
static unsigned long offset;
|
||||||
char buf[SD_BLOCK_SIZE];
|
char buf[BUF_SIZE];
|
||||||
static struct etimer et;
|
static struct etimer et;
|
||||||
int r, buflen;
|
int r, buflen;
|
||||||
|
|
||||||
|
|
|
@ -45,7 +45,7 @@
|
||||||
int
|
int
|
||||||
cfs_coffee_arch_erase(unsigned sector)
|
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 start_offset;
|
||||||
sd_offset_t end_offset;
|
sd_offset_t end_offset;
|
||||||
sd_offset_t offset;
|
sd_offset_t offset;
|
||||||
|
@ -55,7 +55,7 @@ cfs_coffee_arch_erase(unsigned sector)
|
||||||
start_offset = COFFEE_START + sector * COFFEE_SECTOR_SIZE;
|
start_offset = COFFEE_START + sector * COFFEE_SECTOR_SIZE;
|
||||||
end_offset = start_offset + 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) {
|
if(sd_write(offset, buf, sizeof(buf)) < 0) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue