FreeEMS
0.2.0-SNAPSHOT-282-g9efc524
|
shared functions used by all decoders More...
Go to the source code of this file.
Macros | |
#define | DECODER_INTERFACE_C |
#define | newStartIsAfterOutputEndTimeAndCanSelfSet (diff > LONGHALF) |
Functions | |
void | descheduleAll () |
Loop over all schedules descheduling them as we go. | |
void | resetToNonRunningState (unsigned char uniqueLossID) |
Reset key state. | |
void | schedulePortTPin (unsigned char outputEventNumber, LongTime timeStamp) |
Schedule an ignition output event on port T. |
shared functions used by all decoders
To maximise code reuse and minimise bugs it is strongly recommended that you use these pre-canned functions to do work required in your decoder.
Definition in file decoderInterface.c.
#define DECODER_INTERFACE_C |
Definition at line 38 of file decoderInterface.c.
#define newStartIsAfterOutputEndTimeAndCanSelfSet (diff > LONGHALF) |
Referenced by schedulePortTPin().
void descheduleAll | ( | void | ) |
Loop over all schedules descheduling them as we go.
Definition at line 44 of file decoderInterface.c.
References MAX_NUMBER_OF_OUTPUT_EVENTS, and outputEventInputEventNumbers.
Referenced by initVariables(), and resetToNonRunningState().
void resetToNonRunningState | ( | unsigned char | uniqueLossID | ) |
Reset key state.
Reset all important variables to their non-running state.
uniqueLossID | 0 is reserved for system use, within your decoder never use the same value twice. |
Definition at line 60 of file decoderInterface.c.
References CAM_SYNC, COMBUSTION_SYNC, CRANK_SYNC, KeyUserDebug::currentEvent, KeyUserDebug::decoderFlags, fixedConfig2::decoderSettings, descheduleAll(), fixedConfigs2, FLAG_AND_INC_FLAGGABLE, FLAG_DECODER_SYNC_LOSSES_OFFSET, FLAG_DECODER_SYNC_STATE_CLEARS_OFFSET, FLAG_DECODER_SYNCS_NOT_CONFIRMED_OFFSET, KeyUserDebugs, OK_TO_SCHEDULE, perDecoderReset(), decoderSetting::syncConfirmationsRunning, syncConfirmationsRunningCounter, decoderSetting::syncConfirmationsStarting, syncConfirmationsStartingCounter, KeyUserDebug::syncLostOnThisEvent, KeyUserDebug::syncLostWithThisID, KeyUserDebug::syncResetCalls, ticksPerDegree0, and ticksPerDegree1.
Referenced by main(), PLLLockISR(), PrimaryRPMISR(), SecondaryRPMISR(), and SelfClockISR().
void schedulePortTPin | ( | unsigned char | outputEventNumber, |
LongTime | timeStamp | ||
) |
Schedule an ignition output event on port T.
Definition at line 108 of file decoderInterface.c.
References Counters, decoderMaxCodeTime, ectMainActiveMasks, ectMainControlRegisters, ectMainEndTimes, ectMainGoHighMasks, ectMainOnMasks, ectMainStartOffsetHolding, ectMainTimeRegisters, ectSwitchOffCodeTime, fixedConfigs1, newStartIsAfterOutputEndTimeAndCanSelfSet, outputEventDelayFinalPeriod, outputEventDelayFinalPeriodHolding, outputEventExtendNumberOfRepeats, outputEventExtendNumberOfRepeatsHolding, outputEventExtendRepeatPeriod, outputEventExtendRepeatPeriodHolding, schedulingSetting::outputEventPinNumbers, outputEventPulseWidthsHolding, outputEventPulseWidthsMath, Counter::pinScheduledAgainToStayOn, Counter::pinScheduledAlready, Counter::pinScheduledFromCold, Counter::pinScheduledToDoNothing, Counter::pinScheduledToSelfSchedule, Counter::pinScheduledToToggleError, SCHEDULE_ONE_ECT_OUTPUT, fixedConfig1::schedulingSettings, selfSetTimer, skipEventFlags, TIE, LongTime::timeLong, and LongTime::timeShorts.
Referenced by main(), and PrimaryRPMISR().