fome-fw/firmware/controllers/system/SingleTimerExecutor.h

38 lines
732 B
C
Raw Normal View History

2014-08-29 07:52:33 -07:00
/**
* @file SingleTimerExecutor.h
*
* @date: Apr 18, 2014
* @author Andrey Belomutskiy, (c) 2012-2014
*/
#ifndef SINGLETIMEREXECUTOR_H_
#define SINGLETIMEREXECUTOR_H_
#include "scheduler.h"
#include "event_queue.h"
class Executor {
public:
Executor();
2014-11-17 16:03:26 -08:00
void schedule(scheduling_s *scheduling, uint64_t nowUs, int delayUs, schfunc_t callback, void *param);
void schedule2(scheduling_s *scheduling, uint64_t timeUs, schfunc_t callback, void *param);
2014-09-14 13:04:20 -07:00
void onTimerCallback();
2014-08-29 07:52:33 -07:00
private:
EventQueue queue;
2014-11-25 13:03:16 -08:00
bool reentrantFlag;
2014-09-14 13:04:20 -07:00
void doExecute();
2014-08-29 07:52:33 -07:00
};
#ifdef __cplusplus
extern "C"
{
#endif /* __cplusplus */
void initSignalExecutorImpl(void);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* SINGLETIMEREXECUTOR_H_ */