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

40 lines
838 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-09-13 05:02:58 -07:00
void schedule(const char *prefix, scheduling_s *scheduling, uint64_t nowUs, int delayUs, schfunc_t callback, void *param);
2014-09-13 11:02:53 -07:00
void schedule2(const char *prefix, scheduling_s *scheduling, uint64_t timeUs, schfunc_t callback, void *param);
2014-09-14 12:10:57 -07:00
void onTimerCallback(uint64_t nowUs);
2014-08-29 07:52:33 -07:00
private:
EventQueue queue;
bool reentrantLock;
void doExecute(uint64_t nowUs);
void lock(void);
void unlock(void);
};
#ifdef __cplusplus
extern "C"
{
#endif /* __cplusplus */
void initSignalExecutorImpl(void);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* SINGLETIMEREXECUTOR_H_ */