Skip to content

Commit 3ecfa81

Browse files
committed
Merge branch 'bugfix/gpio_rom_patch_fix_v5.4' into 'release/v5.4'
fix(gpio): fix esp_rom_gpio_connect_out_signal for gpio num over 31 on esp32/s2 (v5.4) See merge request espressif/esp-idf!36865
2 parents c34702f + ed46ec4 commit 3ecfa81

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

components/esp_rom/patches/esp_rom_gpio.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD
2+
* SPDX-FileCopyrightText: 2024-2025 Espressif Systems (Shanghai) CO LTD
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*/
@@ -23,6 +23,10 @@ IRAM_ATTR __attribute__((optimize("-Os"))) void esp_rom_gpio_connect_out_signal(
2323
}
2424
REG_WRITE(GPIO_FUNC0_OUT_SEL_CFG_REG + (gpio_num * 4), value);
2525

26-
REG_WRITE(GPIO_ENABLE_W1TS_REG, (1 << gpio_num));
26+
if (gpio_num < 32) {
27+
REG_WRITE(GPIO_ENABLE_W1TS_REG, (1 << gpio_num));
28+
} else {
29+
REG_WRITE(GPIO_ENABLE1_W1TS_REG, (1 << (gpio_num - 32)));
30+
}
2731
}
2832
#endif

0 commit comments

Comments
 (0)