FreeEMS
0.2.0-SNAPSHOT-282-g9efc524
|
LT1 Optispark. More...
#include "../inc/freeEMS.h"
#include "../inc/interrupts.h"
#include "inc/GM-LT1-CAS-360and8.h"
#include "../inc/decoderInterface.h"
#include "../inc/utils.h"
#include "inc/defaultSecondaryRPMISR.c"
Go to the source code of this file.
Macros | |
#define | DECODER_IMPLEMENTATION_C |
#define | LT1_360_8_C |
#define | windowsPerAllowedCumulativeBastardTooth 8 |
Functions | |
void | decoderInitPreliminary (void) |
void | perDecoderReset () |
void | PrimaryRPMISR (void) |
RPM ISRs, IC timer for engine position and RPM. |
Variables | |
const unsigned short | eventAngles [] |
const unsigned char | eventValidForCrankSync [] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0} |
const unsigned char | windowCounts [] = {4,86,44,46,4,86,14,76,4,86,24,66,4,86,34,56} |
unsigned char | lastAccumulatorCount = 0xFF |
unsigned char | lastPARegisterReading = 0xFF |
unsigned char | windowState = 0 |
unsigned char | lastNumberOfRealEvents = 0 |
unsigned char | accumulatorRegisterCount = 0 |
signed char | cumulativeBastardTeeth = 0 |
unsigned short | cumulativeBastardTeethEroderCounter = 0 |
LT1 Optispark.
Uses PT1 to interrupt on rising and falling events of the 8x cam sensor track. A certain number of 360x teeth will pass while PT1 is in a high or low state. Using that uniquek count we can set the positing of your Virtual CAS clock. After VCAS's position is set set PT7 to only interrupt on every 5th tooth, lowering the amount of interrupts generated, to a reasonable level.
Definition in file GM-LT1-CAS-360and8.c.
#define DECODER_IMPLEMENTATION_C |
Definition at line 47 of file GM-LT1-CAS-360and8.c.
#define LT1_360_8_C |
Definition at line 48 of file GM-LT1-CAS-360and8.c.
#define windowsPerAllowedCumulativeBastardTooth 8 |
Definition at line 83 of file GM-LT1-CAS-360and8.c.
Referenced by PrimaryRPMISR().
void decoderInitPreliminary | ( | void | ) |
Definition at line 89 of file GM-LT1-CAS-360and8.c.
References ICPAR, PACN1, and TCTL4.
void perDecoderReset | ( | void | ) |
Definition at line 103 of file GM-LT1-CAS-360and8.c.
References cumulativeBastardTeeth, and cumulativeBastardTeethEroderCounter.
void PrimaryRPMISR | ( | void | ) |
RPM ISRs, IC timer for engine position and RPM.
There are multiple copies of this interrupt handler, each is linked with the rest of the code once such that if there are N decoder implementations and/or variants, then there are N loadable binaries produced after a full build.
For details on any specific decoder implementation, see the documentation for that specific file.
Definition at line 115 of file GM-LT1-CAS-360and8.c.
References accumulatorRegisterCount, ADCBuffers, AMBIGUOUS_COUNT, ANGLE_FACTOR, BASTARD_CUMULATIVE_SYNC_LOSS_ID_BASE, BASTARD_SYNC_LOSS_ID_BASE, BIT0, CALC_FUEL_IGN, CAM_SYNC, Clocks, coreStatusA, Counters, cumulativeBastardTeeth, cumulativeBastardTeethEroderCounter, KeyUserDebug::currentEvent, DEBUG_TURN_PIN_OFF, DEBUG_TURN_PIN_ON, DECODER_BENCHMARKS, KeyUserDebug::decoderFlags, edgeTimeStamp, KeyUserDebugs, lastAccumulatorCount, lastPARegisterReading, lastPrimaryEventTimeStamp, MAX_BASTARD_TEETH, MAX_CUMULATIVE_BASTARD_TEETH, NBIT0, NUMBER_OF_REAL_EVENTS, numberOfRealEvents, OK_TO_SCHEDULE, PACN1, PORTB, KeyUserDebug::primaryTeethSeen, PTIT, resetToNonRunningState(), sampleEachADC(), KeyUserDebug::secondaryTeethSeen, SET_SYNC_LEVEL_TO, Counter::syncedADCreadings, TC0, TFLG, TFLGOF, ticks_per_degree_multiplier, ticksPerDegreeRecord, LongTime::timeLong, Clock::timeoutADCreadingClock, timerExtensionClock, LongTime::timeShorts, timeStamp, windowCounts, windowsPerAllowedCumulativeBastardTooth, and windowState.
const unsigned short eventAngles[] |
const unsigned char eventValidForCrankSync[] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0} |
Definition at line 60 of file GM-LT1-CAS-360and8.c.
const unsigned char windowCounts[] = {4,86,44,46,4,86,14,76,4,86,24,66,4,86,34,56} |
Definition at line 61 of file GM-LT1-CAS-360and8.c.
Referenced by PrimaryRPMISR().
unsigned char lastAccumulatorCount = 0xFF |
Definition at line 62 of file GM-LT1-CAS-360and8.c.
Referenced by PrimaryRPMISR().
unsigned char lastPARegisterReading = 0xFF |
Definition at line 63 of file GM-LT1-CAS-360and8.c.
Referenced by PrimaryRPMISR().
unsigned char windowState = 0 |
Definition at line 64 of file GM-LT1-CAS-360and8.c.
Referenced by PrimaryRPMISR().
unsigned char lastNumberOfRealEvents = 0 |
Definition at line 65 of file GM-LT1-CAS-360and8.c.
unsigned char accumulatorRegisterCount = 0 |
Definition at line 66 of file GM-LT1-CAS-360and8.c.
Referenced by PrimaryRPMISR().
signed char cumulativeBastardTeeth = 0 |
Definition at line 67 of file GM-LT1-CAS-360and8.c.
Referenced by perDecoderReset(), and PrimaryRPMISR().
unsigned short cumulativeBastardTeethEroderCounter = 0 |
Definition at line 85 of file GM-LT1-CAS-360and8.c.
Referenced by perDecoderReset(), and PrimaryRPMISR().