trigger and start button pins not displayed by "pins" command #2084
This commit is contained in:
parent
42c1fb7b5e
commit
a254c79d93
|
@ -43,19 +43,9 @@ bool efiReadPin(brain_pin_e pin) {
|
|||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method would set an error condition if pin is already used
|
||||
*/
|
||||
void efiSetPadMode(const char *msg, brain_pin_e brainPin, iomode_t mode)
|
||||
|
||||
void efiSetPadModeWithoutOwnershipAcquisition(const char *msg, brain_pin_e brainPin, iomode_t mode)
|
||||
{
|
||||
if (brainPin == GPIO_UNASSIGNED) {
|
||||
// No pin configured, nothing to do here.
|
||||
return;
|
||||
}
|
||||
|
||||
bool wasUsed = brain_pin_markUsed(brainPin, msg);
|
||||
|
||||
if (!wasUsed) {
|
||||
/*check if on-chip pin or external */
|
||||
if (brain_pin_is_onchip(brainPin)) {
|
||||
/* on-chip */
|
||||
|
@ -72,6 +62,22 @@ void efiSetPadMode(const char *msg, brain_pin_e brainPin, iomode_t mode)
|
|||
gpiochips_setPadMode(brainPin, mode);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* This method would set an error condition if pin is already used
|
||||
*/
|
||||
void efiSetPadMode(const char *msg, brain_pin_e brainPin, iomode_t mode)
|
||||
{
|
||||
if (brainPin == GPIO_UNASSIGNED) {
|
||||
// No pin configured, nothing to do here.
|
||||
return;
|
||||
}
|
||||
|
||||
bool wasUsed = brain_pin_markUsed(brainPin, msg);
|
||||
|
||||
if (!wasUsed) {
|
||||
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