#include "memory.h"
#include "9S12XDP512.h"
#include "flashGlobals.h"
#include "errorDefines.h"
#include "globalDefines.h"
#include "structs.h"
#include "FixedConfigs.h"
#include "TunableConfigs.h"
#include "globalConstants.h"
Go to the source code of this file.
Data Structures | |
union | Tables1 |
union | Tables2 |
union | Tables3 |
union | Tables4 |
union | LongTime |
Defines | |
#define | EXTERN extern |
include "registerMasks.h | |
#define | asyncDatalogOff 0x00 |
#define | asyncDatalogBasic 0x01 |
#define | asyncDatalogConfig 0x02 |
#define | asyncDatalogLogic 0x03 |
#define | asyncDatalogADC 0x04 |
#define | asyncDatalogCircBuf 0x05 |
#define | asyncDatalogCircCAS 0x06 |
#define | asyncDatalogTrigger 0x07 |
#define | COREA01 BIT1_16 |
#define | PRIMARY_SYNC BIT2_16 |
#define | SECONDARY_SYNC BIT3_16 |
#define | ENGINE_PHASE BIT4_16 |
#define | FUEL_CUT BIT5_16 |
#define | HARD_SPARK_CUT BIT6_16 |
#define | SOFT_SPARK_CUT BIT7_16 |
#define | SPARK_RETARD BIT8_16 |
#define | STAGED_REQUIRED BIT9_16 |
#define | CALC_FUEL_IGN BIT10_16 |
#define | FORCE_READING BIT11_16 |
#define | COREA12 BIT12_16 |
#define | COREA13 BIT13_16 |
#define | COREA14 BIT14_16 |
#define | COREA15 BIT15_16 |
#define | COREA16 BIT16_16 |
#define | CLEAR_PRIMARY_SYNC NBIT2_16 |
#define | STAGED_NOT_REQUIRED NBIT9_16 |
#define | CLEAR_CALC_FUEL_IGN NBIT10_16 |
#define | CLEAR_FORCE_READING NBIT11_16 |
Variables | |
EXTERN unsigned short | RPM0 |
EXTERN unsigned short | RPM1 |
unsigned short | tachoPeriod |
EXTERN unsigned char | portHDebounce |
unsigned char | asyncDatalogType |
EXTERN unsigned short | configuredBasicDatalogLength |
EXTERN unsigned char | ShouldSendLog |
EXTERN Clock | Clocks |
EXTERN Counter | Counters |
EXTERN RuntimeVar | RuntimeVars |
EXTERN ISRLatencyVar | ISRLatencyVars |
EXTERN CoreVar * | CoreVars |
EXTERN CoreVar | CoreVars0 |
EXTERN DerivedVar * | DerivedVars |
EXTERN DerivedVar | DerivedVars0 |
EXTERN ADCArray * | ADCArrays |
EXTERN ADCArray * | ADCArraysRecord |
EXTERN ADCArray | ADCArrays0 |
EXTERN ADCArray | ADCArrays1 |
EXTERN ADCArray * | asyncADCArrays |
EXTERN ADCArray * | asyncADCArraysRecord |
EXTERN ADCArray | asyncADCArrays0 |
EXTERN ADCArray | asyncADCArrays1 |
EXTERN unsigned short * | mathSampleTimeStamp |
EXTERN unsigned short * | mathSampleTimeStampRecord |
EXTERN unsigned short * | RPM |
EXTERN unsigned short * | RPMRecord |
EXTERN unsigned short * | currentDwellMath |
EXTERN unsigned short * | currentDwellRealtime |
EXTERN unsigned short | currentDwell0 |
EXTERN unsigned short | currentDwell1 |
EXTERN unsigned char TXBuffer[TX_BUFFER_SIZE] | TXBUF |
EXTERN unsigned char RXBuffer[RX_BUFFER_SIZE] | RXBUF |
EXTERN Tables1 TablesA | RWINDOW |
EXTERN unsigned char | currentFuelRPage |
EXTERN unsigned char | currentTuneRPage |
EXTERN unsigned char | currentTimeRPage |
unsigned short | masterPulseWidth |
* Pointers to main tables to aid readability */ | |
EXTERN unsigned short | totalDwell |
unsigned short | totalAngleAfterReferenceInjection |
unsigned short | totalAngleAfterReferenceIgnition |
EXTERN unsigned long | bootFuelConst |
EXTERN unsigned short | TPSMAPRange |
EXTERN unsigned short | TPSADCRange |
EXTERN unsigned short | boundedTPSADC |
EXTERN unsigned short | bootTimeAAP |
EXTERN unsigned short | coreStatusA |
unsigned short | timerExtensionClock |
EXTERN unsigned char | mainOn |
EXTERN unsigned short | dwellOn |
EXTERN unsigned char | stagedOn |
EXTERN unsigned char | selfSetTimer |
EXTERN unsigned char | rescheduleFuelFlags |
EXTERN unsigned short | primaryPulsesPerSecondaryPulse |
EXTERN unsigned long | primaryLeadingEdgeTimeStamp |
EXTERN unsigned long | primaryTrailingEdgeTimeStamp |
EXTERN unsigned long | timeBetweenSuccessivePrimaryPulses |
EXTERN unsigned long | lastPrimaryPulseTimeStamp |
EXTERN unsigned long | lengthOfSecondaryLowPulses |
EXTERN unsigned long | lastSecondaryPulseLeadingTimeStamp |
EXTERN unsigned long | lastSecondaryPulseTrailingTimeStamp |
unsigned long | engineCyclePeriod |
EXTERN unsigned long | lastSecondaryOddTimeStamp |
EXTERN unsigned short | primaryTeethDroppedFromLackOfSync |
EXTERN unsigned char | dwellQueueLength |
EXTERN unsigned char | ignitionQueueLength |
EXTERN unsigned char | nextDwellChannel |
EXTERN unsigned char | nextIgnitionChannel |
EXTERN unsigned short | ignitionAdvances [IGNITION_CHANNELS *2] |
EXTERN unsigned short | queuedDwellOffsets [IGNITION_CHANNELS] |
EXTERN unsigned short | queuedIgnitionOffsets [IGNITION_CHANNELS] |
EXTERN volatile unsigned short *volatile | injectorMainTimeRegisters [INJECTION_CHANNELS] |
EXTERN volatile unsigned char *volatile | injectorMainControlRegisters [INJECTION_CHANNELS] |
EXTERN unsigned short | injectorMainStartTimesHolding [INJECTION_CHANNELS] |
EXTERN unsigned long | injectorMainEndTimes [INJECTION_CHANNELS] |
EXTERN unsigned short | injectorCodeOpenRuntimes [INJECTION_CHANNELS] |
EXTERN unsigned short | injectorCodeCloseRuntimes [INJECTION_CHANNELS] |
EXTERN unsigned short * | injectorMainPulseWidthsMath |
EXTERN unsigned short * | injectorStagedPulseWidthsMath |
EXTERN unsigned short * | injectorMainPulseWidthsRealtime |
EXTERN unsigned short * | injectorStagedPulseWidthsRealtime |
EXTERN unsigned short | injectorMainPulseWidths0 [INJECTION_CHANNELS] |
EXTERN unsigned short | injectorMainPulseWidths1 [INJECTION_CHANNELS] |
EXTERN unsigned short | injectorStagedPulseWidths0 [INJECTION_CHANNELS] |
EXTERN unsigned short | injectorStagedPulseWidths1 [INJECTION_CHANNELS] |
EXTERN unsigned short | injectorCodeLatencies [INJECTION_CHANNELS] |
The central header for all source files to include. This pulls in the device header, all other shared headers, all global defines, all global constant declarations, all type definitions and all global variables. Other variables that are actually in global space but only shared between a few select files should be placed in the header for the main file that uses them.
Definition in file freeEMS.h.
#define CALC_FUEL_IGN BIT10_16 |
#define CLEAR_CALC_FUEL_IGN NBIT10_16 |
#define CLEAR_FORCE_READING NBIT11_16 |
#define CLEAR_PRIMARY_SYNC NBIT2_16 |
Definition at line 329 of file freeEMS.h.
Referenced by PrimaryRPMISR(), resetToNonRunningState(), and SecondaryRPMISR().
#define EXTERN extern |
#define FORCE_READING BIT11_16 |
#define PRIMARY_SYNC BIT2_16 |
#define STAGED_NOT_REQUIRED NBIT9_16 |
#define STAGED_REQUIRED BIT9_16 |
Definition at line 320 of file freeEMS.h.
Referenced by calculateFuelAndIgnition(), and InjectorXISR().
Bank 0 secondary running variables
Definition at line 176 of file freeEMS.h.
Referenced by calculateFuelAndIgnition(), generateCoreVars(), initVariables(), main(), populateBasicDatalog(), and PrimaryRPMISR().
EXTERN ADCArray ADCArrays0 |
main adc storage area for syncronous sampling in the engine position ISR or injection ISR or ignition ISR etc.
Definition at line 178 of file freeEMS.h.
Referenced by initVariables(), and main().
EXTERN ADCArray ADCArrays1 |
main adc storage area for syncronous sampling in the engine position ISR or injection ISR or ignition ISR etc.
Definition at line 179 of file freeEMS.h.
Referenced by initVariables(), and main().
EXTERN ADCArray* ADCArraysRecord |
main adc storage area for syncronous sampling in the engine position ISR or injection ISR or ignition ISR etc.
Definition at line 177 of file freeEMS.h.
Referenced by initVariables(), and main().
EXTERN ADCArray* asyncADCArrays |
main adc storage area for syncronous sampling in the engine position ISR or injection ISR or ignition ISR etc.
Definition at line 181 of file freeEMS.h.
Referenced by initVariables().
EXTERN ADCArray asyncADCArrays0 |
secondary adc storage area for asynchronously sampling in the RTC/RTI ISR
Definition at line 183 of file freeEMS.h.
Referenced by initVariables().
EXTERN ADCArray asyncADCArrays1 |
secondary adc storage area for asynchronously sampling in the RTC/RTI ISR
Definition at line 184 of file freeEMS.h.
Referenced by initVariables().
EXTERN ADCArray* asyncADCArraysRecord |
secondary adc storage area for asynchronously sampling in the RTC/RTI ISR
Definition at line 182 of file freeEMS.h.
Referenced by initVariables().
unsigned char asyncDatalogType |
EXTERN unsigned long bootFuelConst |
Definition at line 299 of file freeEMS.h.
Referenced by calculateFuelAndIgnition(), and initConfiguration().
EXTERN unsigned short bootTimeAAP |
EXTERN unsigned short boundedTPSADC |
EXTERN unsigned short configuredBasicDatalogLength |
Definition at line 122 of file freeEMS.h.
Referenced by decodePacketAndRespond(), initVariables(), main(), and populateBasicDatalog().
EXTERN unsigned short coreStatusA |
Definition at line 310 of file freeEMS.h.
Referenced by calculateFuelAndIgnition(), InjectorXISR(), main(), PrimaryRPMISR(), resetToNonRunningState(), RTIISR(), and SecondaryRPMISR().
Definition at line 168 of file freeEMS.h.
Referenced by calculateFuelAndIgnition(), generateCoreVars(), generateDerivedVars(), initVariables(), and populateBasicDatalog().
Pointer to the core running variables
Definition at line 169 of file freeEMS.h.
Referenced by initVariables().
Definition at line 130 of file freeEMS.h.
Referenced by IRQISR(), LowVoltageISR(), main(), PortJISR(), PortPISR(), PrimaryRPMISR(), SCI0ISR(), SecondaryRPMISR(), sendDebugIfClear(), sendErrorIfClear(), UISR(), and XIRQISR().
EXTERN unsigned short currentDwell0 |
EXTERN unsigned short currentDwell1 |
EXTERN unsigned short* currentDwellMath |
Definition at line 190 of file freeEMS.h.
Referenced by calculateFuelAndIgnition(), initVariables(), and main().
EXTERN unsigned short* currentDwellRealtime |
EXTERN unsigned char currentFuelRPage |
EXTERN unsigned char currentTimeRPage |
EXTERN unsigned char currentTuneRPage |
EXTERN DerivedVar* DerivedVars |
Bank 0 core running variables
Definition at line 172 of file freeEMS.h.
Referenced by calculateFuelAndIgnition(), generateDerivedVars(), initVariables(), and populateBasicDatalog().
EXTERN DerivedVar DerivedVars0 |
Pointer to the secondary running variables
Definition at line 173 of file freeEMS.h.
Referenced by initVariables().
EXTERN unsigned char dwellQueueLength |
unsigned long engineCyclePeriod |
Definition at line 72 of file staticInit.c.
Referenced by ModDownCtrISR(), PrimaryRPMISR(), resetToNonRunningState(), and SecondaryRPMISR().
EXTERN unsigned short ignitionAdvances[IGNITION_CHANNELS *2] |
EXTERN unsigned char ignitionQueueLength |
EXTERN unsigned short injectorCodeCloseRuntimes[INJECTION_CHANNELS] |
EXTERN unsigned short injectorCodeLatencies[INJECTION_CHANNELS] |
EXTERN unsigned short injectorCodeOpenRuntimes[INJECTION_CHANNELS] |
EXTERN volatile unsigned char* volatile injectorMainControlRegisters[INJECTION_CHANNELS] |
Definition at line 406 of file freeEMS.h.
Referenced by initVariables(), InjectorXISR(), and PrimaryRPMISR().
EXTERN unsigned long injectorMainEndTimes[INJECTION_CHANNELS] |
EXTERN unsigned short injectorMainPulseWidths0[INJECTION_CHANNELS] |
EXTERN unsigned short injectorMainPulseWidths1[INJECTION_CHANNELS] |
EXTERN unsigned short* injectorMainPulseWidthsMath |
Definition at line 418 of file freeEMS.h.
Referenced by calculateFuelAndIgnition(), initVariables(), and main().
EXTERN unsigned short* injectorMainPulseWidthsRealtime |
Definition at line 420 of file freeEMS.h.
Referenced by initVariables(), InjectorXISR(), main(), and PrimaryRPMISR().
EXTERN unsigned short injectorMainStartTimesHolding[INJECTION_CHANNELS] |
EXTERN volatile unsigned short* volatile injectorMainTimeRegisters[INJECTION_CHANNELS] |
Definition at line 405 of file freeEMS.h.
Referenced by initVariables(), InjectorXISR(), and PrimaryRPMISR().
EXTERN unsigned short injectorStagedPulseWidths0[INJECTION_CHANNELS] |
EXTERN unsigned short injectorStagedPulseWidths1[INJECTION_CHANNELS] |
EXTERN unsigned short* injectorStagedPulseWidthsMath |
EXTERN unsigned short* injectorStagedPulseWidthsRealtime |
EXTERN ISRLatencyVar ISRLatencyVars |
Definition at line 132 of file freeEMS.h.
Referenced by initVariables(), main(), PrimaryRPMISR(), and SecondaryRPMISR().
EXTERN unsigned long lastPrimaryPulseTimeStamp |
EXTERN unsigned long lastSecondaryOddTimeStamp |
EXTERN unsigned long lastSecondaryPulseLeadingTimeStamp |
EXTERN unsigned long lastSecondaryPulseTrailingTimeStamp |
EXTERN unsigned long lengthOfSecondaryLowPulses |
Definition at line 374 of file freeEMS.h.
Referenced by generateDerivedVars(), and SecondaryRPMISR().
unsigned short masterPulseWidth |
* Pointers to main tables to aid readability */
* Pointers to SmallTablesA */ * Pointers to SmallTablesB */
Definition at line 51 of file staticInit.c.
Referenced by calculateFuelAndIgnition(), and PrimaryRPMISR().
EXTERN unsigned short* mathSampleTimeStamp |
secondary adc storage area for asynchronously sampling in the RTC/RTI ISR
Definition at line 186 of file freeEMS.h.
Referenced by initVariables(), and main().
EXTERN unsigned short* mathSampleTimeStampRecord |
Definition at line 187 of file freeEMS.h.
Referenced by initVariables(), main(), and PrimaryRPMISR().
EXTERN unsigned char nextDwellChannel |
EXTERN unsigned char nextIgnitionChannel |
EXTERN unsigned char portHDebounce |
EXTERN unsigned long primaryLeadingEdgeTimeStamp |
EXTERN unsigned short primaryPulsesPerSecondaryPulse |
EXTERN unsigned short primaryTeethDroppedFromLackOfSync |
EXTERN unsigned long primaryTrailingEdgeTimeStamp |
EXTERN unsigned short queuedDwellOffsets[IGNITION_CHANNELS] |
EXTERN unsigned short queuedIgnitionOffsets[IGNITION_CHANNELS] |
EXTERN unsigned char rescheduleFuelFlags |
EXTERN unsigned short* RPM |
Definition at line 188 of file freeEMS.h.
Referenced by generateCoreVars(), initVariables(), and main().
EXTERN unsigned short RPM0 |
Definition at line 106 of file freeEMS.h.
Referenced by initVariables(), main(), and resetToNonRunningState().
EXTERN unsigned short RPM1 |
Definition at line 107 of file freeEMS.h.
Referenced by initVariables(), main(), and resetToNonRunningState().
EXTERN unsigned short* RPMRecord |
Definition at line 189 of file freeEMS.h.
Referenced by initVariables(), main(), and PrimaryRPMISR().
EXTERN RuntimeVar RuntimeVars |
Definition at line 131 of file freeEMS.h.
Referenced by main(), PrimaryRPMISR(), RTIISR(), SCI0ISR(), and SecondaryRPMISR().
EXTERN unsigned char selfSetTimer |
EXTERN unsigned char ShouldSendLog |
EXTERN unsigned char stagedOn |
unsigned short tachoPeriod |
EXTERN unsigned long timeBetweenSuccessivePrimaryPulses |
unsigned short timerExtensionClock |
Definition at line 337 of file freeEMS.h.
Referenced by InjectorXISR(), PrimaryRPMISR(), SecondaryRPMISR(), and TimerOverflow().
unsigned short totalAngleAfterReferenceIgnition |
Definition at line 52 of file staticInit.c.
unsigned short totalAngleAfterReferenceInjection |
Definition at line 53 of file staticInit.c.
Referenced by calculateFuelAndIgnition(), and PrimaryRPMISR().
EXTERN unsigned short totalDwell |
EXTERN unsigned short TPSADCRange |
Definition at line 301 of file freeEMS.h.
Referenced by generateCoreVars(), and initConfiguration().
EXTERN unsigned short TPSMAPRange |
Definition at line 300 of file freeEMS.h.
Referenced by generateCoreVars(), and initConfiguration().