Skip to content

Commit

Permalink
https://github.com/rusefi/rusefi/issues/5237
Browse files Browse the repository at this point in the history
only renaming variable here
  • Loading branch information
rusefillc committed Apr 12, 2023
1 parent 4dfb040 commit e1b4ed2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions firmware/controllers/algo/advance_map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
5 changes: 3 additions & 2 deletions firmware/controllers/math/engine_math.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit e1b4ed2

Please sign in to comment.