rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
AemXSeriesEgt.cpp
Go to the documentation of this file.
1#include "pch.h"
2
3#if EFI_CAN_SUPPORT || EFI_UNIT_TEST
4#include "AemXSeriesEgt.h"
5
6static constexpr uint32_t aem_egt_base = 0x000A0305;
7#define AEM_EGT_DEFAULT_PERIOD_MS 100 /* 10 Hz */
8
9AemXSeriesEgt::AemXSeriesEgt(uint8_t sensorIndex, SensorType type)
11 aem_egt_base + sensorIndex,
12 type,
13 MS2NT(3 * AEM_EGT_DEFAULT_PERIOD_MS) // sensor transmits at 10hz, allow a frame to be missed
14 )
15{
16 // nope
17}
18
19void AemXSeriesEgt::decodeFrame(const CANRxFrame& frame, efitick_t nowNt) {
20 // No status flags, just a value
21 uint16_t egt = SWAP_UINT16(frame.data16[0]);
22
23 setValidValue((float)egt, nowNt);
24}
25
26#endif
static constexpr uint32_t aem_egt_base
AemXSeriesEgt(uint8_t sensorIndex, SensorType type)
void decodeFrame(const CANRxFrame &frame, efitick_t nowNt) override
void setValidValue(float value, efitick_t timestamp)
uint16_t SWAP_UINT16(uint16_t x)
Definition efilib.h:22
SensorType
Definition sensor_type.h:18
uint16_t data16[4]
Frame data.
Definition can_mocks.h:56