Skip to content

Commit

Permalink
oop
Browse files Browse the repository at this point in the history
  • Loading branch information
mck1117 committed Aug 30, 2024
1 parent b522475 commit 5e492c9
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions firmware/controllers/modules/map_averaging/map_averaging.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,15 +183,12 @@ void MapAveragingModule::onFastCallback() {
engine->engineState.mapAveragingStart[i] = cylinderStart;
}

engine->engineState.mapAveragingDuration = duration;

angle_t duration = interpolate2d(rpm, c->samplingWindowBins, c->samplingWindow);
assertAngleRange(duration, "samplingDuration", ObdCode::CUSTOM_ERR_6563);

// Clamp the duration to slightly less than one cylinder period
float cylinderPeriod = engine->engineState.engineCycle / engineConfiguration->cylindersCount;
duration = clampF(10, duration, cylinderPeriod - 10);

engine->engineState.mapAveragingDuration = clampF(10, duration, cylinderPeriod - 10);
}

// Callback to schedule the start of map averaging for each cylinder
Expand Down

0 comments on commit 5e492c9

Please sign in to comment.