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 261 of file engine_sniffer.cpp.

261 {
262 static const char *crankName[2] = { PROTOCOL_CRANK1, PROTOCOL_CRANK2 };
263
264 shaft_signal_msg_index[0] = frontDirection == FrontDirection::UP ? 'u' : 'd';
265 // shaft_signal_msg_index[1] is assigned once and forever in the init method below
266 itoa10(&shaft_signal_msg_index[2], triggerEventIndex);
267
268 addEngineSnifferEvent(crankName[wheelIndex], (char* ) shaft_signal_msg_index);
269}
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 254 of file engine_sniffer.cpp.

254 {
255 extern const char *laNames[];
256 const char *name = laNames[laIndex];
257
258 addEngineSnifferEvent(name, frontDirection == FrontDirection::UP ? PROTOCOL_ES_UP : PROTOCOL_ES_DOWN);
259}
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 239 of file engine_sniffer.cpp.

239 {
241 addEngineSnifferEvent(pin->getShortName(), frontDirection == FrontDirection::UP ? PROTOCOL_ES_UP : PROTOCOL_ES_DOWN);
242 }
243}
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 245 of file engine_sniffer.cpp.

245 {
246 static char rpmBuffer[_MAX_FILLER];
247 itoa10(rpmBuffer, rpm);
248#if EFI_ENGINE_SNIFFER
250#endif
251 addEngineSnifferEvent(TOP_DEAD_CENTER_MESSAGE, (char* ) rpmBuffer);
252}
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 271 of file engine_sniffer.cpp.

271 {
272 extern const char *vvtNames[];
273 const char *vvtName = vvtNames[vvtIndex];
274
275 addEngineSnifferEvent(vvtName, frontDirection == FrontDirection::UP ? PROTOCOL_ES_UP : PROTOCOL_ES_DOWN);
276}
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 printStatus();
231 addConsoleActionI("chartsize", setChartSize);
232 // this is used by HW CI
233 addConsoleAction(CMD_RESET_ENGINE_SNIFFER, resetNow);
234#endif // EFI_UNIT_TEST
235}
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 printStatus()
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}

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.