From 499e349afa57536ce80497aa99f61c5492e3733e Mon Sep 17 00:00:00 2001 From: "Nicolas \"Pixel\" Noble" Date: Sat, 29 Jan 2011 03:15:44 +0100 Subject: More filesystem stuff working. devfs is now in place with stdin, stdout, and stderr. --- demo.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'demo.c') diff --git a/demo.c b/demo.c index fd9b76a..cde181a 100644 --- a/demo.c +++ b/demo.c @@ -5,6 +5,7 @@ #include #include #include +#include #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); -- cgit v1.2.3