only renaming variable here
This commit is contained in:
rusefillc 2023-04-12 11:49:11 -04:00
parent 4dfb040f97
commit e1b4ed2a41
2 changed files with 4 additions and 2 deletions

View File

@ -195,6 +195,7 @@ angle_t getAdvance(int rpm, float engineLoad) {
}
angle_t getCylinderIgnitionTrim(size_t cylinderNumber, int rpm, float ignitionLoad) {
// wow we have two separate per-cylinder trims?! #5237
return interpolate3d(
config->ignTrims[cylinderNumber].table,
config->ignTrimLoadBins, ignitionLoad,

View File

@ -421,12 +421,13 @@ void prepareOutputSignals() {
angle_t getCylinderAngle(uint8_t cylinderIndex, uint8_t cylinderNumber) {
// base = position of this cylinder in the firing order.
// We get a cylinder every n-th of an engine cycle where N is the number of cylinders
auto base = engine->engineState.engineCycle * cylinderIndex / engineConfiguration->specs.cylindersCount;
auto firingOrderOffset = engine->engineState.engineCycle * cylinderIndex / engineConfiguration->specs.cylindersCount;
// Plus or minus any adjustment if this is an odd-fire engine
// wow we have two separate per-cylinder trims?! #5237
auto adjustment = engineConfiguration->timing_offset_cylinder[cylinderNumber];
auto result = base + adjustment;
auto result = firingOrderOffset + adjustment;
assertAngleRange(result, "getCylinderAngle", CUSTOM_ERR_6566);