fome-fw/firmware/controllers/scheduling/signal_executor.h

45 lines
1023 B
C
Raw Normal View History

2015-07-10 06:01:56 -07:00
/**
* @file signal_executor.h
* @brief Asynchronous output signal header
*
* @date Feb 10, 2013
2017-01-03 03:05:22 -08:00
* @author Andrey Belomutskiy, (c) 2012-2017
2015-07-10 06:01:56 -07:00
*/
2017-04-21 10:36:04 -07:00
#ifndef SIGNAL_EXECUTOR_H_
#define SIGNAL_EXECUTOR_H_
2015-07-10 06:01:56 -07:00
#include "global.h"
#include "scheduler.h"
2019-03-29 06:11:13 -07:00
#include "efi_gpio.h"
2015-07-10 06:01:56 -07:00
#if EFI_SIGNAL_EXECUTOR_SLEEP
#include "signal_executor_sleep.h"
#endif /* EFI_SIGNAL_EXECUTOR_SLEEP */
2016-11-30 15:02:19 -08:00
#define MAX_WIRES_COUNT 2
2016-11-30 19:06:43 -08:00
class InjectionEvent;
2017-05-24 04:57:58 -07:00
class InjectionSignalPair {
2016-09-26 18:03:18 -07:00
public:
2017-05-24 04:57:58 -07:00
InjectionSignalPair();
2016-09-26 18:03:18 -07:00
scheduling_s signalTimerUp;
scheduling_s signalTimerDown;
/**
* we need atomic flag so that we do not schedule a new pair of up/down before previous down was executed.
*
* That's because we want to be sure that no 'down' side callback would be ignored since we are counting to see
* overlaps so we need the end counter to always have zero.
* TODO: make watchdog decrement relevant counter
*/
bool isScheduled;
2017-05-15 19:02:57 -07:00
2016-11-30 15:02:19 -08:00
InjectorOutputPin *outputs[MAX_WIRES_COUNT];
2016-11-30 20:02:42 -08:00
2016-11-30 19:06:43 -08:00
InjectionEvent *event;
2016-09-26 18:03:18 -07:00
};
2017-04-21 10:36:04 -07:00
#endif /* SIGNAL_EXECUTOR_H_ */