21#define DOUBLE_STACK_COROUTINE_ARGUMENTS_BUFFER_SIZE 8
int resumeCoroutine()
Resume the coroutine.
void(* coroutine_function_t)(void *)
Definition: cs_DoubleStackCoroutine.h:31
#define DOUBLE_STACK_COROUTINE_ARGUMENTS_BUFFER_SIZE
This class implements a coroutine with its own stack.
Definition: cs_DoubleStackCoroutine.h:21
int initCoroutine(coroutine_function_t coroutineFunction, void *argument, uint8_t argumentSize, const uintptr_t ramEnd)
Initialize the coroutine.
void yieldCoroutine()
Yield the coroutine: resume in bluenet.
uint8_t * getCoroutineArgumentBuffer()
Get the coroutine argument buffer.
Struct with the context to jump between bluenet and coroutine.
Definition: cs_DoubleStackCoroutine.h:26
jmp_buf coroutineContext
Definition: cs_DoubleStackCoroutine.h:27
jmp_buf bluenetContext
Definition: cs_DoubleStackCoroutine.h:28
Struct with all the state we need for a coroutine.
Definition: cs_DoubleStackCoroutine.h:36
coroutine_t coroutine
Definition: cs_DoubleStackCoroutine.h:37
coroutine_function_t coroutineFunction
Definition: cs_DoubleStackCoroutine.h:38
void * oldStackPointer
Definition: cs_DoubleStackCoroutine.h:40