switched to emulated random I/O functions in the SD driver
This commit is contained in:
parent
1fb5841454
commit
12c6dbb7c6
|
@ -49,7 +49,6 @@ cfs_coffee_arch_erase(unsigned sector)
|
||||||
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;
|
||||||
int r;
|
|
||||||
|
|
||||||
memset(buf, 0, sizeof(buf));
|
memset(buf, 0, sizeof(buf));
|
||||||
|
|
||||||
|
@ -57,7 +56,7 @@ cfs_coffee_arch_erase(unsigned sector)
|
||||||
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_BLOCK_SIZE) {
|
||||||
if(sd_rio_write(offset, buf, sizeof(buf)) < 0) {
|
if(sd_write(offset, buf, sizeof(buf)) < 0) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,7 +41,7 @@
|
||||||
#define CFS_COFFEE_ARCH_H
|
#define CFS_COFFEE_ARCH_H
|
||||||
|
|
||||||
#include "contiki-conf.h"
|
#include "contiki-conf.h"
|
||||||
#include "dev/sd_rio.h"
|
#include "dev/sd.h"
|
||||||
|
|
||||||
/* Coffee configuration parameters. */
|
/* Coffee configuration parameters. */
|
||||||
#define COFFEE_SECTOR_SIZE (10*1024*1024UL)
|
#define COFFEE_SECTOR_SIZE (10*1024*1024UL)
|
||||||
|
@ -59,10 +59,10 @@
|
||||||
|
|
||||||
/* Flash operations. */
|
/* Flash operations. */
|
||||||
#define COFFEE_WRITE(buf, size, offset) \
|
#define COFFEE_WRITE(buf, size, offset) \
|
||||||
sd_rio_write(COFFEE_START + (offset), (char *)(buf), (size))
|
sd_write(COFFEE_START + (offset), (char *)(buf), (size))
|
||||||
|
|
||||||
#define COFFEE_READ(buf, size, offset) \
|
#define COFFEE_READ(buf, size, offset) \
|
||||||
sd_rio_read(COFFEE_START + (offset), (char *)buf, (size))
|
sd_read(COFFEE_START + (offset), (char *)buf, (size))
|
||||||
|
|
||||||
#define COFFEE_ERASE(sector) \
|
#define COFFEE_ERASE(sector) \
|
||||||
cfs_coffee_arch_erase(sector)
|
cfs_coffee_arch_erase(sector)
|
||||||
|
|
Loading…
Reference in a new issue