trigger and start button pins not displayed by "pins" command #2084
This commit is contained in:
parent
42c1fb7b5e
commit
a254c79d93
|
@ -43,6 +43,27 @@ bool efiReadPin(brain_pin_e pin) {
|
|||
return false;
|
||||
}
|
||||
|
||||
|
||||
void efiSetPadModeWithoutOwnershipAcquisition(const char *msg, brain_pin_e brainPin, iomode_t mode)
|
||||
{
|
||||
/*check if on-chip pin or external */
|
||||
if (brain_pin_is_onchip(brainPin)) {
|
||||
/* on-chip */
|
||||
ioportid_t port = getHwPort(msg, brainPin);
|
||||
ioportmask_t pin = getHwPin(msg, brainPin);
|
||||
/* paranoid */
|
||||
if (port == GPIO_NULL)
|
||||
return;
|
||||
|
||||
palSetPadMode(port, pin, mode);
|
||||
}
|
||||
#if (BOARD_EXT_GPIOCHIPS > 0)
|
||||
else {
|
||||
gpiochips_setPadMode(brainPin, mode);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* This method would set an error condition if pin is already used
|
||||
*/
|
||||
|
@ -56,22 +77,7 @@ void efiSetPadMode(const char *msg, brain_pin_e brainPin, iomode_t mode)
|
|||
bool wasUsed = brain_pin_markUsed(brainPin, msg);
|
||||
|
||||
if (!wasUsed) {
|
||||
/*check if on-chip pin or external */
|
||||
if (brain_pin_is_onchip(brainPin)) {
|
||||
/* on-chip */
|
||||
ioportid_t port = getHwPort(msg, brainPin);
|
||||
ioportmask_t pin = getHwPin(msg, brainPin);
|
||||
/* paranoid */
|
||||
if (port == GPIO_NULL)
|
||||
return;
|
||||
|
||||
palSetPadMode(port, pin, mode);
|
||||
}
|
||||
#if (BOARD_EXT_GPIOCHIPS > 0)
|
||||
else {
|
||||
gpiochips_setPadMode(brainPin, mode);
|
||||
}
|
||||
#endif
|
||||
efiSetPadModeWithoutOwnershipAcquisition(msg, brainPin, mode);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
|
||||
#if EFI_GPIO_HARDWARE
|
||||
EXTERNC void efiSetPadMode(const char *msg, brain_pin_e pin, iomode_t mode);
|
||||
EXTERNC void efiSetPadModeWithoutOwnershipAcquisition(const char *msg, brain_pin_e brainPin, iomode_t mode);
|
||||
EXTERNC void efiSetPadUnused(brain_pin_e brainPin);
|
||||
|
||||
EXTERNC bool efiReadPin(brain_pin_e pin);
|
||||
|
|
|
@ -104,11 +104,11 @@ void stopJoystickPins() {
|
|||
void startJoystickPins() {
|
||||
// todo: extract 'configurePalInputPin() method?
|
||||
// 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);
|
||||
efiSetPadModeWithoutOwnershipAcquisition("joy center", CONFIG(joystickCenterPin), PAL_MODE_INPUT_PULLUP);
|
||||
efiSetPadModeWithoutOwnershipAcquisition("joy A", CONFIG(joystickAPin), PAL_MODE_INPUT_PULLUP);
|
||||
// not used so far efiSetPadModeWithoutOwnershipAcquisition("joy B", CONFIG(joystickBPin), PAL_MODE_INPUT_PULLUP);
|
||||
// not used so far efiSetPadModeWithoutOwnershipAcquisition("joy C", CONFIG(joystickCPin), PAL_MODE_INPUT_PULLUP);
|
||||
efiSetPadModeWithoutOwnershipAcquisition("joy D", CONFIG(joystickDPin), PAL_MODE_INPUT_PULLUP);
|
||||
}
|
||||
|
||||
void initJoystick(Logging *shared) {
|
||||
|
|
Loading…
Reference in New Issue