#include <map_averaging.h>
Definition at line 35 of file map_averaging.h.
◆ MapAverager()
Definition at line 37 of file map_averaging.h.
39 {
40 }
Base class for sensors that compute a value on one thread, and want to make it available to consumers...
◆ setFunction()
◆ showInfo()
void MapAverager::showInfo |
( |
const char * |
sensorName | ) |
const |
|
overridevirtual |
Implements Sensor.
Definition at line 82 of file sensor_info_printing.cpp.
82 {
83 const auto value =
get();
84 efiPrintf(
"Sensor \"%s\" is MAP averager: valid: %s value: %.2f averaged sample count: %d", sensorName,
boolToString(value.Valid), value.Value,
m_lastCounter);
85}
SensorResult get() const final override
const char * boolToString(bool value)
◆ start()
void MapAverager::start |
( |
uint8_t |
cylinderNumber | ) |
|
Definition at line 74 of file map_averaging.cpp.
74 {
75 chibios_rt::CriticalSectionLocker csl;
76
81}
◆ stop()
void MapAverager::stop |
( |
| ) |
|
Definition at line 104 of file map_averaging.cpp.
104 {
105 chibios_rt::CriticalSectionLocker csl;
106
108
112
113
115
117
122 }
123
126 } else {
127#if EFI_PROD_CODE
129#endif
130 }
131}
TunerStudioOutputChannels outputChannels
void setValidValue(float value, efitick_t timestamp)
static EngineAccessor engine
bool warning(ObdCode code, const char *fmt,...)
static float averagedMapRunningBuffer[MAX_MAP_BUFFER_LENGTH]
static int averagedMapBufIdx
static int mapMinBufferLength
float filterMapValue(float value)
@ CUSTOM_UNEXPECTED_MAP_VALUE
uint8_t mapPerCylinder[MAX_CYLINDER_COUNT]
Referenced by endAveraging().
◆ submit()
Definition at line 83 of file map_averaging.cpp.
83 {
85
87 chibios_rt::CriticalSectionLocker csl;
88
90 m_sum += result.Value;
91 }
92
93 return result;
94}
virtual SensorResult convert(float raw) const =0
Referenced by mapAveragingAdcCallback().
◆ m_counter
size_t MapAverager::m_counter = 0 |
|
private |
◆ m_cylinderNumber
uint8_t MapAverager::m_cylinderNumber = 0 |
|
private |
◆ m_function
◆ m_isAveraging
bool MapAverager::m_isAveraging = false |
|
private |
◆ m_lastCounter
size_t MapAverager::m_lastCounter = 0 |
|
private |
◆ m_sum
float MapAverager::m_sum = 0 |
|
private |
The documentation for this class was generated from the following files: