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

Functions

void setManualIdleValvePosition (int positionPercent)
 
static void startInputPinIfValid (const char *msg, brain_pin_e pin, pin_input_mode_e mode)
 
percent_t getIdlePosition ()
 
void startSwitchPins ()
 
void stopSwitchPins ()
 
static void applyPidSettings ()
 
void setTargetIdleRpm (int value)
 
void startIdleBench (void)
 
void setDefaultIdleParameters ()
 
void startIdleThread ()
 

Function Documentation

◆ applyPidSettings()

static void applyPidSettings ( )
static

Definition at line 84 of file idle_thread_io.cpp.

Referenced by startIdleThread().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getIdlePosition()

percent_t getIdlePosition ( )

Definition at line 47 of file idle_thread_io.cpp.

47 {
48#if EFI_IDLE_CONTROL
50#else
51 return 0;
52#endif
53}
percent_t currentIdlePosition

Referenced by IdleController::onFastCallback().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setDefaultIdleParameters()

void setDefaultIdleParameters ( )

Definition at line 106 of file idle_thread_io.cpp.

106 {
110
113
114 // Good starting point is 10 degrees per 100 rpm, aka 0.1 deg/rpm
118
119 // Allow +- 10 degrees adjustment
122
123 // Idle region is target + 300 RPM
125
128}

Referenced by setDefaultEngineConfiguration().

Here is the caller graph for this function:

◆ setManualIdleValvePosition()

void setManualIdleValvePosition ( int  positionPercent)

Definition at line 31 of file idle_thread_io.cpp.

31 {
32 if (positionPercent < 1 || positionPercent > 99)
33 return;
34 efiPrintf("setting idle valve position %d", positionPercent);
35 // todo: this is not great that we have to write into configuration here
36 setTable(config->cltIdleCorrTable, positionPercent);
37}
static constexpr persistent_config_s * config
float cltIdleCorrTable[CLT_IDLE_TABLE_RPM_SIZE][CLT_IDLE_TABLE_CLT_SIZE]
constexpr void setTable(TElement(&dest)[N][M], const VElement value)
Here is the call graph for this function:

◆ setTargetIdleRpm()

void setTargetIdleRpm ( int  value)

Definition at line 89 of file idle_thread_io.cpp.

89 {
90 setTargetRpmCurve(value);
91 efiPrintf("target idle RPM %d", value);
92}
void setTargetRpmCurve(float rpm)
Here is the call graph for this function:

◆ startIdleBench()

void startIdleBench ( void  )

Idle test would activate the solenoid for three seconds

Definition at line 97 of file idle_thread_io.cpp.

97 {
98 engine->timeToStopIdleTest = getTimeNowUs() + MS2US(3000); // 3 seconds
99 efiPrintf("idle valve bench test");
100}
efitimeus_t timeToStopIdleTest
Definition engine.h:351
efitimeus_t getTimeNowUs()
Definition efitime.cpp:26

Referenced by handleBenchCategory(), and startIdleThread().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ startIdleThread()

void startIdleThread ( )

Definition at line 130 of file idle_thread_io.cpp.

130 {
131 // Force the idle controller to use 0 offset, as this is handled by the open loop table instead.
133
134 IdleController *controller = &engine->module<IdleController>().unmock();
135
136 controller->init();
137
138#if ! EFI_UNIT_TEST
139 // todo: we still have to explicitly init all hardware on start in addition to handling configuration change via
140 // 'applyNewHardwareSettings' todo: maybe unify these two use-cases?
142#endif /* EFI_UNIT_TEST */
143
144 controller->idleState = INIT;
145 controller->baseIdlePosition = -100.0f;
146 controller->currentIdlePosition = -100.0f;
147
148#if ! EFI_UNIT_TEST
149 // split this whole file into manual controller and auto controller? move these commands into the file
150 // which would be dedicated to just auto-controller?
151
152 addConsoleAction("idlebench", startIdleBench);
154#endif /* EFI_UNIT_TEST */
155}
void addConsoleAction(const char *token, Void callback)
Register console action without parameters.
void initIdleHardware()
static void applyPidSettings()
void startIdleBench(void)
percent_t baseIdlePosition
idle_state_e idleState

Referenced by commonInitEngineController().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ startInputPinIfValid()

static void startInputPinIfValid ( const char msg,
brain_pin_e  pin,
pin_input_mode_e  mode 
)
static

Definition at line 42 of file idle_thread_io.cpp.

42 {
43 efiSetPadMode(msg, pin, getInputMode(mode));
44}
void efiSetPadMode(const char *msg, brain_pin_e brainPin, iomode_t mode)
iomode_t getInputMode(pin_input_mode_e mode)
Definition io_pins.cpp:103
brain_pin_e pin
Definition stm32_adc.cpp:15

Referenced by startSwitchPins().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ startSwitchPins()

void startSwitchPins ( )

Definition at line 55 of file idle_thread_io.cpp.

55 {
56#if EFI_PROD_CODE
57 // this is neutral/no gear switch input. on Miata it's wired both to clutch pedal and neutral in gearbox
58 // this switch is not used yet
60
62
69#endif /* EFI_PROD_CODE */
70}
static void startInputPinIfValid(const char *msg, brain_pin_e pin, pin_input_mode_e mode)

Referenced by startHardware().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ stopSwitchPins()

void stopSwitchPins ( )

Definition at line 72 of file idle_thread_io.cpp.

Referenced by stopHardware().

Here is the call graph for this function:
Here is the caller graph for this function:

Go to the source code of this file.