sgdk
|
User task support. More...
#include "task_cst.h"
Go to the source code of this file.
Functions | |
void | TSK_userSet (VoidCallback *task) |
Configure the user task callback function. Must be set with a not NULL callback before calling any TSK_xxx functions. | |
void | TSK_stop () |
Stop the user task. This has the same effect than using TSK_setUser(NULL). | |
void | TSK_userYield (void) |
Yield from supervisor task to user task. The user task will resume and will use all the available CPU time until the next vertical blanking interrupt, that will resume the supervisor task. | |
bool | TSK_superPend (s16 wait) |
Block supervisor task and resume user task. Supervisor task will not resume execution until TSK_superPost() is called from user task or a timeout happens.. | |
void | TSK_superPost (bool immediate) |
Resume a blocked supervisor task. Must be called from user task. |
User task support.
This module allows assigning a function that will run as an user task. CPU time is given to that function in several ways:
For the scheduler to work, VBlank interrupts must be enabled.
These functions are implemented in task.s
Block supervisor task and resume user task. Supervisor task will not resume execution until TSK_superPost() is called from user task or a timeout happens..
wait | Maximum number of frames to wait while blocking. Use TSK_PEND_FOREVER for an infinite wait, or a positive number (greater than 0) for a specific number of frames. |
void TSK_superPost | ( | bool | immediate | ) |
Resume a blocked supervisor task. Must be called from user task.
immediate | If true, immediately causes a context switch to supervisor task. If false, context switch will not occur until the VBLANK interrupt. |
void TSK_userSet | ( | VoidCallback * | task | ) |
Configure the user task callback function.
Must be set with a not NULL callback before calling any TSK_xxx functions.
task | A function pointer to the user task (or NULL to disable multitasking). |