Verified Commit c0ba5e0c authored by Rahix's avatar Rahix
Browse files

fix(max30001): Initialize mutex before RTOS startup


Signed-off-by: Rahix's avatarRahix <rahix@rahix.de>
parent 2d277ef0
......@@ -182,6 +182,11 @@ int hardware_early_init(void)
*/
dispatcher_mutex_init();
/*
* MAX30001 mutex init
*/
max30001_mutex_init();
return 0;
}
......
......@@ -370,10 +370,14 @@ static void max300001_interrupt_callback(void *_)
}
/* }}} */
void max30001_mutex_init(void)
{
max30001_mutex = xSemaphoreCreateMutexStatic(&max30001_mutex_data);
}
void vMAX30001Task(void *pvParameters)
{
max30001_task_id = xTaskGetCurrentTaskHandle();
max30001_mutex = xSemaphoreCreateMutexStatic(&max30001_mutex_data);
int lockret = hwlock_acquire(HWLOCK_SPI_ECG, pdMS_TO_TICKS(100));
if (lockret < 0) {
......
......@@ -92,7 +92,9 @@ void disp_forcelock();
#define BHI160_MUTEX_WAIT_MS 50
void vBhi160Task(void *pvParameters);
/* ---------- MAX30001 ----------------------------------------------------- */
#define MAX30001_MUTEX_WAIT_MS 50
void vMAX30001Task(void *pvParameters);
void max30001_mutex_init(void);
#endif /* MODULES_H */
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