Line |
Branch |
Decision |
Exec |
Source |
1 |
|
|
|
#include "pch.h" |
2 |
|
|
|
|
3 |
|
|
|
#include "init.h" |
4 |
|
|
|
#include "AemXSeriesEgt.h" |
5 |
|
|
|
#include "max3185x.h" |
6 |
|
|
|
|
7 |
|
|
|
#if EFI_CAN_SUPPORT |
8 |
|
|
|
static AemXSeriesEgt aemEgt1(0, SensorType::EGT1); |
9 |
|
|
|
static AemXSeriesEgt aemEgt2(1, SensorType::EGT2); |
10 |
|
|
|
static AemXSeriesEgt aemEgt3(2, SensorType::EGT3); |
11 |
|
|
|
static AemXSeriesEgt aemEgt4(3, SensorType::EGT4); |
12 |
|
|
|
static AemXSeriesEgt aemEgt5(4, SensorType::EGT5); |
13 |
|
|
|
static AemXSeriesEgt aemEgt6(5, SensorType::EGT6); |
14 |
|
|
|
#endif |
15 |
|
|
|
|
16 |
|
|
2 |
void initEgt() { |
17 |
|
|
|
#if EFI_CAN_SUPPORT |
18 |
|
|
|
if (engineConfiguration->enableAemXSeriesEgt) { |
19 |
|
|
|
if (!engineConfiguration->canReadEnabled) { |
20 |
|
|
|
criticalError("CAN read is required to use CAN EGT."); |
21 |
|
|
|
return; |
22 |
|
|
|
} |
23 |
|
|
|
|
24 |
|
|
|
registerCanSensor(aemEgt1); |
25 |
|
|
|
registerCanSensor(aemEgt2); |
26 |
|
|
|
registerCanSensor(aemEgt3); |
27 |
|
|
|
registerCanSensor(aemEgt4); |
28 |
|
|
|
registerCanSensor(aemEgt5); |
29 |
|
|
|
registerCanSensor(aemEgt6); |
30 |
|
|
|
|
31 |
|
|
|
return; |
32 |
|
|
|
} |
33 |
|
|
|
#endif |
34 |
|
|
|
|
35 |
|
|
|
#if EFI_MAX_31855 |
36 |
|
|
|
initMax3185x(engineConfiguration->max31855spiDevice, engineConfiguration->max31855_cs); |
37 |
|
|
|
#endif /* EFI_MAX_31855 */ |
38 |
|
|
2 |
} |
39 |
|
|
|
|
40 |
|
|
✗ |
void stopEgt() { |
41 |
|
|
|
/* TODO: also stop CAN sensors */ |
42 |
|
|
|
#if EFI_MAX_31855 |
43 |
|
|
|
stopMax3185x(); |
44 |
|
|
|
#endif /* EFI_MAX_31855 */ |
45 |
|
|
✗ |
} |
46 |
|
|
|
|
47 |
|
|
✗ |
void startEgt() { |
48 |
|
|
|
/* TODO: also start CAN sensors */ |
49 |
|
|
|
#if EFI_MAX_31855 |
50 |
|
|
|
startMax3185x(engineConfiguration->max31855spiDevice, engineConfiguration->max31855_cs); |
51 |
|
|
|
#else |
52 |
|
|
✗ |
criticalAssertVoid(SPI_NONE == engineConfiguration->max31855spiDevice, "not EFI_MAX_31855"); |
53 |
|
|
|
#endif /* EFI_MAX_31855 */ |
54 |
|
|
|
} |
55 |
|
|
|
|