diff options
| author | Nicolas "Pixel" Noble <pixel@nobis-crew.org> | 2011-01-29 03:15:44 +0100 | 
|---|---|---|
| committer | Nicolas "Pixel" Noble <pixel@nobis-crew.org> | 2011-01-29 03:15:44 +0100 | 
| commit | 499e349afa57536ce80497aa99f61c5492e3733e (patch) | |
| tree | fe3308c344659e800172cfaad9793918f24ae4b1 /demo.c | |
| parent | 5754656f65205ff1fd9b23c2a85778b3671caf68 (diff) | |
More filesystem stuff working. devfs is now in place with stdin, stdout, and stderr.
Diffstat (limited to 'demo.c')
| -rw-r--r-- | demo.c | 10 | 
1 files changed, 10 insertions, 0 deletions
@@ -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);  | 
