migrating to SensorType::Rpm API

This commit is contained in:
Andrey 2022-01-20 23:36:09 -05:00
parent 5f3324cd6b
commit e0258c4c8e
3 changed files with 3 additions and 3 deletions

View File

@ -345,7 +345,7 @@ void tdcMarkCallback(
if (isTriggerSynchronizationPoint && engine->isEngineChartEnabled && engine->tdcMarkEnabled) {
// two instances of scheduling_s are needed to properly handle event overlap
int revIndex2 = getRevolutionCounter() % 2;
int rpm = GET_RPM();
int rpm = Sensor::getOrZero(SensorType::Rpm);
// todo: use tooth event-based scheduling, not just time-based scheduling
if (isValidRpm(rpm)) {
angle_t tdcPosition = tdcPosition();

View File

@ -43,7 +43,7 @@ void tachSignalCallback() {
}
// What is the angle per tach output period?
float cycleTimeMs = 60000.0f / GET_RPM();
float cycleTimeMs = 60000.0f / Sensor::getOrZero(SensorType::Rpm);
float periodTimeMs = cycleTimeMs / periods;
tachFreq = 1000.0f / periodTimeMs;

View File

@ -581,7 +581,7 @@ void TriggerState::decodeTriggerEvent(
#if EFI_PROD_CODE || EFI_SIMULATOR
if (triggerConfiguration.VerboseTriggerSynchDetails || (someSortOfTriggerError && !silentTriggerError)) {
int rpm = GET_RPM();
int rpm = Sensor::getOrZero(SensorType::Rpm);
floatms_t engineCycleDuration = getEngineCycleDuration(rpm);
if (!engineConfiguration->useOnlyRisingEdgeForTrigger) {
int time = currentCycle.totalTimeNt[0];