Thread emulation layer provides RTOS-like thread abstraction on top of Contiki protothreads. The threads use a common physical call stack, exactly like the Contiki protothreads do, but the stack content can be saved in an external buffer at thread yield. The stored stack state can be restored later, emulating resuming of the thread. In general it resembles setjmp() / longjmp() semantic, but with addition to stack snapshoting and "return to jump point" functionality.
#define EVE_THREAD_EMBEDDED_CSTATE 0 |
Normally disabled, reduces static RAM usage but increrases dynaamic one and CPU clocks required.
Definition at line 62 of file thread.h.
#define EVE_THREAD_FPU_SUPPORT 1 |
Normally enabled, allows FPU usage in the treads
Definition at line 68 of file thread.h.
#define THREAD_CPU_REGISTERS_COUNT (16 + 9) /* {s16-s31, r4-r11, r15} */ |
Number of registers stored in the context
Definition at line 75 of file thread.h.
uint32_t ThreadBegin |
( |
struct thread_t * |
Thread | ) |
|
Starts or resumes thread execution
- Parameters
-
Thread | pointer to the thread instance |
void ThreadYield |
( |
struct thread_t * |
Thread, |
|
|
uint32_t |
Value |
|
) |
| |
Yields the thread and returns control to the return of ThreadBegin
- Parameters
-
Thread | pointer to the thread instance |
Value | value to be passed as the return code of ThreadBegin |
void ThreadEnd |
( |
struct thread_t * |
Thread | ) |
|
Ends the thread ans deallocates stack from the stack pool
- Parameters
-
Thread | pointer to the thread instance |