diff options
author | Pixel <pixel@nobis-crew.org> | 2011-02-02 08:35:38 -0800 |
---|---|---|
committer | Pixel <pixel@nobis-crew.org> | 2011-02-02 08:35:38 -0800 |
commit | 3ca9b28c5b04220565c206bd73d9ebb48b64db3b (patch) | |
tree | 86ffbb085f2c255de44321c858780c77dc7583d8 /demo.c | |
parent | 29dc401e5ba2c3f5676d426c4c1b10f1fc475fcd (diff) |
Making a sample code for the 'romfs' thingy.
Diffstat (limited to 'demo.c')
-rw-r--r-- | demo.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -7,6 +7,7 @@ #include <stdio.h> #include <fio.h> #include <romfs.h> +#include <semifs.h> #define LED1_wire 18 #define LED2_wire 20 @@ -66,10 +67,11 @@ static const char msg[] = "Hello world - from fwrite!\r\n"; extern uint8_t _binary_test_romfs_bin_start[]; int main() { - FILE * f1, * f2; + FILE * f1, * f2, * f3; char buf[32]; int c; register_devfs(); + register_semifs(); register_romfs("romfs", _binary_test_romfs_bin_start); handle = xSemaphoreCreateMutex(); printf("Hello world - from stdio!\r\n"); @@ -79,9 +81,13 @@ int main() { f2 = fopen("/romfs/test.txt", "r"); c = fread(buf, 1, 32, f2); fwrite(buf, 1, c, f1); + f3 = fopen("/host/TEST.TXT", "r"); + c = fread(buf, 1, 32, f3); + fwrite(buf, 1, c, f1); fflush(f1); fclose(f1); fclose(f2); + fclose(f3); setupLEDs(); litLED(1, 0); litLED(2, 0); |