Starter is engaged on start-up in pull-up configuration #1969
maintainability
This commit is contained in:
parent
9edcd372ec
commit
17a110ad44
|
@ -14,8 +14,8 @@ ButtonShiftController buttonShiftController;
|
||||||
|
|
||||||
|
|
||||||
ButtonShiftController::ButtonShiftController() :
|
ButtonShiftController::ButtonShiftController() :
|
||||||
debounceUp("up"),
|
debounceUp("gear_up"),
|
||||||
debounceDown("down")
|
debounceDown("gear_down")
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
|
|
||||||
EXTERN_ENGINE;
|
EXTERN_ENGINE;
|
||||||
|
|
||||||
ButtonDebounce acDebounce("ac");
|
ButtonDebounce acDebounce("ac_switch");
|
||||||
|
|
||||||
void initSensors(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
void initSensors(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||||
initMapDecoder(sharedLogger PASS_ENGINE_PARAMETER_SUFFIX);
|
initMapDecoder(sharedLogger PASS_ENGINE_PARAMETER_SUFFIX);
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
EXTERN_ENGINE;
|
EXTERN_ENGINE;
|
||||||
|
|
||||||
ButtonDebounce startStopButtonDebounce("start");
|
ButtonDebounce startStopButtonDebounce("start_button");
|
||||||
|
|
||||||
void initStartStopButton(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
void initStartStopButton(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||||
/* startCrankingDuration is efitimesec_t, so we need to multiply it by 1000 to get milliseconds*/
|
/* startCrankingDuration is efitimesec_t, so we need to multiply it by 1000 to get milliseconds*/
|
||||||
|
|
|
@ -219,6 +219,16 @@ void EnginePins::unregisterPins() {
|
||||||
#endif /* EFI_PROD_CODE */
|
#endif /* EFI_PROD_CODE */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void EnginePins::debug() {
|
||||||
|
#if EFI_PROD_CODE
|
||||||
|
RegisteredOutputPin * pin = registeredOutputHead;
|
||||||
|
while (pin != nullptr) {
|
||||||
|
scheduleMsg(logger, "%s %d", pin->registrationName, pin->currentLogicValue);
|
||||||
|
pin = pin->next;
|
||||||
|
}
|
||||||
|
#endif // EFI_PROD_CODE
|
||||||
|
}
|
||||||
|
|
||||||
void EnginePins::startPins(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
void EnginePins::startPins(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||||
#if EFI_ENGINE_CONTROL
|
#if EFI_ENGINE_CONTROL
|
||||||
startInjectionPins();
|
startInjectionPins();
|
||||||
|
@ -564,6 +574,8 @@ void initPrimaryPins(Logging *sharedLogger) {
|
||||||
criticalErrorLedPort = getHwPort("CRITICAL", LED_CRITICAL_ERROR_BRAIN_PIN);
|
criticalErrorLedPort = getHwPort("CRITICAL", LED_CRITICAL_ERROR_BRAIN_PIN);
|
||||||
criticalErrorLedPin = getHwPin("CRITICAL", LED_CRITICAL_ERROR_BRAIN_PIN);
|
criticalErrorLedPin = getHwPin("CRITICAL", LED_CRITICAL_ERROR_BRAIN_PIN);
|
||||||
criticalErrorLedState = (LED_ERROR_BRAIN_PIN_MODE == INVERTED_OUTPUT) ? 0 : 1;
|
criticalErrorLedState = (LED_ERROR_BRAIN_PIN_MODE == INVERTED_OUTPUT) ? 0 : 1;
|
||||||
|
|
||||||
|
addConsoleAction("gpio_pins", EnginePins::debug);
|
||||||
#endif /* EFI_PROD_CODE */
|
#endif /* EFI_PROD_CODE */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -145,8 +145,8 @@ public:
|
||||||
void init(DECLARE_ENGINE_PARAMETER_SIGNATURE);
|
void init(DECLARE_ENGINE_PARAMETER_SIGNATURE);
|
||||||
void unregister();
|
void unregister();
|
||||||
RegisteredOutputPin *next;
|
RegisteredOutputPin *next;
|
||||||
private:
|
|
||||||
const char *registrationName;
|
const char *registrationName;
|
||||||
|
private:
|
||||||
short pinOffset;
|
short pinOffset;
|
||||||
short pinModeOffset;
|
short pinModeOffset;
|
||||||
bool isPinConfigurationChanged();
|
bool isPinConfigurationChanged();
|
||||||
|
@ -162,6 +162,7 @@ public:
|
||||||
EnginePins();
|
EnginePins();
|
||||||
void startPins(DECLARE_ENGINE_PARAMETER_SIGNATURE);
|
void startPins(DECLARE_ENGINE_PARAMETER_SIGNATURE);
|
||||||
void reset();
|
void reset();
|
||||||
|
static void debug();
|
||||||
bool stopPins();
|
bool stopPins();
|
||||||
void unregisterPins();
|
void unregisterPins();
|
||||||
RegisteredOutputPin mainRelay;
|
RegisteredOutputPin mainRelay;
|
||||||
|
|
Loading…
Reference in New Issue