FreeEMS
0.2.0-SNAPSHOT-285-g028e24c
|
Decoder for the Honda R18A1 I4 engine. More...
#include "../inc/freeEMS.h"
#include "../inc/utils.h"
#include "../inc/interrupts.h"
#include "../inc/decoderInterface.h"
Go to the source code of this file.
Macros | |
#define | DECODER_MAX_CODE_TIME 150 |
#define | NUMBER_OF_REAL_EVENTS 26 |
#define | NUMBER_OF_VIRTUAL_EVENTS 26 |
#define | DECODER_IMPLEMENTATION_C |
#define | FIRST_GAP ANGLE(10) |
#define | E0 ANGLE( 0) |
#define | E1 ANGLE( 30) |
#define | E2 ANGLE( 60) |
#define | E3 ANGLE( 90) |
#define | E4 ANGLE(120) |
#define | E5 ANGLE(150) |
#define | E6 ANGLE(180) |
#define | E7 ANGLE(210) |
#define | E8 ANGLE(240) |
#define | E9 ANGLE(270) |
#define | E10 ANGLE(300) |
#define | E11 ANGLE(330) |
#define | E12 (E11 + FIRST_GAP) |
#define | E13 ANGLE(360) |
#define | E14 ANGLE(390) |
#define | E15 ANGLE(420) |
#define | E16 ANGLE(450) |
#define | E17 ANGLE(480) |
#define | E18 ANGLE(510) |
#define | E19 ANGLE(540) |
#define | E20 ANGLE(570) |
#define | E21 ANGLE(600) |
#define | E22 ANGLE(630) |
#define | E23 ANGLE(660) |
#define | E24 ANGLE(690) |
#define | E25 (E24 + FIRST_GAP) |
Functions | |
void | decoderInitPreliminary () |
void | perDecoderReset () |
void | PrimaryRPMISR () |
RPM ISRs, IC timer for engine position and RPM. | |
void | SecondaryRPMISR () |
RPM ISRs, IC timer for engine position and RPM. |
Variables | |
unsigned char | camTeethSeen = 0 |
unsigned char | previousCrankTeethSeen = 0 |
unsigned char | crankTeethSinceLastCamTooth = 0 |
const unsigned short | eventAngles [] = {E0, E1, E2, E3, E4, E5, E6, E7, E8, E9, E10, E11, E12, E13, E14, E15, E16, E17, E18, E19, E20, E21, E22, E23, E24, E25} |
const unsigned char | eventValidForCrankSync [] = {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1} |
Decoder for the Honda R18A1 I4 engine.
Definition in file R18A1-13CrankWith5Cam.c.
#define DECODER_MAX_CODE_TIME 150 |
Definition at line 38 of file R18A1-13CrankWith5Cam.c.
#define NUMBER_OF_REAL_EVENTS 26 |
Definition at line 39 of file R18A1-13CrankWith5Cam.c.
#define NUMBER_OF_VIRTUAL_EVENTS 26 |
Definition at line 40 of file R18A1-13CrankWith5Cam.c.
#define DECODER_IMPLEMENTATION_C |
Definition at line 41 of file R18A1-13CrankWith5Cam.c.
#define FIRST_GAP ANGLE(10) |
Definition at line 52 of file R18A1-13CrankWith5Cam.c.
#define E0 ANGLE( 0) |
Definition at line 54 of file R18A1-13CrankWith5Cam.c.
#define E1 ANGLE( 30) |
Definition at line 55 of file R18A1-13CrankWith5Cam.c.
#define E2 ANGLE( 60) |
Definition at line 56 of file R18A1-13CrankWith5Cam.c.
#define E3 ANGLE( 90) |
Definition at line 57 of file R18A1-13CrankWith5Cam.c.
#define E4 ANGLE(120) |
Definition at line 58 of file R18A1-13CrankWith5Cam.c.
#define E5 ANGLE(150) |
Definition at line 59 of file R18A1-13CrankWith5Cam.c.
#define E6 ANGLE(180) |
Definition at line 60 of file R18A1-13CrankWith5Cam.c.
#define E7 ANGLE(210) |
Definition at line 61 of file R18A1-13CrankWith5Cam.c.
#define E8 ANGLE(240) |
Definition at line 62 of file R18A1-13CrankWith5Cam.c.
#define E9 ANGLE(270) |
Definition at line 63 of file R18A1-13CrankWith5Cam.c.
#define E10 ANGLE(300) |
Definition at line 64 of file R18A1-13CrankWith5Cam.c.
#define E11 ANGLE(330) |
Definition at line 65 of file R18A1-13CrankWith5Cam.c.
Definition at line 66 of file R18A1-13CrankWith5Cam.c.
#define E13 ANGLE(360) |
Definition at line 67 of file R18A1-13CrankWith5Cam.c.
#define E14 ANGLE(390) |
Definition at line 68 of file R18A1-13CrankWith5Cam.c.
#define E15 ANGLE(420) |
Definition at line 69 of file R18A1-13CrankWith5Cam.c.
#define E16 ANGLE(450) |
Definition at line 70 of file R18A1-13CrankWith5Cam.c.
#define E17 ANGLE(480) |
Definition at line 71 of file R18A1-13CrankWith5Cam.c.
#define E18 ANGLE(510) |
Definition at line 72 of file R18A1-13CrankWith5Cam.c.
#define E19 ANGLE(540) |
Definition at line 73 of file R18A1-13CrankWith5Cam.c.
#define E20 ANGLE(570) |
Definition at line 74 of file R18A1-13CrankWith5Cam.c.
#define E21 ANGLE(600) |
Definition at line 75 of file R18A1-13CrankWith5Cam.c.
#define E22 ANGLE(630) |
Definition at line 76 of file R18A1-13CrankWith5Cam.c.
#define E23 ANGLE(660) |
Definition at line 77 of file R18A1-13CrankWith5Cam.c.
#define E24 ANGLE(690) |
Definition at line 78 of file R18A1-13CrankWith5Cam.c.
Definition at line 79 of file R18A1-13CrankWith5Cam.c.
void decoderInitPreliminary | ( | void | ) |
Definition at line 93 of file R18A1-13CrankWith5Cam.c.
void perDecoderReset | ( | void | ) |
Definition at line 98 of file R18A1-13CrankWith5Cam.c.
References BIT2, camTeethSeen, crankTeethSinceLastCamTooth, previousCrankTeethSeen, and TCTL4.
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 108 of file R18A1-13CrankWith5Cam.c.
References decoderSetting::accelerationInputEventTimeTolerance, ADCBuffers, BIT0, CALC_FUEL_IGN, CAM_SYNC, CLEAR_BENCH_TEST_ON, Clocks, coreStatusA, CoreVars, Counters, KeyUserDebug::currentEvent, DEBUG_TURN_PIN_OFF, DEBUG_TURN_PIN_ON, decoderSetting::decelerationInputEventTimeTolerance, DECODER_BENCHMARKS, KeyUserDebug::decoderFlags, decoderMaxCodeTime, fixedConfig2::decoderSettings, edgeTimeStamp, eventAngles, fixedConfigs2, KeyUserDebug::inputEventTimeTolerance, KeyUserDebugs, LAST_PERIOD_VALID, LAST_TIMESTAMP_VALID, lastPrimaryEventTimeStamp, lastPrimaryTicksPerDegree, NBIT0, numberOfRealEvents, outputEventDelayFinalPeriod, outputEventInputEventNumbers, outputEventPulseWidthsMath, PORTB, PRIMARY_EVENT_ARRIVED_TOO_EARLY, PRIMARY_EVENT_ARRIVED_TOO_LATE, KeyUserDebug::primaryTeethSeen, PTIT, resetToNonRunningState(), CoreVar::RPM, sampleEachADC(), schedulePortTPin(), SHORTMAX, Counter::syncedADCreadings, TC0, TEST_MODE_DODGY_MISSING_TOOTH, TEST_MODE_ITERATIONS, TEST_MODE_REVOLUTIONS, TEST_MODE_TIME_UNITS_HOURS, TEST_MODE_TIME_UNITS_MINUTES, TEST_MODE_TIME_UNITS_SECONDS, testEventsPerCycle, testMode, testNumberOfCycles, testNumberOfMissing, testTicksPerEvent, TFLG, TFLGOF, ticks_per_degree_multiplier, ticksPerDegreeRecord, TIE, LongTime::timeLong, Clock::timeoutADCreadingClock, timerExtensionClock, LongTime::timeShorts, timeStamp, and totalEventAngleRange.
void SecondaryRPMISR | ( | 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 204 of file R18A1-13CrankWith5Cam.c.
References BIT0, BIT1, BUG_REACHED_UNREACHABLE_CODE, CAM_SYNC, camTeethSeen, COUNT_OF_EVENTS_IMPOSSIBLY_HIGH_NOISE, COUNT_OF_EVENTS_IMPOSSIBLY_LOW_NOISE, crankTeethSinceLastCamTooth, KeyUserDebug::currentEvent, DEBUG_TURN_PIN_OFF, DEBUG_TURN_PIN_ON, DECODER_BENCHMARKS, KeyUserDebug::decoderFlags, edgeTimeStamp, KeyUserDebugs, LAST_TIMESTAMP_VALID, lastSecondaryEventTimeStamp, NBIT0, NBIT1, NBIT2, numberOfRealEvents, OK_TO_SCHEDULE, PORTB, previousCrankTeethSeen, KeyUserDebug::primaryTeethSeen, resetToNonRunningState(), KeyUserDebug::secondaryTeethSeen, SET_SYNC_LEVEL_TO, STATE_MISMATCH_IN_SECONDARY_RPM_ISR, TC1, TCTL4, TFLG, TFLGOF, LongTime::timeLong, timerExtensionClock, LongTime::timeShorts, and timeStamp.
unsigned char camTeethSeen = 0 |
Definition at line 48 of file R18A1-13CrankWith5Cam.c.
unsigned char previousCrankTeethSeen = 0 |
Definition at line 49 of file R18A1-13CrankWith5Cam.c.
unsigned char crankTeethSinceLastCamTooth = 0 |
Definition at line 50 of file R18A1-13CrankWith5Cam.c.
const unsigned short eventAngles[] = {E0, E1, E2, E3, E4, E5, E6, E7, E8, E9, E10, E11, E12, E13, E14, E15, E16, E17, E18, E19, E20, E21, E22, E23, E24, E25} |
Definition at line 90 of file R18A1-13CrankWith5Cam.c.
const unsigned char eventValidForCrankSync[] = {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1} |
Definition at line 91 of file R18A1-13CrankWith5Cam.c.