Skip to content

Commit a4a2b9f

Browse files
sylvioalvescarlescufi
authored andcommitted
pinmux: esp32: check only for pullup
Current implementation checks for pulldown and pullup. As pinmux configuration is related to PU only, this PR checks for PU feature instead of PD. This also fix missing PU check when PD is present. Signed-off-by: Sylvio Alves <[email protected]>
1 parent fdda91d commit a4a2b9f

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

drivers/pinmux/pinmux_esp32.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,10 @@ static int pinmux_pullup(const struct device *dev, uint32_t pin, uint8_t func)
6969
#if SOC_RTCIO_INPUT_OUTPUT_SUPPORTED
7070
int rtcio_num = rtc_io_num_map[pin];
7171

72-
if (rtc_io_desc[rtcio_num].pulldown) {
73-
rtcio_hal_pulldown_disable(rtc_io_num_map[pin]);
74-
} else if (rtc_io_desc[rtcio_num].pullup) {
75-
rtcio_hal_pullup_enable(rtc_io_num_map[pin]);
72+
rtcio_hal_pulldown_enable(rtc_io_num_map[pin]);
73+
74+
if (rtc_io_desc[rtcio_num].pullup) {
75+
rtcio_hal_pullup_disable(rtc_io_num_map[pin]);
7676
} else {
7777
return -ENOTSUP;
7878
}
@@ -87,9 +87,9 @@ static int pinmux_pullup(const struct device *dev, uint32_t pin, uint8_t func)
8787
#if SOC_RTCIO_INPUT_OUTPUT_SUPPORTED
8888
int rtcio_num = rtc_io_num_map[pin];
8989

90-
if (rtc_io_desc[rtcio_num].pulldown) {
91-
rtcio_hal_pulldown_disable(rtc_io_num_map[pin]);
92-
} else if (rtc_io_desc[rtcio_num].pullup) {
90+
rtcio_hal_pulldown_disable(rtc_io_num_map[pin]);
91+
92+
if (rtc_io_desc[rtcio_num].pullup) {
9393
rtcio_hal_pullup_enable(rtc_io_num_map[pin]);
9494
} else {
9595
return -ENOTSUP;

0 commit comments

Comments
 (0)