// todo: what is broken _exactly_? (#4531)

* // todo: what is broken _exactly_?

* hold on, why "float autoscale" at all here?

Co-authored-by: rusefillc <sdfsdfqsf2334234234>
This commit is contained in:
rusefillc 2022-10-08 23:13:14 -04:00 committed by GitHub
parent aea99ddbe6
commit a9cf096272
2 changed files with 7 additions and 8 deletions

View File

@ -697,10 +697,7 @@ void TriggerCentral::handleShaftSignal(trigger_event_e signal, efitick_t timesta
auto currentPhaseFromSyncPoint = getTriggerCentral()->triggerFormDetails.eventAngles[triggerIndexForListeners];
// Adjust so currentPhase is in engine-space angle, not trigger-space angle
auto currentPhase = wrapAngleMethod(currentPhaseFromSyncPoint - tdcPosition(), "currentEnginePhase", CUSTOM_ERR_6555);
// todo: local variable is needed because generated field type is not proper 'float' but scaled_channel
// todo: what is broken _exactly_?
currentEngineDecodedPhase = currentPhase;
currentEngineDecodedPhase = wrapAngleMethod(currentPhaseFromSyncPoint - tdcPosition(), "currentEnginePhase", CUSTOM_ERR_6555);
// Check that the expected next phase (from the last tooth) is close to the actual current phase:
// basically, check that the tooth width is correct
@ -748,7 +745,7 @@ void TriggerCentral::handleShaftSignal(trigger_event_e signal, efitick_t timesta
nextToothIndex = (nextToothIndex + 1) % engineCycleEventCount;
nextPhase = getTriggerCentral()->triggerFormDetails.eventAngles[nextToothIndex] - tdcPosition();
wrapAngle(nextPhase, "nextEnginePhase", CUSTOM_ERR_6555);
} while (nextPhase == currentPhase);
} while (nextPhase == currentEngineDecodedPhase);
expectedNextPhase = nextPhase + tdcPosition();
wrapAngle(expectedNextPhase, "nextEnginePhase", CUSTOM_ERR_6555);
@ -765,10 +762,10 @@ void TriggerCentral::handleShaftSignal(trigger_event_e signal, efitick_t timesta
}
// Handle ignition and injection
mainTriggerCallback(triggerIndexForListeners, timestamp, currentPhase, nextPhase);
mainTriggerCallback(triggerIndexForListeners, timestamp, currentEngineDecodedPhase, nextPhase);
// Decode the MAP based "cam" sensor
decodeMapCam(timestamp, currentPhase);
decodeMapCam(timestamp, currentEngineDecodedPhase);
} else {
// We don't have sync, but report to the wave chart anyway as index 0.
reportEventToWaveChart(signal, 0, triggerShape.useOnlyRisingEdges);

View File

@ -8,11 +8,13 @@ import java.io.IOException;
import static com.rusefi.ToolUtil.EOL;
import org.jetbrains.annotations.NotNull;
/**
* Configuration consumer which writes C header file
*/
public class CHeaderConsumer extends BaseCHeaderConsumer {
@org.jetbrains.annotations.NotNull
@NotNull
private final ReaderState state;
/**
* looks like sometimes we want to not include "define XXX value" into generated C headers