fix espressif open-drain

This commit is contained in:
Dan Halbert 2022-01-15 19:28:00 -05:00
parent 7af7cd418c
commit c70c8a9390
1 changed files with 2 additions and 4 deletions

View File

@ -108,11 +108,9 @@ digitalinout_result_t common_hal_digitalio_digitalinout_set_drive_mode(
digitalio_digitalinout_obj_t *self,
digitalio_drive_mode_t drive_mode) {
gpio_num_t number = self->pin->number;
gpio_mode_t mode;
gpio_mode_t mode = GPIO_MODE_DEF_OUTPUT;
if (drive_mode == DRIVE_MODE_OPEN_DRAIN) {
mode = GPIO_MODE_DEF_OD;
} else {
mode = GPIO_MODE_DEF_OUTPUT;
mode |= GPIO_MODE_DEF_OD;
}
esp_err_t result = gpio_set_direction(number, mode);
if (result != ESP_OK) {