2019-07-09 05:33:40 -07:00
|
|
|
/*
|
|
|
|
* @file periodic_task.cpp
|
|
|
|
*
|
|
|
|
* @date: Jul 8, 2019
|
2020-01-07 21:02:40 -08:00
|
|
|
* @author Andrey Belomutskiy, (c) 2012-2020
|
2019-07-09 05:33:40 -07:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "periodic_task.h"
|
|
|
|
#include "os_util.h"
|
2019-10-11 17:43:21 -07:00
|
|
|
#include "perf_trace.h"
|
2019-07-09 05:33:40 -07:00
|
|
|
|
|
|
|
void runAndScheduleNext(PeriodicTimerController *controller) {
|
|
|
|
#if !EFI_UNIT_TEST
|
2019-10-11 17:43:21 -07:00
|
|
|
{
|
|
|
|
ScopePerf perf(PE::PeriodicTimerControllerPeriodicTask);
|
|
|
|
controller->PeriodicTask();
|
|
|
|
}
|
|
|
|
|
2019-07-09 05:33:40 -07:00
|
|
|
chVTSetAny(&controller->timer, TIME_MS2I(controller->getPeriodMs()), (vtfunc_t) &runAndScheduleNext, controller);
|
|
|
|
#endif /* EFI_UNIT_TEST */
|
|
|
|
}
|