rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
Functions | Variables
knock_controller.cpp File Reference

Functions

int getCylinderKnockBank (uint8_t cylinderNumber)
 
 __attribute__ ((weak)) void onStartKnockSampling(uint8_t cylinderNumber
 
 UNUSED (samplingTimeSeconds)
 
 UNUSED (channelIdx)
 
static void startKnockSampling (Engine *p_engine)
 

Variables

float samplingTimeSeconds
 
float uint8_t channelIdx
 
static uint8_t cylinderNumberCopy
 

Function Documentation

◆ __attribute__()

__attribute__ ( (weak)  )
Here is the call graph for this function:

◆ getCylinderKnockBank()

int getCylinderKnockBank ( uint8_t  cylinderNumber)

Definition at line 11 of file knock_controller.cpp.

11 {
12 // C/C++ can't index in to bit fields, we have to provide lookup ourselves
13 switch (cylinderNumber) {
14 case 0:
16 case 1:
18 case 2:
20 case 3:
22 case 4:
24 case 5:
26 case 6:
28 case 7:
30 case 8:
32 case 9:
34 case 10:
36 case 11:
38 default:
39 return 0;
40 }
41}
static constexpr engine_configuration_s * engineConfiguration

Referenced by startKnockSampling().

Here is the caller graph for this function:

◆ startKnockSampling()

static void startKnockSampling ( Engine p_engine)
static

Definition at line 172 of file knock_controller.cpp.

172 {
173 // todo: why do we pass engine as parameter? is that for unit tests?
174 if (!p_engine->rpmCalculator.isRunning()) {
175 return;
176 }
177
178 // Convert sampling angle to time
179 float samplingSeconds = engine->rpmCalculator.oneDegreeUs * engineConfiguration->knockSamplingDuration / US_PER_SECOND_F;
180
181 // Look up which channel this cylinder uses
183
184 // Call the driver to begin sampling
186}
uint16_t channel
Definition adc_inputs.h:104
RpmCalculator rpmCalculator
Definition engine.h:306
floatus_t oneDegreeUs
bool isRunning() const
static EngineAccessor engine
Definition engine.h:413
int getCylinderKnockBank(uint8_t cylinderNumber)
static uint8_t cylinderNumberCopy
void onStartKnockSampling(uint8_t cylinderNumber, float samplingSeconds, uint8_t channelIdx)
Here is the call graph for this function:

◆ UNUSED() [1/2]

UNUSED ( channelIdx  )

◆ UNUSED() [2/2]

UNUSED ( samplingTimeSeconds  )

Referenced by __attribute__(), adcIsMuxedInput(), adcOnchipSlowUpdate(), adcTriggerTurnOnInputPin(), TriggerAdcDetector::analogCallback(), auxOutBench(), boardAfterTuneDefaults(), boardConfigureLuaHooks(), boardIsSpecialVvtDecoder(), boardOverrideGppwm(), boardTriggerCallback(), boardTsAction(), boardUpdateDash(), customAdjustCustom(), TriggerCentral::decodeMapCam(), TriggerAdcDetector::digitalCallback(), emptyCallbackWithConfiguration(), extIonCallback(), extiTriggerTurnOnInputPin(), FLASH_Erase_Sector(), FLASH_MassErase(), getAuxDigital(), getCodeForIgnition(), getLiveData(), LongTermIdleTrim::getLtitFactor(), VvtController::getOpenLoop(), BoostController::getOpenLoop(), getRemainingStack(), getSavedBenchTestPinStates(), handleDtcRequest(), hellenBoardIdInputCallback(), icuovercapture(), TriggerCentral::isMapCamSync(), LogTriggerCamTooth(), LogTriggerCoilState(), LogTriggerInjectorState(), LogTriggerSync(), lua_readpin(), mmc_lld_is_card_inserted(), mmc_lld_is_write_protected(), onHellenEnChange(), onHellenSdChange(), Engine::onSparkFireKnockSense(), Engine::OnTriggerStateProperState(), portSetHardwareSchedulerTimer(), printHistogram(), processCanSetCalibration(), rpmShaftPositionCallback(), scheduleSparkEvent(), sdc_lld_is_card_inserted(), sdc_lld_is_write_protected(), sendErrorCode(), OutputPin::setValue(), skipToothSpecialShape(), tsRxIRQHalfHandler(), tsRxIRQIdleHandler(), LongTermIdleTrim::update(), InstantRpmCalculator::updateInstantRpm(), USBD_FS_DeviceDescriptor(), USBD_FS_LangIDStrDescriptor(), USBD_FS_ManufacturerStrDescriptor(), and USBD_FS_SerialStrDescriptor().

Variable Documentation

◆ channelIdx

float uint8_t channelIdx
Initial value:
{
UNUSED(cylinderNumber)
UNUSED(samplingTimeSeconds)

Definition at line 161 of file knock_controller.cpp.

Referenced by getKnockConversionGroup(), and onStartKnockSampling().

◆ cylinderNumberCopy

uint8_t cylinderNumberCopy
static

Definition at line 168 of file knock_controller.cpp.

Referenced by Engine::onSparkFireKnockSense(), and startKnockSampling().

◆ samplingTimeSeconds

float samplingTimeSeconds

Definition at line 161 of file knock_controller.cpp.

Go to the source code of this file.