Commit 495d11ad authored by Clément Foucher's avatar Clément Foucher
Browse files

Separate the task start as this causes issued with task starting while drivers init not completed.

parent 88e9fe34
......@@ -38,6 +38,7 @@
#define TIMER6_LABEL DT_PROP(DT_NODELABEL(timers6), label)
static const struct device* timer6 = NULL;
static uint32_t period;
/////
// Private functions
......@@ -53,8 +54,7 @@ static void _opalib_init_task(void (*periodic_task)(), uint32_t task_period_us)
};
timer_config(timer6, &timer_cfg);
// Launch task by starting timer
timer_start(timer6, task_period_us);
period = task_period_us;
}
/////
......@@ -99,3 +99,8 @@ void opalib_quick_start_init_current(void (*periodic_task)(), uint32_t task_peri
_opalib_init_task(periodic_task, task_period_us);
}
}
void opalib_quick_start_launch_task()
{
timer_start(timer6, period);
}
\ No newline at end of file
......@@ -67,6 +67,11 @@ void opalib_quick_start_init_voltage(void (*periodic_task)(), uint32_t task_peri
*/
void opalib_quick_start_init_current(void (*periodic_task)(), uint32_t task_period_us);
/**
* @brief Begins the periodic run of the task.
*/
void opalib_quick_start_launch_task();
#ifdef __cplusplus
}
#endif
......
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