Skip to content

Commit d0e11f7

Browse files
MrSurlydpgeorge
authored andcommitted
esp32/mphalport.h: Make mp_hal_pin_<dir> select gpio on the pad.
Otherwise interfaces like software I2C and SPI don't initialise correctly.
1 parent 59ab4a2 commit d0e11f7

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

ports/esp32/mphalport.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,15 @@ mp_hal_pin_obj_t machine_pin_get_id(mp_obj_t pin_in);
5959
#define mp_obj_get_pin(o) machine_pin_get_id(o) // legacy name; only to support esp8266/modonewire
6060
#define mp_hal_pin_name(p) (p)
6161
static inline void mp_hal_pin_input(mp_hal_pin_obj_t pin) {
62+
gpio_pad_select_gpio(pin);
6263
gpio_set_direction(pin, GPIO_MODE_INPUT);
6364
}
6465
static inline void mp_hal_pin_output(mp_hal_pin_obj_t pin) {
66+
gpio_pad_select_gpio(pin);
6567
gpio_set_direction(pin, GPIO_MODE_INPUT_OUTPUT);
6668
}
6769
static inline void mp_hal_pin_open_drain(mp_hal_pin_obj_t pin) {
70+
gpio_pad_select_gpio(pin);
6871
gpio_set_direction(pin, GPIO_MODE_INPUT_OUTPUT_OD);
6972
}
7073
static inline void mp_hal_pin_od_low(mp_hal_pin_obj_t pin) {

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy