This commit is contained in:
rusefi 2018-02-10 14:02:48 +03:00
parent d3a0296858
commit c3ef3d09cc
2 changed files with 16 additions and 12 deletions

View File

@ -180,6 +180,7 @@ static void endAveraging(void *arg) {
isAveraging = false; isAveraging = false;
// with locking we would have a consistent state // with locking we would have a consistent state
#if EFI_PROD_CODE || defined(__DOXYGEN__) #if EFI_PROD_CODE || defined(__DOXYGEN__)
if (mapMeasurementsCounter > 0) {
v_averagedMapValue = adcToVoltsDivided(mapAdcAccumulator / mapMeasurementsCounter); v_averagedMapValue = adcToVoltsDivided(mapAdcAccumulator / mapMeasurementsCounter);
// todo: move out of locked context? // todo: move out of locked context?
averagedMapRunningBuffer[averagedMapBufIdx] = getMapByVoltage(v_averagedMapValue); averagedMapRunningBuffer[averagedMapBufIdx] = getMapByVoltage(v_averagedMapValue);
@ -192,6 +193,9 @@ static void endAveraging(void *arg) {
minPressure = averagedMapRunningBuffer[i]; minPressure = averagedMapRunningBuffer[i];
} }
currentPressure = minPressure; currentPressure = minPressure;
} else {
warning(CUSTOM_ERR_6548, "No MAP values");
}
#endif #endif
if (!wasLocked) if (!wasLocked)
unlockAnyContext(); unlockAnyContext();

View File

@ -276,5 +276,5 @@ int getRusEfiVersion(void) {
if (initBootloader() != 0) if (initBootloader() != 0)
return 123; return 123;
#endif /* EFI_BOOTLOADER_INCLUDE_CODE */ #endif /* EFI_BOOTLOADER_INCLUDE_CODE */
return 20180207; return 20180210;
} }