auto-sync

This commit is contained in:
rusEfi 2015-12-26 16:01:56 -05:00
parent 0d72823e52
commit b461a59169
2 changed files with 6 additions and 1 deletions

View File

@ -149,6 +149,9 @@ static void updateErrorCodes(void) {
#if EFI_PROD_CODE || defined(__DOXYGEN__)
Overflow64Counter halTime;
/**
* 64-bit result would not overflow, but that's complex stuff for our 32-bit MCU
*/
//todo: macro to save method invocation
efitimeus_t getTimeNowUs(void) {
return getTimeNowNt() / (CORE_CLOCK / 1000000);

View File

@ -244,6 +244,8 @@ static void setIdleDT(int value) {
static void startIdleBench(void) {
timeToStopIdleTest = getTimeNowUs() + MS2US(3000); // 3 seconds
scheduleMsg(logger, "idle valve bench test");
showIdleInfo();
}
void setDefaultIdleParameters(void) {
@ -258,7 +260,7 @@ static void applyIdleSolenoidPinState(PwmConfig *state, int stateIndex) {
efiAssertVoid(state->multiWave.waveCount == 1, "invalid idle waveCount");
OutputPin *output = state->outputPins[0];
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 */
)
output->setValue(value);