Merge pull request #1282 from hathach/fix-esp-ci

Fix esp ci
This commit is contained in:
Ha Thach 2022-01-16 14:20:41 +07:00 committed by GitHub
commit 5dab0e8aed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 4 deletions

View File

@ -70,7 +70,7 @@ void board_init(void)
#endif
// Button
gpio_pad_select_gpio(BUTTON_PIN);
esp_rom_gpio_pad_select_gpio(BUTTON_PIN);
gpio_set_direction(BUTTON_PIN, GPIO_MODE_INPUT);
gpio_set_pull_mode(BUTTON_PIN, BUTTON_STATE_ACTIVE ? GPIO_PULLDOWN_ONLY : GPIO_PULLUP_ONLY);
@ -98,7 +98,12 @@ static void configure_pins(usb_hal_context_t *usb)
esp_rom_gpio_connect_out_signal(iopin->pin, iopin->func, false, false);
} else {
esp_rom_gpio_connect_in_signal(iopin->pin, iopin->func, false);
if ((iopin->pin != GPIO_FUNC_IN_LOW) && (iopin->pin != GPIO_FUNC_IN_HIGH)) {
#if ESP_IDF_VERSION_MAJOR > 4
if ((iopin->pin != GPIO_MATRIX_CONST_ZERO_INPUT) && (iopin->pin != GPIO_MATRIX_CONST_ONE_INPUT))
#else
if ((iopin->pin != GPIO_FUNC_IN_LOW) && (iopin->pin != GPIO_FUNC_IN_HIGH))
#endif
{
gpio_ll_input_enable(&GPIO, iopin->pin);
}
}

View File

@ -70,7 +70,7 @@ void board_init(void)
#endif
// Button
gpio_pad_select_gpio(BUTTON_PIN);
esp_rom_gpio_pad_select_gpio(BUTTON_PIN);
gpio_set_direction(BUTTON_PIN, GPIO_MODE_INPUT);
gpio_set_pull_mode(BUTTON_PIN, BUTTON_STATE_ACTIVE ? GPIO_PULLDOWN_ONLY : GPIO_PULLUP_ONLY);
@ -98,7 +98,12 @@ static void configure_pins(usb_hal_context_t *usb)
esp_rom_gpio_connect_out_signal(iopin->pin, iopin->func, false, false);
} else {
esp_rom_gpio_connect_in_signal(iopin->pin, iopin->func, false);
if ((iopin->pin != GPIO_FUNC_IN_LOW) && (iopin->pin != GPIO_FUNC_IN_HIGH)) {
#if ESP_IDF_VERSION_MAJOR > 4
if ((iopin->pin != GPIO_MATRIX_CONST_ZERO_INPUT) && (iopin->pin != GPIO_MATRIX_CONST_ONE_INPUT))
#else
if ((iopin->pin != GPIO_FUNC_IN_LOW) && (iopin->pin != GPIO_FUNC_IN_HIGH))
#endif
{
gpio_ll_input_enable(&GPIO, iopin->pin);
}
}