Gpio drivemode validation failed on ESP32
Bug from recent change
@@ -414,14 +414,14 @@ bool CPU_GPIO_DriveModeSupported(GPIO_PIN pinNumber, GpioPinDriveMode driveMode)
{
if (!GPIO_IS_VALID_GPIO(pinNumber)) return false;
- // Output pins
+ // Output & input pins any valid drivemode
if (GPIO_IS_VALID_OUTPUT_GPIO(pinNumber))
{
- return (driveMode >= GpioPinDriveMode_Output && driveMode <= GpioPinDriveMode_OutputOpenSourcePullDown);
+ return (driveMode >= GpioPinDriveMode_Input && driveMode <= GpioPinDriveMode_OutputOpenSourcePullDown);
}
- // Input only pins
- return (driveMode >= GpioPinDriveMode_Input && driveMode <= GpioPinDriveMode_OutputOpenSourcePullDown);
+ // Input only pins only input drive modes
+ return (driveMode >= GpioPinDriveMode_Input && driveMode <= GpioPinDriveMode_InputPullUp);
}
uint32_t CPU_GPIO_GetPinDebounce(GPIO_PIN pinNumber)
