Speeduino
Loading...
Searching...
No Matches
Macros | Functions | Variables
Universal Decoder Routines

Macros

#define TRIGGER_FILTER_OFF   0
 
#define TRIGGER_FILTER_LITE   1
 
#define TRIGGER_FILTER_MEDIUM   2
 
#define TRIGGER_FILTER_AGGRESSIVE   3
 

Functions

static void addToothLogEntry (unsigned long toothTime, byte whichTooth)
 
void loggerPrimaryISR (void)
 
void loggerSecondaryISR (void)
 
void loggerTertiaryISR (void)
 
static decoder_status_t sharedGetStatus (void)
 
static uint16_t timeToAngleIntervalTooth (uint32_t time)
 
static bool IsCranking (const statuses &status)
 
TESTABLE_STATIC bool sharedEngineIsRunning (uint32_t curTime)
 
static decoder_features_t sharedGetDecoderFeatures (void)
 
static void sharedDecoderReset (void)
 
TESTABLE_STATIC bool SetRevolutionTime (uint32_t revTime)
 
static bool UpdateRevolutionTimeFromTeeth (bool isCamTeeth)
 
static uint16_t RpmFromRevolutionTimeUs (uint32_t revTime)
 
static uint16_t stdGetRPM (bool isCamTeeth)
 
static void setFilter (unsigned long curGap)
 
static int crankingGetRPM (byte totalTeeth, bool isCamTeeth)
 
static void checkPerToothTiming (int16_t crankAngle, uint16_t currentTooth)
 
static uint8_t getConfigPriTriggerEdge (const config4 &page4)
 
static uint8_t getConfigSecTriggerEdge (const config4 &page4)
 
static uint8_t getConfigTerTriggerEdge (const config10 &page10)
 

Variables

static decoder_features_t decoderFeatures
 

Detailed Description

Universal (shared between decoders) decoder routines.

Macro Definition Documentation

◆ TRIGGER_FILTER_AGGRESSIVE

#define TRIGGER_FILTER_AGGRESSIVE   3

◆ TRIGGER_FILTER_LITE

#define TRIGGER_FILTER_LITE   1

◆ TRIGGER_FILTER_MEDIUM

#define TRIGGER_FILTER_MEDIUM   2

◆ TRIGGER_FILTER_OFF

#define TRIGGER_FILTER_OFF   0

Function Documentation

◆ addToothLogEntry()

static void addToothLogEntry ( unsigned long  toothTime,
byte  whichTooth 
)
inlinestatic

Add tooth log entry to toothHistory (array). Enabled by (either) currentStatus.toothLogEnabled and currentStatus.compositeTriggerUsed.

Parameters
toothTime- Tooth Time
whichTooth- 0 for Primary (Crank), 2 for Secondary (Cam) 3 for Tertiary (Cam)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ checkPerToothTiming()

static void checkPerToothTiming ( int16_t  crankAngle,
uint16_t  currentTooth 
)
inlinestatic

On decoders that are enabled for per tooth based timing adjustments, this function performs the timer compare changes on the schedules themselves For each ignition channel, a check is made whether we're at the relevant tooth and whether that ignition schedule is currently running Only if both these conditions are met will the schedule be updated with the latest timing information. If it's the correct tooth, but the schedule is not yet started, calculate and an end compare value (This situation occurs when both the start and end of the ignition pulse happen after the end tooth, but before the next tooth)

Here is the call graph for this function:
Here is the caller graph for this function:

◆ crankingGetRPM()

static int crankingGetRPM ( byte  totalTeeth,
bool  isCamTeeth 
)
static

This is a special case of RPM measure that is based on the time between the last 2 teeth rather than the time of the last full revolution. This gives much more volatile reading, but is quite useful during cranking, particularly on low resolution patterns. It can only be used on patterns where the teeth are evenly spaced. It takes an argument of the full (COMPLETE) number of teeth per revolution. For a missing tooth wheel, this is the number if the tooth had NOT been missing (Eg 36-1 = 36)

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getConfigPriTriggerEdge()

static uint8_t getConfigPriTriggerEdge ( const config4 page4)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getConfigSecTriggerEdge()

static uint8_t getConfigSecTriggerEdge ( const config4 page4)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getConfigTerTriggerEdge()

static uint8_t getConfigTerTriggerEdge ( const config10 page10)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsCranking()

static bool IsCranking ( const statuses status)
inlinestatic
Here is the call graph for this function:
Here is the caller graph for this function:

◆ loggerPrimaryISR()

void loggerPrimaryISR ( void  )

Interrupt handler for primary trigger. This function is called on both the rising and falling edges of the primary trigger, when either the composite or tooth loggers are turned on.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ loggerSecondaryISR()

void loggerSecondaryISR ( void  )

Interrupt handler for secondary trigger. As loggerPrimaryISR, but for the secondary trigger.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ loggerTertiaryISR()

void loggerTertiaryISR ( void  )

Interrupt handler for third trigger. As loggerPrimaryISR, but for the third trigger.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ RpmFromRevolutionTimeUs()

static uint16_t RpmFromRevolutionTimeUs ( uint32_t  revTime)
inlinestatic
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setFilter()

static void setFilter ( unsigned long  curGap)
static

Sets the new filter time based on the current settings. This ONLY works for even spaced decoders.

Here is the caller graph for this function:

◆ SetRevolutionTime()

TESTABLE_STATIC bool SetRevolutionTime ( uint32_t  revTime)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ sharedDecoderReset()

static void sharedDecoderReset ( void  )
static
Here is the caller graph for this function:

◆ sharedEngineIsRunning()

TESTABLE_STATIC bool sharedEngineIsRunning ( uint32_t  curTime)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ sharedGetDecoderFeatures()

static decoder_features_t sharedGetDecoderFeatures ( void  )
static
Here is the caller graph for this function:

◆ sharedGetStatus()

static decoder_status_t sharedGetStatus ( void  )
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ stdGetRPM()

static uint16_t stdGetRPM ( bool  isCamTeeth)
static

Compute RPM. As nearly all the decoders use a common method of determining RPM (The time the last full revolution took) A common function is simpler.

Parameters
degreesOver- the number of crank degrees between tooth #1s. Some patterns have a tooth #1 every crank rev, others are every cam rev.
Returns
RPM
Here is the call graph for this function:
Here is the caller graph for this function:

◆ timeToAngleIntervalTooth()

static uint16_t timeToAngleIntervalTooth ( uint32_t  time)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateRevolutionTimeFromTeeth()

static bool UpdateRevolutionTimeFromTeeth ( bool  isCamTeeth)
static
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ decoderFeatures

decoder_features_t decoderFeatures
static