Ivo van Poorten
/
opus-una
A Small Cooperative Multitasking Kernel
Diff: tasks-printf-c.h
- Revision:
- 0:73b89fc74e9f
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tasks-printf-c.h Sun Jul 24 17:15:42 2011 +0000 @@ -0,0 +1,32 @@ +#include "kernel.h" +#include <stdio.h> + +static void task_zero(void); +static void task_one(void); + +struct ou_task ou_tasks[] = { + { task_zero, 2, 0, 0, 0, NULL }, + { task_one, 1, 0, 0, 0, NULL } +}; + +const unsigned ou_ntasks = sizeof(ou_tasks)/sizeof(struct ou_task); + +OU_TASK(task_zero) + OU_WAIT(100); + printf("hello\r\n"); + OU_WAIT(100); + printf("world\r\n"); +OU_ENDTASK + +OU_TASK(task_one) + OU_WAIT(100); + printf("goodbye\r\n"); + OU_WAIT(100); + printf("cruel\r\n"); + OU_WAIT(100); + printf("world...\r\n"); + for(;;) { + OU_WAIT(50); + printf("loop\r\n"); + } +OU_ENDTASK \ No newline at end of file