|
Lamp-Da 0.1
A compact lantern project
|
Define low level thread behavior and handling. More...
Typedefs | |
| typedef void * | TaskHandle_t |
| typedef uint32_t | TaskBuffer_t |
| typedef void(* | taskfunc_t) (void) |
| model of a task function | |
Functions | |
| const char *const | get_name_from_hash (const uint32_t hash) |
| void | start_thread (taskfunc_t taskFunction, const uint32_t taskName, const int priority, const int stackSize, TaskBuffer_t *buffer) |
| Start a separate thread, running until the system shuts off. | |
| void | start_suspended_thread (taskfunc_t taskFunction, const uint32_t taskName, const int priority, const int stackSize, TaskBuffer_t *buffer) |
| Start a separate thread, running until the system shuts off. Start in suspended state. | |
| void | yield_this_thread () |
| make this thread pass the control to other threads | |
| void | suspend_this_thread () |
| threads can only suspend itself | |
| void | resume_thread (const uint32_t taskName) |
| resume a target thread | |
| uint16_t | get_usage_percent (const uint32_t taskName) |
| Get the stack usage of this task, in percent. | |
| void | notify_thread (const uint32_t taskName, int wakeUpEvent) |
| notify a thread to resume | |
| int | wait_notification (const int timeout_ms) |
| block this thread until a timeout or notification is received | |
| void | display_thread_debug () |
| void | shutdown () |
| Shutdown the task driver cleanly. | |
Variables | |
| const uint32_t | pd_taskName = utils::hash("usbpd") |
| name of the USB power delivery task | |
| const uint32_t | pdInterruptHandle_taskName = utils::hash("intpd") |
| name of the USB power delivery interrupt handle task | |
| const uint32_t | button_taskName = utils::hash("button") |
| const uint32_t | power_taskName = utils::hash("power") |
| name of the main power task | |
| const uint32_t | user_taskName = utils::hash("user") |
| name of the optional user task | |
| const uint32_t | taskScheduler_taskName = utils::hash("task_sched") |
| name of the task scheduling task | |
| const uint32_t | sunset_taskName = utils::hash("sunset") |
| name of the task schedule sunset | |
| const uint32_t | ble_cli_taskName = utils::hash("ble_cli") |
| BLE cli queue. | |
| const uint32_t | print_taskName = utils::hash("print") |
| UART print task. | |
Define low level thread behavior and handling.
| uint16_t lampda::bsp::threads::get_usage_percent | ( | const uint32_t | taskName | ) |
Get the stack usage of this task, in percent.
| void lampda::bsp::threads::notify_thread | ( | const uint32_t | taskName, |
| int | wakeUpEvent | ||
| ) |
notify a thread to resume
| [in] | taskName | target task name |
| [in] | wakeUpEvent | type of the event to send |
| void lampda::bsp::threads::resume_thread | ( | const uint32_t | taskName | ) |
resume a target thread
| [in] | taskName | target task name |
| void lampda::bsp::threads::start_suspended_thread | ( | taskfunc_t | taskFunction, |
| const uint32_t | taskName, | ||
| const int | priority, | ||
| const int | stackSize, | ||
| TaskBuffer_t * | buffer | ||
| ) |
Start a separate thread, running until the system shuts off. Start in suspended state.
| taskFunction | the function to run | |
| [in] | taskName | The name associated |
| [in] | priority | from to 2, this thread priority |
| [in] | stackSize | The size of the stack to allocate. can be ignored and checked while running using the command line |
| [in,out] | buffer | Buffer for this task |
| void lampda::bsp::threads::start_thread | ( | taskfunc_t | taskFunction, |
| const uint32_t | taskName, | ||
| const int | priority, | ||
| const int | stackSize, | ||
| TaskBuffer_t * | buffer | ||
| ) |
Start a separate thread, running until the system shuts off.
| taskFunction | the function to run | |
| [in] | taskName | The name associated |
| [in] | priority | from to 2, this thread priority |
| [in] | stackSize | The size of the stack to allocate. can be ignored and checked while running using the command line |
| [in,out] | buffer | Buffer for this task |
| int lampda::bsp::threads::wait_notification | ( | const int | timeout_ms | ) |
block this thread until a timeout or notification is received
| [in] | timeout_ms | Timeout delay. Can be zero of less for no timeout |