rusEFI
The most advanced open source ECU
Functions
map.h File Reference

Detailed Description

Author
Andrey Belomutskiy, (c) 2012-2020

Definition in file map.h.

Functions

void initMapDecoder ()
 

Function Documentation

◆ initMapDecoder()

void initMapDecoder ( )

Definition at line 68 of file map.cpp.

68  {
70  // Read initial MAP sensor value and store it for Baro correction.
71  float storedInitialBaroPressure = Sensor::get(SensorType::MapSlow).value_or(101.325);
72  efiPrintf("Get initial baro MAP pressure = %.2fkPa", storedInitialBaroPressure);
73  // validate if it's within a reasonable range (the engine should not be spinning etc.)
74  storedInitialBaroPressure = validateBaroMap(storedInitialBaroPressure);
75  if (!cisnan(storedInitialBaroPressure)) {
76  efiPrintf("Using this fixed MAP pressure to override the baro correction!");
77 
78  // TODO: do literally anything other than this
79  Sensor::setMockValue(SensorType::BarometricPressure, storedInitialBaroPressure);
80  } else {
81  efiPrintf("The baro pressure is invalid. The fixed baro correction will be disabled!");
82  }
83  }
84 
85 #if EFI_PROD_CODE
86  addConsoleAction("mapinfo", printMAPInfo);
87 #endif
88 }
static void setMockValue(SensorType type, float value, bool mockRedundant=false)
Definition: sensor.cpp:203
virtual SensorResult get() const =0
void addConsoleAction(const char *token, Void callback)
Register console action without parameters.
static void printMAPInfo()
Definition: map.cpp:30
static float validateBaroMap(float mapKPa)
Definition: map.cpp:16
engine_configuration_s * engineConfiguration
@ BarometricPressure

Referenced by initSensors().

Here is the call graph for this function:
Here is the caller graph for this function:

Go to the source code of this file.