mirror of https://github.com/FOME-Tech/fome-fw.git
// 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:
parent
aea99ddbe6
commit
a9cf096272
|
@ -697,10 +697,7 @@ void TriggerCentral::handleShaftSignal(trigger_event_e signal, efitick_t timesta
|
||||||
auto currentPhaseFromSyncPoint = getTriggerCentral()->triggerFormDetails.eventAngles[triggerIndexForListeners];
|
auto currentPhaseFromSyncPoint = getTriggerCentral()->triggerFormDetails.eventAngles[triggerIndexForListeners];
|
||||||
|
|
||||||
// Adjust so currentPhase is in engine-space angle, not trigger-space angle
|
// Adjust so currentPhase is in engine-space angle, not trigger-space angle
|
||||||
auto currentPhase = wrapAngleMethod(currentPhaseFromSyncPoint - tdcPosition(), "currentEnginePhase", CUSTOM_ERR_6555);
|
currentEngineDecodedPhase = 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;
|
|
||||||
|
|
||||||
// Check that the expected next phase (from the last tooth) is close to the actual current phase:
|
// 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
|
// 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;
|
nextToothIndex = (nextToothIndex + 1) % engineCycleEventCount;
|
||||||
nextPhase = getTriggerCentral()->triggerFormDetails.eventAngles[nextToothIndex] - tdcPosition();
|
nextPhase = getTriggerCentral()->triggerFormDetails.eventAngles[nextToothIndex] - tdcPosition();
|
||||||
wrapAngle(nextPhase, "nextEnginePhase", CUSTOM_ERR_6555);
|
wrapAngle(nextPhase, "nextEnginePhase", CUSTOM_ERR_6555);
|
||||||
} while (nextPhase == currentPhase);
|
} while (nextPhase == currentEngineDecodedPhase);
|
||||||
|
|
||||||
expectedNextPhase = nextPhase + tdcPosition();
|
expectedNextPhase = nextPhase + tdcPosition();
|
||||||
wrapAngle(expectedNextPhase, "nextEnginePhase", CUSTOM_ERR_6555);
|
wrapAngle(expectedNextPhase, "nextEnginePhase", CUSTOM_ERR_6555);
|
||||||
|
@ -765,10 +762,10 @@ void TriggerCentral::handleShaftSignal(trigger_event_e signal, efitick_t timesta
|
||||||
}
|
}
|
||||||
|
|
||||||
// Handle ignition and injection
|
// Handle ignition and injection
|
||||||
mainTriggerCallback(triggerIndexForListeners, timestamp, currentPhase, nextPhase);
|
mainTriggerCallback(triggerIndexForListeners, timestamp, currentEngineDecodedPhase, nextPhase);
|
||||||
|
|
||||||
// Decode the MAP based "cam" sensor
|
// Decode the MAP based "cam" sensor
|
||||||
decodeMapCam(timestamp, currentPhase);
|
decodeMapCam(timestamp, currentEngineDecodedPhase);
|
||||||
} else {
|
} else {
|
||||||
// We don't have sync, but report to the wave chart anyway as index 0.
|
// We don't have sync, but report to the wave chart anyway as index 0.
|
||||||
reportEventToWaveChart(signal, 0, triggerShape.useOnlyRisingEdges);
|
reportEventToWaveChart(signal, 0, triggerShape.useOnlyRisingEdges);
|
||||||
|
|
|
@ -8,11 +8,13 @@ import java.io.IOException;
|
||||||
|
|
||||||
import static com.rusefi.ToolUtil.EOL;
|
import static com.rusefi.ToolUtil.EOL;
|
||||||
|
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Configuration consumer which writes C header file
|
* Configuration consumer which writes C header file
|
||||||
*/
|
*/
|
||||||
public class CHeaderConsumer extends BaseCHeaderConsumer {
|
public class CHeaderConsumer extends BaseCHeaderConsumer {
|
||||||
@org.jetbrains.annotations.NotNull
|
@NotNull
|
||||||
private final ReaderState state;
|
private final ReaderState state;
|
||||||
/**
|
/**
|
||||||
* looks like sometimes we want to not include "define XXX value" into generated C headers
|
* looks like sometimes we want to not include "define XXX value" into generated C headers
|
||||||
|
|
Loading…
Reference in New Issue