Feed mapAveragingAdcCallback() with volts not adc raw values (#4940)
This commit is contained in:
parent
f25edb646d
commit
a300043f5d
|
@ -125,11 +125,9 @@ void MapAverager::stop() {
|
||||||
* @note This method is invoked OFTEN, this method is a potential bottleneck - the implementation should be
|
* @note This method is invoked OFTEN, this method is a potential bottleneck - the implementation should be
|
||||||
* as fast as possible
|
* as fast as possible
|
||||||
*/
|
*/
|
||||||
void mapAveragingAdcCallback(adcsample_t adcValue) {
|
void mapAveragingAdcCallback(float instantVoltage) {
|
||||||
efiAssertVoid(CUSTOM_ERR_6650, getCurrentRemainingStack() > 128, "lowstck#9a");
|
efiAssertVoid(CUSTOM_ERR_6650, getCurrentRemainingStack() > 128, "lowstck#9a");
|
||||||
|
|
||||||
float instantVoltage = adcToVoltsDivided(adcValue);
|
|
||||||
|
|
||||||
SensorResult mapResult = getMapAvg(currentMapAverager).submit(instantVoltage);
|
SensorResult mapResult = getMapAvg(currentMapAverager).submit(instantVoltage);
|
||||||
|
|
||||||
if (!mapResult) {
|
if (!mapResult) {
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
#if EFI_MAP_AVERAGING
|
#if EFI_MAP_AVERAGING
|
||||||
|
|
||||||
#if HAL_USE_ADC
|
#if HAL_USE_ADC
|
||||||
void mapAveragingAdcCallback(adcsample_t newValue);
|
void mapAveragingAdcCallback(float instantVoltage);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void initMapAveraging();
|
void initMapAveraging();
|
||||||
|
|
|
@ -185,7 +185,7 @@ void onFastAdcComplete(adcsample_t*) {
|
||||||
#endif /* EFI_SENSOR_CHART */
|
#endif /* EFI_SENSOR_CHART */
|
||||||
|
|
||||||
#if EFI_MAP_AVERAGING
|
#if EFI_MAP_AVERAGING
|
||||||
mapAveragingAdcCallback(getFastAdc(fastMapSampleIndex));
|
mapAveragingAdcCallback(adcToVoltsDivided(getFastAdc(fastMapSampleIndex)));
|
||||||
#endif /* EFI_MAP_AVERAGING */
|
#endif /* EFI_MAP_AVERAGING */
|
||||||
#if EFI_HIP_9011
|
#if EFI_HIP_9011
|
||||||
if (engineConfiguration->isHip9011Enabled) {
|
if (engineConfiguration->isHip9011Enabled) {
|
||||||
|
|
Loading…
Reference in New Issue