mirror of
https://github.com/JorjBauer/aiie.git
synced 2024-11-04 19:07:22 +00:00
24 lines
1.1 KiB
C
24 lines
1.1 KiB
C
/* Filesystem compatability layer.
|
|
*
|
|
* Right now I've got a hokey (but well abstracted) g_filemanager object
|
|
* that has a bunch of file operation primitives which don't conform to
|
|
* POSIX at all. The woz code comes from my Wozzle utility, and I'd rather
|
|
* not butcher the heck out of it for the sake of Aiie... so this is
|
|
* bridging that gap, for now.
|
|
*/
|
|
|
|
#include "globals.h"
|
|
#include <Arduino.h>
|
|
|
|
#define open(path, flags, perms) g_filemanager->openFile(path)
|
|
#define close(filedes) g_filemanager->closeFile(filedes)
|
|
#define write(filedes,buf,nbyte) g_filemanager->write(filedes,buf,nbyte)
|
|
#define read(filedes,buf,nbyte) g_filemanager->read(filedes,buf,nbyte)
|
|
#define lseek(filedes,offset,whence) g_filemanager->lseek(filedes,offset,whence)
|
|
|
|
static char fsbuf[200];
|
|
#define printf(x, ...) {sprintf(fsbuf, x, ##__VA_ARGS__); Serial.println(fsbuf); Serial.flush(); Serial.send_now();}
|
|
#define fprintf(f, x, ...) {sprintf(fsbuf, x, ##__VA_ARGS__); Serial.println(fsbuf); Serial.flush(); Serial.send_now();}
|
|
#define perror(x) {Serial.println(x);Serial.flush(); Serial.send_now();}
|
|
|