rusefi-1/firmware/controllers/system/scheduler.h

36 lines
731 B
C
Raw Normal View History

2015-07-10 06:01:56 -07:00
/**
* @file scheduler.h
*
* @date May 18, 2014
2017-01-03 03:05:22 -08:00
* @author Andrey Belomutskiy, (c) 2012-2017
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
};
2017-11-26 21:05:54 -08:00
/**
* see also scheduleByAngle
*/
2018-01-28 08:27:33 -08:00
void scheduleForLater(scheduling_s *scheduling, int delayUs, schfunc_t callback, void *param);
void scheduleByTimestamp(scheduling_s *scheduling, efitimeus_t time, schfunc_t callback, void *param);
2015-07-10 06:01:56 -07:00
#endif /* SCHEDULER_H_ */