auto-sync
This commit is contained in:
parent
6a4e8ffdd1
commit
a5c22fd237
|
@ -149,6 +149,9 @@ static void updateErrorCodes(void) {
|
||||||
#if EFI_PROD_CODE || defined(__DOXYGEN__)
|
#if EFI_PROD_CODE || defined(__DOXYGEN__)
|
||||||
Overflow64Counter halTime;
|
Overflow64Counter halTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 64-bit result would not overflow, but that's complex stuff for our 32-bit MCU
|
||||||
|
*/
|
||||||
//todo: macro to save method invocation
|
//todo: macro to save method invocation
|
||||||
efitimeus_t getTimeNowUs(void) {
|
efitimeus_t getTimeNowUs(void) {
|
||||||
return getTimeNowNt() / (CORE_CLOCK / 1000000);
|
return getTimeNowNt() / (CORE_CLOCK / 1000000);
|
||||||
|
|
|
@ -244,6 +244,8 @@ static void setIdleDT(int value) {
|
||||||
|
|
||||||
static void startIdleBench(void) {
|
static void startIdleBench(void) {
|
||||||
timeToStopIdleTest = getTimeNowUs() + MS2US(3000); // 3 seconds
|
timeToStopIdleTest = getTimeNowUs() + MS2US(3000); // 3 seconds
|
||||||
|
scheduleMsg(logger, "idle valve bench test");
|
||||||
|
showIdleInfo();
|
||||||
}
|
}
|
||||||
|
|
||||||
void setDefaultIdleParameters(void) {
|
void setDefaultIdleParameters(void) {
|
||||||
|
@ -258,7 +260,7 @@ static void applyIdleSolenoidPinState(PwmConfig *state, int stateIndex) {
|
||||||
efiAssertVoid(state->multiWave.waveCount == 1, "invalid idle waveCount");
|
efiAssertVoid(state->multiWave.waveCount == 1, "invalid idle waveCount");
|
||||||
OutputPin *output = state->outputPins[0];
|
OutputPin *output = state->outputPins[0];
|
||||||
int value = state->multiWave.waves[0].pinStates[stateIndex];
|
int value = state->multiWave.waves[0].pinStates[stateIndex];
|
||||||
if (!value /* always allow tuning solenoid down */ ||
|
if (!value /* always allow turning solenoid off */ ||
|
||||||
(engine->rpmCalculator.rpmValue != 0 || timeToStopIdleTest != 0) /* do not run solenoid unless engine is spinning or bench testing in progress */
|
(engine->rpmCalculator.rpmValue != 0 || timeToStopIdleTest != 0) /* do not run solenoid unless engine is spinning or bench testing in progress */
|
||||||
)
|
)
|
||||||
output->setValue(value);
|
output->setValue(value);
|
||||||
|
|
Loading…
Reference in New Issue