rusefi-1/firmware/controllers/scheduling/single_timer_executor.h

34 lines
822 B
C++

/**
* @file single_timer_executor.h
*
* @date: Apr 18, 2014
* @author Andrey Belomutskiy, (c) 2012-2017
*/
#ifndef SINGLETIMEREXECUTOR_H_
#define SINGLETIMEREXECUTOR_H_
#include "scheduler.h"
#include "event_queue.h"
class SingleTimerExecutor : public ExecutorInterface {
public:
SingleTimerExecutor();
void scheduleByTimestamp(scheduling_s *scheduling, efitimeus_t timeUs, schfunc_t callback, void *param);
void scheduleForLater(scheduling_s *scheduling, int delayUs, schfunc_t callback, void *param);
void onTimerCallback();
int timerCallbackCounter;
int scheduleCounter;
int doExecuteCounter;
private:
EventQueue queue;
bool reentrantFlag;
void doExecute();
void scheduleTimerCallback();
};
void initSingleTimerExecutorHardware(void);
void executorStatistics();
#endif /* SINGLETIMEREXECUTOR_H_ */