summaryrefslogtreecommitdiff
path: root/demo.c
diff options
context:
space:
mode:
authorNicolas "Pixel" Noble <pixel@nobis-crew.org>2011-01-29 03:15:44 +0100
committerNicolas "Pixel" Noble <pixel@nobis-crew.org>2011-01-29 03:15:44 +0100
commit499e349afa57536ce80497aa99f61c5492e3733e (patch)
treefe3308c344659e800172cfaad9793918f24ae4b1 /demo.c
parent5754656f65205ff1fd9b23c2a85778b3671caf68 (diff)
More filesystem stuff working. devfs is now in place with stdin, stdout, and stderr.
Diffstat (limited to 'demo.c')
-rw-r--r--demo.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/demo.c b/demo.c
index fd9b76a..cde181a 100644
--- a/demo.c
+++ b/demo.c
@@ -5,6 +5,7 @@
#include <BoardConsole.h>
#include <osdebug.h>
#include <stdio.h>
+#include <fio.h>
#define LED1_wire 18
#define LED2_wire 20
@@ -59,9 +60,18 @@ static void badTask(void *x) {
*p = 42;
}
+static const char msg[] = "Hello world - from fwrite!\r\n";
+
int main() {
+ FILE * f;
+ register_devfs();
handle = xSemaphoreCreateMutex();
printf("Hello world - from stdio!\r\n");
+ fflush(stdout);
+ f = fopen("/dev/stdout", "w");
+ fwrite(msg, 1, sizeof(msg), f);
+ fflush(f);
+ fclose(f);
setupLEDs();
litLED(1, 0);
litLED(2, 0);