Skip to content

Commit 7e4cdc1

Browse files
author
Andrei Gramakov
committed
usb: configure_pins fix for tinyusb
Closes espressif/esp-idf#5588
1 parent 4c32c71 commit 7e4cdc1

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

components/tinyusb/port/esp32s2/src/tinyusb.c

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
#include "tinyusb.h"
15+
#include "driver/gpio.h"
16+
#include "driver/periph_ctrl.h"
17+
#include "esp_rom_gpio.h"
18+
#include "hal/gpio_ll.h"
1619
#include "hal/usb_hal.h"
17-
#include "soc/usb_periph.h"
1820
#include "soc/gpio_periph.h"
19-
#include "hal/gpio_ll.h"
20-
#include "esp_rom_gpio.h"
21-
#include "driver/periph_ctrl.h"
22-
#include "driver/gpio.h"
21+
#include "soc/usb_periph.h"
22+
#include "tinyusb.h"
2323

2424
static void configure_pins(usb_hal_context_t *usb)
2525
{
@@ -34,7 +34,9 @@ static void configure_pins(usb_hal_context_t *usb)
3434
esp_rom_gpio_connect_out_signal(iopin->pin, iopin->func, false, false);
3535
} else {
3636
esp_rom_gpio_connect_in_signal(iopin->pin, iopin->func, false);
37-
gpio_ll_input_enable(&GPIO, iopin->pin);
37+
if ((iopin->pin != GPIO_MATRIX_CONST_ZERO_INPUT) && (iopin->pin != GPIO_MATRIX_CONST_ONE_INPUT)) {
38+
gpio_ll_input_enable(&GPIO, iopin->pin);
39+
}
3840
}
3941
esp_rom_gpio_pad_unhold(iopin->pin);
4042
}

0 commit comments

Comments
 (0)