summaryrefslogtreecommitdiff
path: root/demo.c
diff options
context:
space:
mode:
authorPixel <pixel@nobis-crew.org>2011-02-02 08:35:38 -0800
committerPixel <pixel@nobis-crew.org>2011-02-02 08:35:38 -0800
commit3ca9b28c5b04220565c206bd73d9ebb48b64db3b (patch)
tree86ffbb085f2c255de44321c858780c77dc7583d8 /demo.c
parent29dc401e5ba2c3f5676d426c4c1b10f1fc475fcd (diff)
Making a sample code for the 'romfs' thingy.
Diffstat (limited to 'demo.c')
-rw-r--r--demo.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/demo.c b/demo.c
index fbf2b26..d106f63 100644
--- a/demo.c
+++ b/demo.c
@@ -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);