68#if EFI_CONFIGURATION_STORAGE
73#if EFI_MAP_AVERAGING && defined (MODULE_MAP_AVERAGING)
77#if (BOARD_TLE8888_COUNT > 0)
98 efiPrintfProto(PROTOCOL_VERSION_TAG,
"%d@%u %s %s %ld",
112 const char *hwPinName;
119 efiPrintfProto(PROTOCOL_OUTPIN,
"%s@%s", pinName, hwPinName);
130 for (
int i = 0;i<CAM_INPUTS_COUNT;i++) {
136 for (
int i = 0; i < cylCount; i++) {
146#if EFI_ENGINE_SNIFFER
167#if !defined(LOGIC_ANALYZER_BUFFER_SIZE)
169#define LOGIC_ANALYZER_BUFFER_SIZE 1000
172#if EFI_LOGIC_ANALYZER
186 if (hasFirmwareError()) {
200#if EFI_ENGINE_CONTROL && EFI_SHAFT_POSITION_INPUT
203static int prevCkpEventCounter = -1;
205 if (prevCkpEventCounter == currentCkpEventCounter && timeOfPreviousReport == nowSeconds) {
208 timeOfPreviousReport = nowSeconds;
210 prevCkpEventCounter = currentCkpEventCounter;
212 chThdSleepMilliseconds(200);
215#if EFI_LOGIC_ANALYZER
241#if EFI_ENGINE_CONTROL && EFI_SHAFT_POSITION_INPUT
254 return counter % 2 == 0 ? onTimeMs : offTimeMs;
257 void setAllLeds(
int value) {
260 for (
size_t i = 0; !hasFirmwareError() && i < efi::size(
leds); i++) {
271 }
else if (counter == 2) {
274 }
else if (counter % 2 == 0) {
280#define needErrorReportFile false
287#define BLINKING_PERIOD_MS 33
289 if (hasFirmwareError()) {
298#if EFI_CONFIGURATION_STORAGE
300 offTimeMs = onTimeMs = 500;
308 offTimeMs = 0.6 * onTimeMs;
313 #if EFI_ENGINE_CONTROL
444#if EFI_SHAFT_POSITION_INPUT
457#ifdef MODULE_GEAR_DETECTOR
508 for (
size_t i = 0;i<LUA_GAUGE_COUNT;i++) {
512 for (
int i = 0; i < LUA_ANALOG_INPUT_COUNT; i++) {
577#if EFI_VEHICLE_SPEED && defined (MODULE_ODOMETER)
591#if EFI_ENGINE_CONTROL
601#if EFI_ENGINE_CONTROL
611#if EFI_LAUNCH_CONTROL
619#if EFI_CONFIGURATION_STORAGE
641 static Timer blinkIndicatorsTimer;
642 constexpr float blinkHalfPeriod = 0.3;
643 bool isBlinkPhase = blinkIndicatorsTimer.hasElapsedSec(blinkHalfPeriod);
644#if EFI_ELECTRONIC_THROTTLE_BODY
651 if (blinkIndicatorsTimer.hasElapsedSec(2 * blinkHalfPeriod)) {
652 blinkIndicatorsTimer.reset();
669#if EFI_SHAFT_POSITION_INPUT
689#if EFI_ENGINE_CONTROL
708 tsOutputChannels->
hp = -1;
709 tsOutputChannels->
torque = -1;
740#if EFI_SHAFT_POSITION_INPUT
750#if HAL_USE_PAL && EFI_PROD_CODE
755 case DBG_LOGIC_ANALYZER:
756#if EFI_LOGIC_ANALYZER
const char * getEngine_type_e(engine_type_e value)
FuelComputer fuelComputer
TriggerCentral triggerCentral
FuelSchedule injectionEvents
LaunchControlBase launchController
RpmCalculator rpmCalculator
TunerStudioOutputChannels outputChannels
constexpr auto & module()
InjectorOutputPin injectorsStage2[MAX_CYLINDER_COUNT]
IgnitionOutputPin trailingCoils[MAX_CYLINDER_COUNT]
RegisteredOutputPin starterControl
InjectorOutputPin injectors[MAX_CYLINDER_COUNT]
RegisteredOutputPin starterRelayDisable
OutputPin communicationLedPin
IgnitionOutputPin coils[MAX_CYLINDER_COUNT]
RegisteredOutputPin checkEnginePin
WarningCodeState warnings
InjectionEvent elements[MAX_CYLINDER_COUNT]
float getInstantRpm() const
const char * getShortName() const
Single output pin reference and state.
void initPin(const char *msg, brain_pin_e brainPin, pin_output_mode_e outputMode, bool forceInitWithFatalError=false)
bool getLogicValue() const
void setValue(const char *msg, int logicValue, bool isForce=false)
virtual int getPeriodMs()=0
virtual void PeriodicTask()=0
float getRpmAcceleration() const
uint32_t getRevolutionCounterSinceStart(void) const
virtual bool hasSensor() const
virtual SensorResult get() const =0
virtual float getRaw() const
static float getOrZero(SensorType type)
InstantRpmCalculator instantRpm
PrimaryTriggerDecoder triggerState
angle_t getVVTPosition(uint8_t bankIndex, uint8_t camIndex)
int getHwEventCounter(int index) const
bool isTriggerDecoderError()
uint32_t orderingErrorCounter
int64_t getTotalEventCounter() const
bool someSortOfTriggerError() const
uint32_t totalTriggerErrorCounter
float get() const override
Get the current motor duty cycle.
bool isWarningNow() const
rusEfi console sniffer data buffer
bool is_usb_serial_ready()
DcHardware * getPrimaryDCHardwareForLogging()
efitimesec_t getTimeNowS()
Current system time in seconds (32 bits)
void blinkEtbErrorCodes(bool blinkPhase)
static EngineAccessor engine
static constexpr engine_configuration_s * engineConfiguration
rusEfi console wave sniffer
const char * getCriticalErrorMessage()
bool hasErrorReportFile()
percent_t getInjectorDutyCycleStage2(float rpm)
percent_t getInjectorDutyCycle(float rpm)
Idle Valve Control thread.
static CCM_OPTIONAL FunctionalSensor iat(SensorType::Iat, MS2NT(10))
static CCM_OPTIONAL FunctionalSensor clt(SensorType::Clt, MS2NT(10))
static RedundantPair pedal(pedalPrimary, pedalSecondary, SensorType::AcceleratorPedalUnfiltered)
static RedundantPair tps2(tps2p, tps2s, SensorType::Tps2)
FrequencySensor vehicleSpeedSensor(SensorType::VehicleSpeed, MS2NT(500))
void scheduleLogging(Logging *logging)
void printWave(Logging *logging)
void reportLogicAnalyzerToTS()
This data structure holds current malfunction codes.
void updateSdCardLiveFlags()
const char * hwPortname(brain_pin_e brainPin)
bool isBrainPinValid(brain_pin_e brainPin)
expected< float > SensorResult
Declaration for SensorReader, the class used to acquire readings from a sensor.
@ CompressorDischargePressure
@ AcceleratorPedalPrimary
@ CompressorDischargeTemperature
@ AcceleratorPedalSecondary
@ AcceleratorPedalUnfiltered
auxTemp1("auxTemp1", SensorCategory.SENSOR_INPUTS, FieldType.INT16, 18, 0.01, 0.0, 0.0, "deg C")
ambientTemp("ambientTemp", SensorCategory.SENSOR_INPUTS, FieldType.INT16, 748, 0.01, 0.0, 0.0, "deg C")
fuelTemp("fuelTemp", SensorCategory.SENSOR_INPUTS, FieldType.INT16, 746, 0.01, 0.0, 0.0, "deg C")
wallFuel("Fuel on the wall\nin ms of injector open time for each injector.", SensorCategory.SENSOR_INPUTS, FieldType.INT, 1744, 1.0, -1.0, -1.0, "")
oilTemp("oilTemp", SensorCategory.SENSOR_INPUTS, FieldType.INT16, 744, 0.01, 0.0, 0.0, "deg C")
compressorDischargeTemp("compressorDischargeTemp", SensorCategory.SENSOR_INPUTS, FieldType.INT16, 750, 0.01, 0.0, 0.0, "deg C")
lambdaValue("Lambda", SensorCategory.SENSOR_INPUTS, FieldType.INT16, 36, 1.0E-4, 0.0, 0.0, "")
auxTemp2("auxTemp2", SensorCategory.SENSOR_INPUTS, FieldType.INT16, 20, 0.01, 0.0, 0.0, "deg C")
void executorStatistics()
percent_t getCoilDutyCycle(float rpm)
@ SHAFT_SECONDARY_FALLING
static void updateTempSensors()
static void updateLambda()
void updateUnfilteredRawPedal()
static void initStatusLeds()
static void updateVehicleSpeed()
void printOverallStatus()
static void updateFlags()
void updateDevConsoleState()
Sends all pending data to rusEfi console.
static void updateFuelCorrections()
static SensorType luaGaugeTypes[]
static void updateVvtSensors()
static OutputPin * leds[]
static void printEngineSnifferPinMappings()
uint32_t maxLockedDuration
static void updateFuelInfo()
static void printVersionForConsole(const char *engineTypeName, const char *firmwareBuildId)
void updateTunerStudioState()
static void updateIgnition(float rpm)
static void updateFuelSensors()
static int packEngineMode()
static void updateFuelResults()
static void updateEgtSensors()
void startStatusThreads()
static bool isTriggerErrorNow()
void initWarningRunningPins()
static char logicAnalyzerBuffer[LOGIC_ANALYZER_BUFFER_SIZE]
static void updateMiscSensors()
static Logging logicAnalyzerLogger("logic analyzer", logicAnalyzerBuffer, sizeof(logicAnalyzerBuffer))
static void printOutPin(const char *pinName, brain_pin_e hwPin)
static CommunicationBlinkingTask communicationsBlinkingTask
static void updatePressures()
static Timer printVersionTimer
static void updateThrottles()
static void updateRawSensors()
static void updateSensors()
bool getNeedToWriteConfiguration()
Accelerometer accelerometer
output_pin_e trailingCoilPins[MAX_CYLINDER_COUNT]
engine_load_mode_e fuelAlgorithm
ignition_mode_e ignitionMode
adc_channel_e auxAnalogInputs[LUA_ANALOG_INPUT_COUNT]
output_pin_e injectionPins[MAX_CYLINDER_COUNT]
brain_input_pin_e triggerInputPins[TRIGGER_INPUT_PIN_COUNT]
output_pin_e injectionPinsStage2[MAX_CYLINDER_COUNT]
injection_mode_e injectionMode
brain_input_pin_e camInputs[CAM_INPUTS_COUNT]
output_pin_e ignitionPins[MAX_CYLINDER_COUNT]
float stftCorrection[FT_BANK_COUNT]
scaled_channel< uint16_t, 1000, 1 > stoichiometricRatio
scaled_channel< uint16_t, 1000, 1 > afrGasolineScale
scaled_channel< int16_t, 100, 1 > compressorDischargeTemp
scaled_channel< int16_t, 1000, 1 > rawBattery
float luaGauges[LUA_GAUGE_COUNT]
scaled_channel< uint16_t, 30, 1 > throttleInletPressure
scaled_channel< int16_t, 100, 1 > auxTemp2
scaled_channel< uint16_t, 100, 1 > speedToRpmRatio
scaled_channel< uint16_t, 100, 1 > coilDutyCycle
uint16_t maxLockedDuration
int8_t sparkCutReasonBlinker
scaled_channel< int16_t, 1000, 1 > accelerationLat
scaled_channel< int16_t, 100, 1 > accPedalUnfiltered
scaled_channel< int16_t, 100, 1 > idlePositionSensor
scaled_channel< int16_t, 100, 1 > wastegatePositionSensor
scaled_channel< int16_t, 1000, 1 > accelerationVert
scaled_channel< uint16_t, 100, 1 > vehicleSpeedKph
scaled_channel< int16_t, 1000, 1 > rawAuxAnalog4
scaled_channel< int16_t, 10, 1 > highFuelPressure
scaled_channel< int16_t, 1000, 1 > rawTps2Secondary
uint16_t revolutionCounterSinceStart
scaled_channel< int16_t, 1000, 1 > rawTps1Secondary
scaled_channel< int16_t, 100, 1 > TPS2Value
scaled_channel< uint16_t, 10, 1 > mafEstimate
scaled_channel< int16_t, 1000, 1 > rawAuxAnalog1
bool triggerPageRefreshFlag
uint32_t triggerSecondaryFall
uint32_t triggerPrimaryFall
scaled_channel< uint16_t, 10000, 1 > lambdaValue
scaled_channel< int16_t, 1000, 1 > rawHighFuelPressure
scaled_channel< uint16_t, 1000, 1 > rawMaf
scaled_channel< int16_t, 100, 1 > ambientTemp
int8_t fuelCutReasonBlinker
scaled_channel< uint16_t, 30, 1 > oilPressure
scaled_channel< int16_t, 1000, 1 > rawTps1Primary
scaled_channel< int16_t, 1000, 1 > rawOilPressure
scaled_channel< uint16_t, 30, 1 > baroPressure
scaled_channel< uint16_t, 1000, 1 > afr2GasolineScale
scaled_channel< uint8_t, 2, 1 > injectorDutyCycle
scaled_channel< int16_t, 100, 1 > tps12Split
scaled_channel< int16_t, 1000, 1 > rawWastegatePosition
scaled_channel< int16_t, 1000, 1 > rawAuxTemp1
scaled_channel< uint16_t, 10, 1 > veValue
scaled_channel< uint16_t, 1000, 1 > VBatt
scaled_channel< int16_t, 100, 1 > fuelTankLevel
scaled_channel< int16_t, 4, 1 > egt[EGT_CHANNEL_COUNT]
scaled_channel< int16_t, 50, 1 > vvtPositionB1E
scaled_channel< int16_t, 1000, 1 > accelerationLon
scaled_channel< int16_t, 1000, 1 > rawIat
scaled_channel< int16_t, 1000, 1 > internalVref
scaled_channel< uint16_t, 1000, 1 > AFRValue2
scaled_channel< int16_t, 100, 1 > accPedalSplit
scaled_channel< int16_t, 100, 1 > fuelTemp
scaled_channel< int16_t, 100, 1 > wallFuelCorrectionValue
uint32_t totalTriggerErrorCounter
scaled_channel< uint16_t, 30, 1 > compressorDischargePressure
scaled_channel< int16_t, 1000, 1 > rawAuxTemp2
scaled_channel< int16_t, 1000, 1 > rawLowFuelPressure
scaled_channel< int16_t, 300, 1 > tpsAccelFuel
uint8_t extiOverflowCount
scaled_channel< uint16_t, 1000, 1 > rawMap
scaled_channel< uint16_t, 1000, 1 > AFRValue
scaled_channel< uint16_t, 100, 1 > Gego
scaled_channel< int16_t, 30, 1 > lowFuelPressure
scaled_channel< int16_t, 1000, 1 > rawClt
scaled_channel< uint16_t, 30, 1 > MAPValue
scaled_channel< uint16_t, 1000, 1 > SmoothedAFRValue2
scaled_channel< int16_t, 100, 1 > intake
scaled_channel< int16_t, 1000, 1 > gyroYaw
scaled_channel< int16_t, 1000, 1 > rawAuxAnalog3
scaled_channel< int16_t, 50, 1 > vvtPositionB2E
scaled_channel< int16_t, 1000, 1 > rawAmbientTemp
uint32_t triggerSecondaryRise
uint32_t triggerPrimaryRise
scaled_channel< uint16_t, 1000, 1 > SmoothedAFRValue
uint16_t totalFuelConsumption
scaled_channel< int16_t, 100, 1 > tps1Split
scaled_channel< uint16_t, 100, 1 > wallFuelAmount
scaled_channel< int16_t, 1000, 1 > rawFuelLevel
scaled_channel< uint8_t, 2, 1 > flexPercent
scaled_channel< uint16_t, 1000, 1 > rawMaf2
scaled_channel< int16_t, 100, 1 > oilTemp
scaled_channel< uint16_t, 10, 1 > distanceTraveled
scaled_channel< int16_t, 100, 1 > throttlePedalPosition
int8_t internalMcuTemperature
scaled_channel< uint16_t, 10, 1 > mafMeasured2
uint8_t maxTriggerReentrant
scaled_channel< int16_t, 100, 1 > tps2Split
scaled_channel< uint16_t, 10, 1 > mafMeasured
scaled_channel< uint16_t, 200, 1 > fuelFlowRate
scaled_channel< uint8_t, 2, 1 > injectorDutyCycleStage2
scaled_channel< uint16_t, 1000, 1 > rawAfr
scaled_channel< uint16_t, 10000, 1 > lambdaValue2
uint32_t orderingErrorCounter
scaled_channel< int16_t, 1000, 1 > rawIdlePositionSensor
scaled_channel< int16_t, 100, 1 > coolant
scaled_channel< int16_t, 50, 1 > vvtPositionB2I
scaled_channel< int16_t, 50, 1 > vvtPositionB1I
scaled_channel< int16_t, 100, 1 > TPSValue
scaled_channel< int16_t, 1000, 1 > rawTps2Primary
scaled_channel< int16_t, 1000, 1 > rawAcPressure
float throttlePressureRatio
scaled_channel< int16_t, 100, 1 > auxTemp1
uint32_t rtcUnixEpochTime
scaled_channel< int16_t, 1000, 1 > rawAnalogInput[LUA_ANALOG_INPUT_COUNT]
scaled_channel< int16_t, 1000, 1 > rawAuxAnalog2
uint8_t starterRelayDisable
float getThrottlePressureRatio(float map)
constexpr int convertVoltageTo10bitADC(float voltage)
bool needToTriggerTsRefresh()
bool tsCalibrationIsIdle()
maintainConstantValue implementation header