53 libdivide::libdivide_s16_t divTriggerToothAngle{};
89 return libdivide::libdivide_s16_do(angle, &divTriggerToothAngle);
#define IGN_CHANNELS
Definition board_avr2560.h:25
The tune page structs and related defines.
const config4 & page4
Definition engineProtection.cpp:172
Definition basicDistributor.cpp:8
Workaround when min() & max() are defined as macros, which generates compile errors in most C++ stand...
An ignition schedule.
Definition scheduler.h:178
int16_t dischargeAngle
Angle the coil should discharge at. I.e. spark.
Definition scheduler.h:184
Definition config_pages.h:357
byte triggerTeeth
The full count of teeth on the trigger wheel if there were no gaps.
Definition config_pages.h:393
int16_t triggerAngle
Angle (ATDC) when tooth No:1 on the primary wheel sends signal (-360 to +360 deg.)
Definition config_pages.h:359
Definition decoder_t.h:76
Current decoder status.
Definition decoder_t.h:69
Definition decoder_state.h:17
volatile uint16_t secondaryToothCount
Definition decoder_state.h:41
bool toothWithinMaxStallTime(uint32_t curTime)
Check how long ago the last tooth was seen compared to now. If it was more than MAX_STALL_TIME then t...
Definition decoder_state.cpp:40
volatile unsigned long curGap3
Definition decoder_state.h:20
volatile unsigned long triggerSecFilterTime
Definition decoder_state.h:43
volatile unsigned long triggerFilterTime
Definition decoder_state.h:42
int16_t toothNumFromScheduleAngles(const config4 &page4, const IgnitionSchedule &schedule) const
Definition decoder_state.h:85
void reset(void)
Reset tooth statues & times.
Definition decoder_state.cpp:29
unsigned long MAX_STALL_TIME
Definition decoder_state.h:23
uint16_t triggerActualTeeth
Definition decoder_state.h:40
volatile unsigned long toothLastSecToothTime
Definition decoder_state.h:28
volatile unsigned long toothLastThirdToothTime
Definition decoder_state.h:29
void setTriggerToothAngle(uint16_t angle)
Set the angle between teeth.
Definition decoder_state.cpp:51
volatile unsigned long toothLastMinusOneSecToothTime
Definition decoder_state.h:31
uint8_t checkSyncToothCount
Definition decoder_state.h:46
volatile unsigned long toothOneTime
Definition decoder_state.h:36
int16_t toothAngles[24]
Definition decoder_state.h:49
uint16_t clampToActualTeeth(const config4 &page4, uint16_t toothNum, uint8_t toothAdder) const
Definition decoder_state.h:80
volatile uint16_t triggerToothAngle
Definition decoder_state.h:45
unsigned long lastVVTtime
Definition decoder_state.h:47
volatile unsigned long toothLastSecToothRisingTime
Definition decoder_state.h:33
uint16_t toothCurrentCount
Definition decoder_state.h:24
decoder_status_t decoderStatus
Definition decoder_state.h:50
volatile bool revolutionOne
Definition decoder_state.h:39
volatile unsigned long targetGap3
Definition decoder_state.h:35
volatile unsigned long curGap
Definition decoder_state.h:18
volatile unsigned long toothSystemLastToothTime
Definition decoder_state.h:26
volatile unsigned long targetGap2
Definition decoder_state.h:34
volatile unsigned long targetGap
Definition decoder_state.h:22
volatile unsigned long toothLastToothRisingTime
Definition decoder_state.h:32
volatile unsigned long curGap2
Definition decoder_state.h:19
volatile unsigned long lastSyncRevolution
Definition decoder_state.h:38
void setFilter(unsigned long curGap, const config4 &page4)
Definition decoder_state.cpp:9
volatile uint32_t toothLastToothTime
Definition decoder_state.h:27
decoder_features_t decoderFeatures
Definition decoder_state.h:51
volatile uint32_t toothLastMinusOneToothTime
Definition decoder_state.h:30
uint16_t ignitionEndTeeth[IGN_CHANNELS]
Definition decoder_state.h:48
volatile unsigned long triggerThirdFilterTime
Definition decoder_state.h:44
volatile unsigned long toothOneMinusOneTime
Definition decoder_state.h:37
volatile byte toothSystemCount
Definition decoder_state.h:25
volatile unsigned long lastGap
Definition decoder_state.h:21