From 3ca9b28c5b04220565c206bd73d9ebb48b64db3b Mon Sep 17 00:00:00 2001 From: Pixel Date: Wed, 2 Feb 2011 08:35:38 -0800 Subject: Making a sample code for the 'romfs' thingy. --- demo.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'demo.c') diff --git a/demo.c b/demo.c index fbf2b26..d106f63 100644 --- a/demo.c +++ b/demo.c @@ -7,6 +7,7 @@ #include #include #include +#include #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); -- cgit v1.2.3