rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
engine_cylinder.hpp
Go to the documentation of this file.
1/*
2 * @file engine_cylinder.hpp
3 *
4 * @date: may 25, 2025
5 * @author Matthew Kennedy, FDSoftware
6 */
7
8#ifndef ENGINE_CILINDER_HPP
9#define ENGINE_CILINDER_HPP
10#include "rusefi_types.h"
11
12class OneCylinder final {
13public:
14 void updateCylinderNumber(uint8_t index, uint8_t cylinderNumber);
15 void invalidCylinder();
16
17 // Get this cylinder's offset, in positive degrees, from cylinder 1
18 angle_t getAngleOffset() const;
19
20#if EFI_UNIT_TEST
21 bool getIsValid() const {
22 return m_valid;
23 }
24#endif
25
26private:
27 int m_index = 0;
28 bool m_valid = false;
29
30 // This cylinder's position in the firing order (0-based)
31 uint8_t m_cylinderIndex = 0;
32 // This cylinder's physical cylinder number (0-based)
33 uint8_t m_cylinderNumber = 0;
34
35 // This cylinder's mechanical TDC offset in degrees after #1
37};
38
39namespace EngineCylinders {
40 void updateCylinders(void);
41};
42
43#endif //ENGINE_CILINDER_HPP
angle_t getAngleOffset() const
uint8_t m_cylinderIndex
void updateCylinderNumber(uint8_t index, uint8_t cylinderNumber)
uint8_t m_cylinderNumber
bool getIsValid() const
angle_t m_baseAngleOffset
void updateCylinders(void)