Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: coos.h
- Revision:
- 2:360f136fabaa
- Child:
- 4:690def0f4387
diff -r 03c191369089 -r 360f136fabaa coos.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/coos.h Mon Sep 16 11:40:39 2013 +0000 @@ -0,0 +1,35 @@ +#ifndef __COOS_H +#define __COOS_H + +//########################################################## +// Common includes +//########################################################## + +#include <setjmp.h> + +//########################################################## +// def & enum +//########################################################## +enum{ + MAX_TASKS = 8, + STOP = -2 +}; + +#define DELAY(__delay) if (!setjmp(COOS_task_context[COOS_task_no])) {longjmp(COOS_main_context, __delay+1);} else + +//########################################################## +// var +//########################################################## + +extern jmp_buf COOS_main_context; +extern jmp_buf COOS_task_context[MAX_TASKS]; /* store environment for all tasks */ +extern volatile uchar COOS_task_no; + +//########################################################## +// func +//########################################################## + +void shutdown_task(uchar task_No); +void wake_up_task(uchar task_No); + +#endif /* __COOS_H */