Verified Commit d2986026 authored by Rahix's avatar Rahix

fix(dispatcher): Initialize mutex before RTOS startup

Signed-off-by: Rahix's avatarRahix <rahix@rahix.de>
parent 3dd88fbb
Pipeline #3454 passed with stages
in 55 seconds
......@@ -13,14 +13,17 @@ TaskHandle_t dispatcher_task_id;
static StaticSemaphore_t api_mutex_data;
SemaphoreHandle_t api_mutex = NULL;
void dispatcher_mutex_init(void)
{
api_mutex = xSemaphoreCreateMutexStatic(&api_mutex_data);
}
/*
* API dispatcher task. This task will sleep until an API call is issued and
* then wake up to dispatch it.
*/
void vApiDispatcher(void *pvParameters)
{
api_mutex = xSemaphoreCreateMutexStatic(&api_mutex_data);
LOG_DEBUG("dispatcher", "Ready.");
while (1) {
if (api_dispatcher_poll()) {
......
......@@ -177,6 +177,11 @@ int hardware_early_init(void)
*/
hwlock_init();
/*
* API Dispatcher Mutex
*/
dispatcher_mutex_init();
return 0;
}
......
......@@ -9,6 +9,7 @@
/* ---------- Dispatcher --------------------------------------------------- */
void vApiDispatcher(void *pvParameters);
void dispatcher_mutex_init(void);
extern SemaphoreHandle_t api_mutex;
extern TaskHandle_t dispatcher_task_id;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment