moving IO-only away from scheduling logic
This commit is contained in:
parent
bf66444ebe
commit
b69d613192
|
@ -53,6 +53,8 @@ public:
|
||||||
WallFuel wallFuel;
|
WallFuel wallFuel;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
void turnInjectionPinHigh(InjectionEvent *event);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class knows about when to inject fuel
|
* This class knows about when to inject fuel
|
||||||
|
|
|
@ -53,20 +53,6 @@
|
||||||
|
|
||||||
#include "backup_ram.h"
|
#include "backup_ram.h"
|
||||||
|
|
||||||
void startSimultaneousInjection(void*) {
|
|
||||||
efitick_t nowNt = getTimeNowNt();
|
|
||||||
for (size_t i = 0; i < engineConfiguration->specs.cylindersCount; i++) {
|
|
||||||
enginePins.injectors[i].open(nowNt);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void endSimultaneousInjectionOnlyTogglePins() {
|
|
||||||
efitick_t nowNt = getTimeNowNt();
|
|
||||||
for (size_t i = 0; i < engineConfiguration->specs.cylindersCount; i++) {
|
|
||||||
enginePins.injectors[i].close(nowNt);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void endSimultaneousInjection(InjectionEvent *event) {
|
void endSimultaneousInjection(InjectionEvent *event) {
|
||||||
event->isScheduled = false;
|
event->isScheduled = false;
|
||||||
endSimultaneousInjectionOnlyTogglePins();
|
endSimultaneousInjectionOnlyTogglePins();
|
||||||
|
|
|
@ -14,9 +14,4 @@
|
||||||
void mainTriggerCallback(uint32_t trgEventIndex, efitick_t edgeTimestamp, angle_t currentPhase, angle_t nextPhase);
|
void mainTriggerCallback(uint32_t trgEventIndex, efitick_t edgeTimestamp, angle_t currentPhase, angle_t nextPhase);
|
||||||
|
|
||||||
void endSimultaneousInjection(InjectionEvent *event);
|
void endSimultaneousInjection(InjectionEvent *event);
|
||||||
void turnInjectionPinHigh(InjectionEvent *event);
|
|
||||||
void turnInjectionPinLow(InjectionEvent *event);
|
void turnInjectionPinLow(InjectionEvent *event);
|
||||||
|
|
||||||
// Internal use only - exposed for tests
|
|
||||||
void handleFuelInjectionEvent(int injEventIndex, InjectionEvent *event,
|
|
||||||
int rpm, efitick_t nowNt);
|
|
||||||
|
|
|
@ -6,9 +6,25 @@
|
||||||
#include "engine_state.h"
|
#include "engine_state.h"
|
||||||
#include "tooth_logger.h"
|
#include "tooth_logger.h"
|
||||||
#include "tunerstudio_outputs.h"
|
#include "tunerstudio_outputs.h"
|
||||||
|
#include "engine_configuration.h"
|
||||||
|
#include "efi_gpio.h"
|
||||||
|
|
||||||
extern bool printFuelDebug;
|
extern bool printFuelDebug;
|
||||||
|
|
||||||
|
void startSimultaneousInjection(void*) {
|
||||||
|
efitick_t nowNt = getTimeNowNt();
|
||||||
|
for (size_t i = 0; i < engineConfiguration->specs.cylindersCount; i++) {
|
||||||
|
enginePins.injectors[i].open(nowNt);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void endSimultaneousInjectionOnlyTogglePins() {
|
||||||
|
efitick_t nowNt = getTimeNowNt();
|
||||||
|
for (size_t i = 0; i < engineConfiguration->specs.cylindersCount; i++) {
|
||||||
|
enginePins.injectors[i].close(nowNt);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
InjectorOutputPin::InjectorOutputPin() : NamedOutputPin() {
|
InjectorOutputPin::InjectorOutputPin() : NamedOutputPin() {
|
||||||
overlappingCounter = 1; // Force update in reset
|
overlappingCounter = 1; // Force update in reset
|
||||||
reset();
|
reset();
|
||||||
|
|
Loading…
Reference in New Issue