use GPIO_MODE_ instead of GPIO_MODE_DEF

This commit is contained in:
Dan Halbert 2022-01-15 23:05:33 -05:00
parent c70c8a9390
commit 11848b1826
1 changed files with 3 additions and 3 deletions

View File

@ -71,7 +71,7 @@ void common_hal_digitalio_digitalinout_deinit(digitalio_digitalinout_obj_t *self
void common_hal_digitalio_digitalinout_switch_to_input(
digitalio_digitalinout_obj_t *self, digitalio_pull_t pull) {
common_hal_digitalio_digitalinout_set_pull(self, pull);
gpio_set_direction(self->pin->number, GPIO_MODE_DEF_INPUT);
gpio_set_direction(self->pin->number, GPIO_MODE_INPUT);
}
digitalinout_result_t common_hal_digitalio_digitalinout_switch_to_output(
@ -108,9 +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_DEF_OUTPUT;
gpio_mode_t mode = GPIO_MODE_OUTPUT;
if (drive_mode == DRIVE_MODE_OPEN_DRAIN) {
mode |= GPIO_MODE_DEF_OD;
mode |= GPIO_MODE_OUTPUT_OD;
}
esp_err_t result = gpio_set_direction(number, mode);
if (result != ESP_OK) {