Skip to content

Commit

Permalink
use GPIO_MODE_ instead of GPIO_MODE_DEF
Browse files Browse the repository at this point in the history
  • Loading branch information
dhalbert committed Jan 16, 2022
1 parent c70c8a9 commit 11848b1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ports/espressif/common-hal/digitalio/DigitalInOut.c
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 11848b1

Please sign in to comment.