rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
Data Structures | Enumerations | Functions
engine_sniffer.h File Reference

Detailed Description

rusEfi console wave sniffer

Date
Jun 23, 2013
Author
Andrey Belomutskiy, (c) 2012-2020

Definition in file engine_sniffer.h.

Data Structures

class  WaveChart
 rusEfi console sniffer data buffer More...
 

Enumerations

enum class  FrontDirection : uint8_t { UP , DOWN }
 

Functions

void addEngineSnifferTdcEvent (int rpm)
 
void addEngineSnifferLogicAnalyzerEvent (int laIndex, FrontDirection frontDirection)
 
void addEngineSnifferCrankEvent (int wheelIndex, int triggerEventIndex, FrontDirection frontDirection)
 
void addEngineSnifferVvtEvent (int vvtIndex, FrontDirection frontDirection)
 
void addEngineSnifferOutputPinEvent (NamedOutputPin *pin, FrontDirection frontDirection)
 
void initWaveChart (WaveChart *chart)
 
void setChartSize (int newSize)
 

Enumeration Type Documentation

◆ FrontDirection

enum class FrontDirection : uint8_t
strong
Enumerator
UP 
DOWN 

Definition at line 15 of file engine_sniffer.h.

15 : uint8_t {
16 UP,
17 DOWN
18};

Function Documentation

◆ addEngineSnifferCrankEvent()

void addEngineSnifferCrankEvent ( int  wheelIndex,
int  triggerEventIndex,
FrontDirection  frontDirection 
)
Parameters
wheelIndex0 or 1 @triggerEventIndex index from sync point, from 0 to number of teeth in engine cycle

Definition at line 260 of file engine_sniffer.cpp.

260 {
261 static const char *crankName[2] = { PROTOCOL_CRANK1, PROTOCOL_CRANK2 };
262
263 shaft_signal_msg_index[0] = frontDirection == FrontDirection::UP ? 'u' : 'd';
264 // shaft_signal_msg_index[1] is assigned once and forever in the init method below
265 itoa10(&shaft_signal_msg_index[2], triggerEventIndex);
266
267 addEngineSnifferEvent(crankName[wheelIndex], (char* ) shaft_signal_msg_index);
268}
char * itoa10(char *p, int num)
Definition efilib.cpp:107
static char shaft_signal_msg_index[15]

Referenced by reportEventToWaveChart().

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

◆ addEngineSnifferLogicAnalyzerEvent()

void addEngineSnifferLogicAnalyzerEvent ( int  laIndex,
FrontDirection  frontDirection 
)

Definition at line 253 of file engine_sniffer.cpp.

253 {
254 extern const char *laNames[];
255 const char *name = laNames[laIndex];
256
257 addEngineSnifferEvent(name, frontDirection == FrontDirection::UP ? PROTOCOL_ES_UP : PROTOCOL_ES_DOWN);
258}
const char * laNames[]
Definition efi_gpio.cpp:40

Referenced by riseCallback().

Here is the caller graph for this function:

◆ addEngineSnifferOutputPinEvent()

void addEngineSnifferOutputPinEvent ( NamedOutputPin pin,
FrontDirection  frontDirection 
)

Definition at line 238 of file engine_sniffer.cpp.

238 {
240 addEngineSnifferEvent(pin->getShortName(), frontDirection == FrontDirection::UP ? PROTOCOL_ES_UP : PROTOCOL_ES_DOWN);
241 }
242}
static constexpr engine_configuration_s * engineConfiguration
brain_pin_e pin
Definition stm32_adc.cpp:15

Referenced by NamedOutputPin::setHigh(), and NamedOutputPin::setLow().

Here is the caller graph for this function:

◆ addEngineSnifferTdcEvent()

void addEngineSnifferTdcEvent ( int  rpm)

Definition at line 244 of file engine_sniffer.cpp.

244 {
245 static char rpmBuffer[_MAX_FILLER];
246 itoa10(rpmBuffer, rpm);
247#if EFI_ENGINE_SNIFFER
249#endif
250 addEngineSnifferEvent(TOP_DEAD_CENTER_MESSAGE, (char* ) rpmBuffer);
251}
void startDataCollection()
WaveChart waveChart

Referenced by onTdcCallback().

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

◆ addEngineSnifferVvtEvent()

void addEngineSnifferVvtEvent ( int  vvtIndex,
FrontDirection  frontDirection 
)

Definition at line 270 of file engine_sniffer.cpp.

270 {
271 extern const char *vvtNames[];
272 const char *vvtName = vvtNames[vvtIndex];
273
274 addEngineSnifferEvent(vvtName, frontDirection == FrontDirection::UP ? PROTOCOL_ES_UP : PROTOCOL_ES_DOWN);
275}
const char * vvtNames[]
Definition efi_gpio.cpp:34

Referenced by logVvtFront().

Here is the caller graph for this function:

◆ initWaveChart()

void initWaveChart ( WaveChart chart)

constructor does not work because we need specific initialization order

Definition at line 218 of file engine_sniffer.cpp.

218 {
219 strcpy((char*) shaft_signal_msg_index, "x_");
220 /**
221 * constructor does not work because we need specific initialization order
222 */
223 chart->init();
224
225#if EFI_HISTOGRAMS
226 initHistogram(&engineSnifferHisto, "engine sniffer");
227#endif /* EFI_HISTOGRAMS */
228
229#if ! EFI_UNIT_TEST
230 addConsoleActionI("chartsize", setChartSize);
231 // this is used by HW CI
232 addConsoleAction(CMD_RESET_ENGINE_SNIFFER, resetNow);
233#endif // EFI_UNIT_TEST
234}
void addConsoleAction(const char *token, Void callback)
Register console action without parameters.
void addConsoleActionI(const char *token, VoidInt callback)
Register a console command with one Integer parameter.
void setChartSize(int newSize)
static void resetNow()
void initHistogram(histogram_s *h, const char *name)
Reset histogram_s to orignal state.
Definition histogram.cpp:89

Referenced by initTriggerCentral().

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

◆ setChartSize()

void setChartSize ( int  newSize)

Definition at line 120 of file engine_sniffer.cpp.

120 {
121 if (newSize < 5) {
122 return;
123 }
125 printStatus();
126}
static void printStatus()

Referenced by initWaveChart().

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

Go to the source code of this file.