tear down Engine god object #4511

just trying different things
This commit is contained in:
Andrey 2022-09-07 15:38:15 -04:00
parent 52ad9ced0b
commit 197454ac34
2 changed files with 8 additions and 5 deletions

View File

@ -28,8 +28,6 @@
#include "rpm_calculator_api.h"
// end of injection
#include "os_access.h"
#if EFI_PRINTF_FUEL_DETAILS
bool printFuelDebug = false;
#endif // EFI_PRINTF_FUEL_DETAILS
@ -47,9 +45,10 @@
#include "local_version_holder.h"
#include "event_queue.h"
#include "injector_model.h"
#if EFI_LAUNCH_CONTROL
#include "launch_control.h"
#endif
#endif // EFI_LAUNCH_CONTROL
#include "backup_ram.h"

View File

@ -8,7 +8,11 @@
#include "pch.h"
#include "spark_logic.h"
#include "os_access.h"
// dependency injection
#include "engine_state.h"
#include "rpm_calculator_api.h"
// end of injection
#include "utlist.h"
#include "event_queue.h"
@ -75,7 +79,7 @@ static void prepareCylinderIgnitionSchedule(angle_t dwellAngleDuration, floatms_
const angle_t sparkAngle =
// Negate because timing *before* TDC, and we schedule *after* TDC
- engine->engineState.timingAdvance[event->cylinderNumber]
- getEngineState()->timingAdvance[event->cylinderNumber]
// Offset by this cylinder's position in the cycle
+ getCylinderAngle(event->cylinderIndex, event->cylinderNumber)
// Pull any extra timing for knock retard