#616 idle for simulator

This commit is contained in:
rusefi 2018-11-01 15:57:50 -04:00
parent 940af25fab
commit 0d7b0a7dba
3 changed files with 12 additions and 1 deletions

View File

@ -289,7 +289,7 @@ static msg_t ivThread(int param) {
}
#if EFI_PROD_CODE || defined(__DOXYGEN__)
// this value is not used yet
if (boardConfiguration->clutchDownPin != GPIO_UNASSIGNED) {
engine->clutchDownState = efiReadPin(boardConfiguration->clutchDownPin);
@ -301,6 +301,7 @@ static msg_t ivThread(int param) {
if (engineConfiguration->brakePedalPin != GPIO_UNASSIGNED) {
engine->brakePedalState = efiReadPin(engineConfiguration->brakePedalPin);
}
#endif /* EFI_PROD_CODE */
finishIdleTestIfNeeded();
undoIdleBlipIfNeeded();
@ -490,8 +491,10 @@ void startIdleThread(Logging*sharedLogger) {
}
if (engineConfiguration->brakePedalPin != GPIO_UNASSIGNED) {
#if EFI_PROD_CODE || defined(__DOXYGEN__)
efiSetPadMode("brake pedal switch", engineConfiguration->brakePedalPin,
getInputMode(engineConfiguration->brakePedalPinMode));
#endif /* EFI_PROD_CODE */
}
addConsoleAction("idleinfo", showIdleInfo);

View File

@ -33,8 +33,10 @@ static msg_t stThread(StepperMotor *motor) {
// try to get saved stepper position (-1 for no data)
motor->currentPosition = loadStepperPos();
#if EFI_PROD_CODE || defined(__DOXYGEN__)
// first wait until at least 1 slowADC sampling is complete
waitForSlowAdc();
#endif
// now check if stepper motor re-initialization is requested - if the throttle pedal is pressed at startup
bool forceStepperParking = !engine->rpmCalculator.isRunning(PASS_ENGINE_PARAMETER_SIGNATURE) && getTPS(PASS_ENGINE_PARAMETER_SIGNATURE) > STEPPER_PARKING_TPS;
if (boardConfiguration->stepperForceParkingEveryRestart)
@ -146,14 +148,18 @@ void StepperMotor::initialize(brain_pin_e stepPin, brain_pin_e directionPin, pin
return;
}
#if EFI_PROD_CODE || defined(__DOXYGEN__)
stepPort = getHwPort("step", stepPin);
this->stepPin = getHwPin("step", stepPin);
#endif /* EFI_PROD_CODE */
this->directionPinMode = directionPinMode;
this->directionPin.initPin("stepper dir", directionPin, &this->directionPinMode);
#if EFI_PROD_CODE || defined(__DOXYGEN__)
enablePort = getHwPort("enable", enablePin);
this->enablePin = getHwPin("enable", enablePin);
#endif /* EFI_PROD_CODE */
efiSetPadMode("stepper step", stepPin, PAL_MODE_OUTPUT_PUSHPULL);
efiSetPadMode("stepper enable", enablePin, PAL_MODE_OUTPUT_PUSHPULL);

View File

@ -29,6 +29,8 @@
#include "eficonsole.h"
#endif /* __cplusplus */
#define efiSetPadMode(msg, brainPin, mode) {}
#define EFI_UNIT_TEST FALSE
#define hasFatalError() (FALSE)