moving IO-only away from scheduling logic

This commit is contained in:
Andrey 2022-09-14 00:52:24 -04:00
parent bf66444ebe
commit b69d613192
4 changed files with 18 additions and 19 deletions

View File

@ -53,6 +53,8 @@ public:
WallFuel wallFuel;
};
void turnInjectionPinHigh(InjectionEvent *event);
/**
* This class knows about when to inject fuel

View File

@ -53,20 +53,6 @@
#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) {
event->isScheduled = false;
endSimultaneousInjectionOnlyTogglePins();

View File

@ -14,9 +14,4 @@
void mainTriggerCallback(uint32_t trgEventIndex, efitick_t edgeTimestamp, angle_t currentPhase, angle_t nextPhase);
void endSimultaneousInjection(InjectionEvent *event);
void turnInjectionPinHigh(InjectionEvent *event);
void turnInjectionPinLow(InjectionEvent *event);
// Internal use only - exposed for tests
void handleFuelInjectionEvent(int injEventIndex, InjectionEvent *event,
int rpm, efitick_t nowNt);

View File

@ -6,9 +6,25 @@
#include "engine_state.h"
#include "tooth_logger.h"
#include "tunerstudio_outputs.h"
#include "engine_configuration.h"
#include "efi_gpio.h"
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() {
overlappingCounter = 1; // Force update in reset
reset();