Function prototypes for decoders
This commit is contained in:
parent
1d699d18bc
commit
2b902edc75
21
decoders.h
21
decoders.h
|
@ -1,5 +1,24 @@
|
|||
#ifndef DECODERS_H
|
||||
#define DECODERS_H
|
||||
|
||||
#include <limits.h>
|
||||
|
||||
static inline void addToothLogEntry(unsigned long toothTime);
|
||||
static inline int stdGetRPM();
|
||||
static inline void setFilter(unsigned long curGap);
|
||||
static inline int crankingGetRPM(byte totalTeeth);
|
||||
void triggerSetup_missingTooth();
|
||||
void triggerPri_missingTooth();
|
||||
void triggerSec_missingTooth();
|
||||
int getRPM_missingTooth();
|
||||
int getCrankAngle_missingTooth(int timePerDegree);
|
||||
void triggerSetup_DualWheel();
|
||||
void triggerPri_DualWheel();
|
||||
void triggerSec_DualWheel();
|
||||
int getRPM_DualWheel();
|
||||
int getCrankAngle_DualWheel(int timePerDegree);
|
||||
|
||||
|
||||
volatile unsigned long curTime;
|
||||
volatile unsigned long curGap;
|
||||
volatile unsigned long curTime2;
|
||||
|
@ -37,4 +56,4 @@ int toothAngles[24]; //An array for storing fixed tooth angles. Currently sized
|
|||
#define LONG 0;
|
||||
#define SHORT 1;
|
||||
|
||||
|
||||
#endif
|
||||
|
|
|
@ -71,7 +71,7 @@ This gives much more volatile reading, but is quite useful during cranking, part
|
|||
It can only be used on patterns where the teeth are evently 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)
|
||||
*/
|
||||
inline int crankingGetRPM(byte totalTeeth)
|
||||
static inline int crankingGetRPM(byte totalTeeth)
|
||||
{
|
||||
noInterrupts();
|
||||
revolutionTime = (toothLastToothTime - toothLastMinusOneToothTime) * totalTeeth;
|
||||
|
|
Loading…
Reference in New Issue