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);
62 printf(
"Wrote to filesystem: '%s'\n", buf);
74 printf(
"Read from filesystem: '%s'\n", buf);
#define PROCESS(name, strname)
Declare a process.
#define PROCESS_BEGIN()
Define the beginning 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.
int cfs_open(const char *name, int flags)
Open a file.
#define CLOCK_SECOND
A second, measured in system clock time.
cfs_offset_t cfs_seek(int fd, cfs_offset_t offset, int whence)
Seek to a specified position in an open file.
int cfs_write(int fd, const void *buf, unsigned int len)
Write data to an open file.
int etimer_expired(struct etimer *et)
Check if an event timer has expired.
void cfs_close(int fd)
Close an open file.
int cfs_read(int fd, void *buf, unsigned int len)
Read data from an open file.
#define CFS_READ
Specify that cfs_open() should open a file for reading.
#define CFS_SEEK_SET
Specify that cfs_seek() should compute the offset from the beginning of the file. ...
#define CFS_WRITE
Specify that cfs_open() should open a file for writing.
PROCESS_THREAD(cc2538_rf_process, ev, data)
Implementation of the cc2538 RF driver process.
void etimer_set(struct etimer *et, clock_time_t interval)
Set an event timer.