docs & refactoring
This commit is contained in:
parent
5bf399e280
commit
cd1e87ff41
|
@ -6,8 +6,7 @@
|
||||||
* @author Andrey Belomutskiy, (c) 2012-2017
|
* @author Andrey Belomutskiy, (c) 2012-2017
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef ENGINE_STATE_H_
|
#pragma once
|
||||||
#define ENGINE_STATE_H_
|
|
||||||
|
|
||||||
#include "global.h"
|
#include "global.h"
|
||||||
#include "engine_parts.h"
|
#include "engine_parts.h"
|
||||||
|
@ -103,9 +102,5 @@ public:
|
||||||
MockAdcState mockAdcState;
|
MockAdcState mockAdcState;
|
||||||
#endif /* EFI_ENABLE_MOCK_ADC */
|
#endif /* EFI_ENABLE_MOCK_ADC */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#endif /* ENGINE_STATE_H_ */
|
|
||||||
|
|
|
@ -5,8 +5,7 @@
|
||||||
* @author Andrey Belomutskiy, (c) 2012-2017
|
* @author Andrey Belomutskiy, (c) 2012-2017
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef EVENT_REGISTRY_H_
|
#pragma once
|
||||||
#define EVENT_REGISTRY_H_
|
|
||||||
|
|
||||||
#include "global.h"
|
#include "global.h"
|
||||||
#include "signal_executor.h"
|
#include "signal_executor.h"
|
||||||
|
@ -73,5 +72,3 @@ public:
|
||||||
IgnitionEvent elements[MAX_IGNITION_EVENT_COUNT];
|
IgnitionEvent elements[MAX_IGNITION_EVENT_COUNT];
|
||||||
bool isReady;
|
bool isReady;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* EVENT_REGISTRY_H_ */
|
|
||||||
|
|
|
@ -5,8 +5,7 @@
|
||||||
* @author Andrey Belomutskiy, (c) 2012-2017
|
* @author Andrey Belomutskiy, (c) 2012-2017
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef FUEL_MAP_H_
|
#pragma once
|
||||||
#define FUEL_MAP_H_
|
|
||||||
|
|
||||||
#include "engine.h"
|
#include "engine.h"
|
||||||
|
|
||||||
|
@ -40,5 +39,3 @@ percent_t getInjectorDutyCycle(int rpm DECLARE_ENGINE_PARAMETER_SUFFIX);
|
||||||
|
|
||||||
// convert injection duration (Ms/Nt) to fuel rate (L/h)
|
// convert injection duration (Ms/Nt) to fuel rate (L/h)
|
||||||
float getFuelRate(floatms_t totalInjDuration, efitick_t timePeriod DECLARE_ENGINE_PARAMETER_SUFFIX);
|
float getFuelRate(floatms_t totalInjDuration, efitick_t timePeriod DECLARE_ENGINE_PARAMETER_SUFFIX);
|
||||||
|
|
||||||
#endif /* FUEL_MAP_H_ */
|
|
||||||
|
|
|
@ -4,22 +4,30 @@
|
||||||
* @date May 18, 2014
|
* @date May 18, 2014
|
||||||
* @author Andrey Belomutskiy, (c) 2012-2017
|
* @author Andrey Belomutskiy, (c) 2012-2017
|
||||||
*/
|
*/
|
||||||
#ifndef SCHEDULER_H_
|
#pragma once
|
||||||
#define SCHEDULER_H_
|
|
||||||
|
|
||||||
#include "global.h"
|
#include "global.h"
|
||||||
|
|
||||||
typedef void (*schfunc_t)(void *);
|
typedef void (*schfunc_t)(void *);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This structure holds information about an event scheduled in the future: when to execute what callback with what parameters
|
||||||
|
*/
|
||||||
class scheduling_s {
|
class scheduling_s {
|
||||||
public:
|
public:
|
||||||
#if EFI_SIGNAL_EXECUTOR_SLEEP
|
#if EFI_SIGNAL_EXECUTOR_SLEEP
|
||||||
virtual_timer_t timer;
|
virtual_timer_t timer;
|
||||||
#endif /* EFI_SIGNAL_EXECUTOR_SLEEP */
|
#endif /* EFI_SIGNAL_EXECUTOR_SLEEP */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* timestamp represented as 64-bit value of ticks since MCU start
|
||||||
|
*/
|
||||||
volatile efitime_t momentX = 0;
|
volatile efitime_t momentX = 0;
|
||||||
bool isScheduled = false;
|
bool isScheduled = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Scheduler implementation has a linked list of these scheduling records.
|
||||||
|
*/
|
||||||
scheduling_s *next = nullptr;
|
scheduling_s *next = nullptr;
|
||||||
|
|
||||||
schfunc_t callback = nullptr;
|
schfunc_t callback = nullptr;
|
||||||
|
@ -34,5 +42,3 @@ public:
|
||||||
virtual void scheduleByTimestamp(scheduling_s *scheduling, efitimeus_t timeUs, schfunc_t callback, void *param) = 0;
|
virtual void scheduleByTimestamp(scheduling_s *scheduling, efitimeus_t timeUs, schfunc_t callback, void *param) = 0;
|
||||||
virtual void scheduleForLater(scheduling_s *scheduling, int delayUs, schfunc_t callback, void *param) = 0;
|
virtual void scheduleForLater(scheduling_s *scheduling, int delayUs, schfunc_t callback, void *param) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* SCHEDULER_H_ */
|
|
||||||
|
|
Loading…
Reference in New Issue