rusefi-1/firmware/controllers/system/timer/single_timer_executor.h

37 lines
1.0 KiB
C
Raw Normal View History

2015-07-10 06:01:56 -07:00
/**
2019-03-29 06:11:13 -07:00
* @file single_timer_executor.h
2015-07-10 06:01:56 -07:00
*
* @date: Apr 18, 2014
2020-01-13 18:57:43 -08:00
* @author Andrey Belomutskiy, (c) 2012-2020
2015-07-10 06:01:56 -07:00
*/
2020-01-20 22:40:11 -08:00
#pragma once
2015-07-10 06:01:56 -07:00
#include "scheduler.h"
#include "event_queue.h"
class SingleTimerExecutor final : public ExecutorInterface {
2015-07-10 06:01:56 -07:00
public:
SingleTimerExecutor();
void scheduleByTimestamp(const char *msg, scheduling_s *scheduling, efitimeus_t timeUs, action_s action) override;
void scheduleByTimestampNt(const char *msg, scheduling_s *scheduling, efitime_t timeNt, action_s action) override;
void scheduleForLater(const char *msg, scheduling_s *scheduling, int delayUs, action_s action) override;
void cancel(scheduling_s* scheduling) override;
2015-07-10 06:01:56 -07:00
void onTimerCallback();
int timerCallbackCounter = 0;
int scheduleCounter = 0;
int maxExecuteCounter = 0;
int executeCounter;
int executeAllPendingActionsInvocationCounter = 0;
2015-07-10 06:01:56 -07:00
private:
EventQueue queue;
bool reentrantFlag = false;
void executeAllPendingActions();
2015-07-10 06:01:56 -07:00
void scheduleTimerCallback();
};
2019-02-27 14:12:52 -08:00
void initSingleTimerExecutorHardware(void);
2017-06-07 19:55:05 -07:00
void executorStatistics();
2015-07-10 06:01:56 -07:00