rusEFI
The most advanced open source ECU
Data Structures | Functions
trigger_structure.h File Reference

Detailed Description

rusEFI defines trigger shape programmatically in C code For integration we have exportAllTriggers export

Date
Dec 22, 2013
Author
Andrey Belomutskiy, (c) 2012-2020

Definition in file trigger_structure.h.

Data Structures

class  TriggerWaveform
 Trigger shape has all the fields needed to describe and decode trigger signal. More...
 
class  TriggerFormDetails
 

Functions

void wrapAngle (angle_t &angle, const char *msg, ObdCode code)
 
angle_t wrapAngleMethod (angle_t param, const char *msg="", ObdCode code=ObdCode::OBD_PCM_Processor_Fault)
 

Function Documentation

◆ wrapAngle()

void wrapAngle ( angle_t angle,
const char *  msg,
ObdCode  code 
)
inline

Definition at line 32 of file trigger_structure.h.

32  {
33  if (cisnan(angle)) {
34  firmwareError(ObdCode::CUSTOM_ERR_ANGLE, "a NaN %s", msg);
35  angle = 0;
36  }
37 
38  assertAngleRange(angle, msg, code);
39  float engineCycle = getEngineState()->engineCycle;
40 
41  while (angle < 0) {
42  angle += engineCycle;
43  }
44 
45  while (angle >= engineCycle) {
46  angle -= engineCycle;
47  }
48 }
uint8_t code
Definition: bluetooth.cpp:39
angle_t engineCycle
Definition: engine_state.h:27
EngineState * getEngineState()
Definition: engine.cpp:576
void firmwareError(ObdCode code, const char *fmt,...)
@ CUSTOM_ERR_ANGLE

Referenced by auxPlainPinTurnOn(), InstantRpmCalculator::calculateInstantRpm(), InjectionEvent::computeInjectionAngle(), getAdvance(), getInjectionOffset(), TriggerCentral::handleShaftSignal(), mapAveragingTriggerCallback(), prepareCylinderIgnitionSchedule(), TriggerFormDetails::prepareEventAngles(), refreshMapAveragingPreCalc(), reportWave(), HpfpController::scheduleNextCycle(), tdcMarkCallback(), and wrapAngleMethod().

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

◆ wrapAngleMethod()

angle_t wrapAngleMethod ( angle_t  param,
const char *  msg = "",
ObdCode  code = ObdCode::OBD_PCM_Processor_Fault 
)
inline

Definition at line 51 of file trigger_structure.h.

51  {
52  wrapAngle(param, msg, code);
53  return param;
54 }
void wrapAngle(angle_t &angle, const char *msg, ObdCode code)
static tstrWifiInitParam param

Referenced by TriggerCentral::handleShaftSignal().

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

Go to the source code of this file.