diff options
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); |