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

33 lines
751 B
C
Raw Normal View History

2015-07-10 06:01:56 -07:00
/**
* @file scheduler.h
*
* @date May 18, 2014
2015-12-31 13:02:30 -08:00
* @author Andrey Belomutskiy, (c) 2012-2016
2015-07-10 06:01:56 -07:00
*/
#ifndef SCHEDULER_H_
#define SCHEDULER_H_
#include "main.h"
typedef void (*schfunc_t)(void *);
class scheduling_s {
public:
scheduling_s();
2016-01-24 23:03:01 -08:00
#if EFI_SIGNAL_EXECUTOR_SLEEP || defined(__DOXYGEN__)
2016-04-01 18:01:44 -07:00
virtual_timer_t timer;
2015-07-10 06:01:56 -07:00
#endif /* EFI_SIGNAL_EXECUTOR_SLEEP */
volatile efitime_t momentX;
schfunc_t callback;
void *param;
scheduling_s *next;
2016-01-11 14:01:33 -08:00
bool isScheduled;
2015-07-10 06:01:56 -07:00
};
2016-10-02 08:02:09 -07:00
void scheduleTask(const bool monitorReuse, const char *prefix, scheduling_s *scheduling, int delayUs, schfunc_t callback, void *param);
2015-07-10 06:01:56 -07:00
void scheduleByTime(const char *prefix, scheduling_s *scheduling, efitimeus_t time, schfunc_t callback, void *param);
#endif /* SCHEDULER_H_ */