From 42c1fb7b5ec324ccf6dfd04b9cbe06d4ec590ed2 Mon Sep 17 00:00:00 2001 From: rusefi Date: Tue, 22 Dec 2020 21:05:49 -0500 Subject: [PATCH] trigger and start button pins not displayed by "pins" command #2084 --- firmware/hw_layer/sensors/joystick.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/firmware/hw_layer/sensors/joystick.cpp b/firmware/hw_layer/sensors/joystick.cpp index 488e74f311..b3ddddab29 100644 --- a/firmware/hw_layer/sensors/joystick.cpp +++ b/firmware/hw_layer/sensors/joystick.cpp @@ -95,6 +95,7 @@ static bool isJoystickEnabled() { } void stopJoystickPins() { + // todo: should be 'efiExtiDisablePin' or smth? efiSetPadUnused(activeConfiguration.joystickCenterPin); efiSetPadUnused(activeConfiguration.joystickAPin); efiSetPadUnused(activeConfiguration.joystickDPin); @@ -102,11 +103,12 @@ void stopJoystickPins() { void startJoystickPins() { // todo: extract 'configurePalInputPin() method? - efiSetPadMode("joy center", CONFIG(joystickCenterPin), PAL_MODE_INPUT_PULLUP); - efiSetPadMode("joy A", CONFIG(joystickAPin), PAL_MODE_INPUT_PULLUP); - // not used so far efiSetPadMode("joy B", CONFIG(joystickBPin), PAL_MODE_INPUT_PULLUP); - // not used so far efiSetPadMode("joy C", CONFIG(joystickCPin), PAL_MODE_INPUT_PULLUP); - efiSetPadMode("joy D", CONFIG(joystickDPin), PAL_MODE_INPUT_PULLUP); + // input capture driver would claim pin ownership so we are not using 'efiSetPadMode' here + palSetPadMode("joy center", CONFIG(joystickCenterPin), PAL_MODE_INPUT_PULLUP); + palSetPadMode("joy A", CONFIG(joystickAPin), PAL_MODE_INPUT_PULLUP); + // not used so far palSetPadMode("joy B", CONFIG(joystickBPin), PAL_MODE_INPUT_PULLUP); + // not used so far palSetPadMode("joy C", CONFIG(joystickCPin), PAL_MODE_INPUT_PULLUP); + palSetPadMode("joy D", CONFIG(joystickDPin), PAL_MODE_INPUT_PULLUP); } void initJoystick(Logging *shared) {