rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes
OneCylinder Class Referencefinal

#include <engine_cylinder.hpp>

Collaboration diagram for OneCylinder:
Collaboration graph
[legend]

Public Member Functions

void updateCylinderNumber (uint8_t index, uint8_t cylinderNumber)
 
void invalidCylinder ()
 
angle_t getAngleOffset () const
 
bool getIsValid () const
 

Private Attributes

int m_index = 0
 
bool m_valid = false
 
uint8_t m_cylinderIndex = 0
 
uint8_t m_cylinderNumber = 0
 
angle_t m_baseAngleOffset
 

Detailed Description

Definition at line 12 of file engine_cylinder.hpp.

Member Function Documentation

◆ getAngleOffset()

angle_t OneCylinder::getAngleOffset ( ) const

Definition at line 25 of file engine_cylinder.cpp.

25 {
26 if (!m_valid) {
27 return 0;
28 }
29
30 // Plus or minus any adjustment if this is an odd-fire engine
32
33 auto result = m_baseAngleOffset + adjustment;
34
35 assertAngleRange(result, "getAngleOffset", ObdCode::CUSTOM_ERR_CYL_ANGLE);
36
37 return result;
38}
uint8_t m_cylinderNumber
angle_t m_baseAngleOffset
static constexpr engine_configuration_s * engineConfiguration
@ CUSTOM_ERR_CYL_ANGLE

Referenced by MapAveragingModule::onFastCallback().

Here is the caller graph for this function:

◆ getIsValid()

bool OneCylinder::getIsValid ( ) const
inline

Definition at line 21 of file engine_cylinder.hpp.

21 {
22 return m_valid;
23 }

◆ invalidCylinder()

void OneCylinder::invalidCylinder ( )

Definition at line 21 of file engine_cylinder.cpp.

21 {
22 m_valid = false;
23}

Referenced by EngineCylinders::updateCylinders().

Here is the caller graph for this function:

◆ updateCylinderNumber()

void OneCylinder::updateCylinderNumber ( uint8_t  index,
uint8_t  cylinderNumber 
)

Definition at line 10 of file engine_cylinder.cpp.

10 {
11 m_cylinderIndex = index;
12 m_cylinderNumber = cylinderNumber;
13
14 // base = position of this cylinder in the firing order.
15 // We get a cylinder every n-th of an engine cycle where N is the number of cylinders
17
18 m_valid = true;
19}
EngineState engineState
Definition engine.h:344
angle_t engineCycle
uint8_t m_cylinderIndex
static EngineAccessor engine
Definition engine.h:413

Referenced by EngineCylinders::updateCylinders().

Here is the caller graph for this function:

Field Documentation

◆ m_baseAngleOffset

angle_t OneCylinder::m_baseAngleOffset
private

Definition at line 36 of file engine_cylinder.hpp.

Referenced by getAngleOffset(), and updateCylinderNumber().

◆ m_cylinderIndex

uint8_t OneCylinder::m_cylinderIndex = 0
private

Definition at line 31 of file engine_cylinder.hpp.

Referenced by updateCylinderNumber().

◆ m_cylinderNumber

uint8_t OneCylinder::m_cylinderNumber = 0
private

Definition at line 33 of file engine_cylinder.hpp.

Referenced by getAngleOffset(), and updateCylinderNumber().

◆ m_index

int OneCylinder::m_index = 0
private

Definition at line 27 of file engine_cylinder.hpp.

◆ m_valid

bool OneCylinder::m_valid = false
private

The documentation for this class was generated from the following files: