Skip to content
Snippets Groups Projects
Verified Commit d2986026 authored by rahix's avatar rahix
Browse files

fix(dispatcher): Initialize mutex before RTOS startup


Signed-off-by: default avatarRahix <rahix@rahix.de>
parent 3dd88fbb
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment