rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
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 66 of file map.cpp.

66 {
68 // Read initial MAP sensor value and store it for Baro correction.
69 float storedInitialBaroPressure = Sensor::get(SensorType::MapSlow).value_or(STD_ATMOSPHERE);
70 efiPrintf("Get initial baro MAP pressure = %.2fkPa", storedInitialBaroPressure);
71 // validate if it's within a reasonable range (the engine should not be spinning etc.)
72 storedInitialBaroPressure = validateBaroMap(storedInitialBaroPressure);
73 if (!std::isnan(storedInitialBaroPressure)) {
74 efiPrintf("Using this fixed MAP pressure to override the baro correction!");
75
76 // TODO: do literally anything other than this
77 Sensor::setMockValue(SensorType::BarometricPressure, storedInitialBaroPressure);
78 } else {
79 efiPrintf("The baro pressure is invalid. The fixed baro correction will be disabled!");
80 }
81 }
82
83#if EFI_PROD_CODE
85#endif
86}
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 constexpr engine_configuration_s * engineConfiguration
static void printMAPInfo()
Definition map.cpp:28
static float validateBaroMap(float mapKPa)
Definition map.cpp:16
@ 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.