16 #include "lib/random.h"
21 PROCESS(listcoffee_process,
"CFS/Coffee process");
22 AUTOSTART_PROCESSES(&listcoffee_process);
27 struct cfs_dirent dirent;
41 printf(
"formatted flash\n");
43 sprintf(filename,
"f%d",count);
47 printf(
"Failed to open file %s for writing\n", filename);
51 bytes = cfs_write(fd, buf, bufsize);
53 if (bytes != bufsize) {
54 printf(
"Failed to write file to %s, wrote %d bytes\n", filename, bytes);
59 printf(
"%d\n",count++);
int cfs_open(const char *name, int flags)
Open a file.
#define CFS_WRITE
Specify that cfs_open() should open a file for writing.
void cfs_close(int fd)
Close an open file.
#define PROCESS_END()
Define the end of a process.
#define PROCESS(name, strname)
Declare a process.
#define PROCESS_THREAD(name, ev, data)
Define the body of a process.
int cfs_coffee_format(void)
Format the storage area assigned to Coffee.
static volatile clock_time_t count
These routines define the AVR-specific calls declared in /core/sys/clock.h CLOCK_SECOND is the number...
Header for the Coffee file system.
Header file for the CRC16 calculcation
#define PROCESS_BEGIN()
Define the beginning of a process.