refactoring: reducing outputChannels copy

This commit is contained in:
Andrey 2022-09-01 01:06:49 -04:00
parent 5237235e48
commit e240ac84d3
4 changed files with 2 additions and 6 deletions

View File

@ -902,8 +902,6 @@ void updateTunerStudioState() {
tsOutputChannels->debugFloatField2 = instantRpm / Sensor::getOrZero(SensorType::Rpm);
#endif // EFI_SHAFT_POSITION_INPUT
tsOutputChannels->mostRecentTimeBetweenSparkEvents = engine->mostRecentTimeBetweenSparkEvents;
tsOutputChannels->mostRecentTimeBetweenIgnitionEvents = engine->mostRecentTimeBetweenIgnitionEvents;
}
break;
case DBG_ION:

View File

@ -227,9 +227,7 @@ public:
FanControl2 fan2;
efitick_t mostRecentSparkEvent;
efitick_t mostRecentTimeBetweenSparkEvents;
efitick_t mostRecentIgnitionEvent;
efitick_t mostRecentTimeBetweenIgnitionEvents;
PrimaryTriggerConfiguration primaryTriggerConfiguration;
#if CAMS_PER_BANK == 1

View File

@ -139,7 +139,7 @@ void InjectorOutputPin::close(efitick_t nowNt) {
void turnInjectionPinLow(InjectionEvent *event) {
efitick_t nowNt = getTimeNowNt();
engine->mostRecentTimeBetweenIgnitionEvents = nowNt - engine->mostRecentIgnitionEvent;
engine->outputChannels.mostRecentTimeBetweenIgnitionEvents = nowNt - engine->mostRecentIgnitionEvent;
engine->mostRecentIgnitionEvent = nowNt;
event->isScheduled = false;

View File

@ -36,7 +36,7 @@ int isIgnitionTimingError(void) {
static void fireSparkBySettingPinLow(IgnitionEvent *event, IgnitionOutputPin *output) {
efitick_t nowNt = getTimeNowNt();
engine->mostRecentTimeBetweenSparkEvents = nowNt - engine->mostRecentSparkEvent;
engine->outputChannels.mostRecentTimeBetweenSparkEvents = nowNt - engine->mostRecentSparkEvent;
engine->mostRecentSparkEvent = nowNt;
#if SPARK_EXTREME_LOGGING