Line |
Branch |
Decision |
Exec |
Source |
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 |
|
|
|
|
12 |
|
|
|
class OneCylinder final { |
13 |
|
|
|
public: |
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 |
|
|
3 |
bool getIsValid() const { |
22 |
|
|
3 |
return m_valid; |
23 |
|
|
|
} |
24 |
|
|
|
#endif |
25 |
|
|
|
|
26 |
|
|
|
private: |
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 |
36 |
|
|
|
angle_t m_baseAngleOffset; |
37 |
|
|
|
}; |
38 |
|
|
|
|
39 |
|
|
|
namespace EngineCylinders { |
40 |
|
|
|
void updateCylinders(void); |
41 |
|
|
|
}; |
42 |
|
|
|
|
43 |
|
|
|
#endif //ENGINE_CILINDER_HPP |
44 |
|
|
|
|