33 #include "sys/clock.h"
38 PROCESS(test_cfs_process,
"Test CFS process");
39 AUTOSTART_PROCESSES(&test_cfs_process);
45 static uint16_t counter;
50 printf(
"Starting CFS test process\n");
57 sprintf(buf,
"filedata%04ifiledata%04i", counter, counter);
60 cfs_write(fd, buf, 24);
62 printf(
"Wrote to filesystem: '%s'\n", buf);
71 cfs_read(fd, buf, 12);
74 printf(
"Read from filesystem: '%s'\n", buf);
int etimer_expired(struct etimer *et)
Check if an event timer has expired.
int cfs_open(const char *name, int flags)
Open a file.
cfs_offset_t cfs_seek(int fd, cfs_offset_t offset, int whence)
Seek to a specified position in an open file.
#define PROCESS_BEGIN()
Define the beginning of a process.
#define CFS_WRITE
Specify that cfs_open() should open a file for writing.
#define CFS_READ
Specify that cfs_open() should open a file for reading.
#define PROCESS_THREAD(name, ev, data)
Define the body of a process.
#define PROCESS_END()
Define the end of a process.
#define PROCESS_WAIT_EVENT_UNTIL(c)
Wait for an event to be posted to the process, with an extra condition.
#define PROCESS(name, strname)
Declare a process.
void etimer_set(struct etimer *et, clock_time_t interval)
Set an event timer.
#define CFS_SEEK_SET
Specify that cfs_seek() should compute the offset from the beginning of the file. ...
void cfs_close(int fd)
Close an open file.
#define CLOCK_SECOND
A second, measured in system clock time.