Skip to content

Commit 1f1d693

Browse files
Raffael Rostagnosylvioalves
Raffael Rostagno
authored andcommitted
hal: esp32c6: Fix sleep routine
Fix sleep routine for ESP32-C6 after regression when updating HAL to v.5.1.c. Signed-off-by: Raffael Rostagno <[email protected]>
1 parent bc74718 commit 1f1d693

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

components/esp_hw_support/sleep_modes.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -522,11 +522,11 @@ static void IRAM_ATTR resume_timers(uint32_t pd_flags) {
522522
// [refactor-todo] provide target logic for body of uart functions below
523523
static void IRAM_ATTR flush_uarts(void)
524524
{
525-
for (int i = 0; i < SOC_UART_NUM; ++i) {
525+
for (int i = 0; i < SOC_UART_HP_NUM; ++i) {
526526
#ifdef CONFIG_IDF_TARGET_ESP32
527527
esp_rom_uart_tx_wait_idle(i);
528528
#else
529-
if (periph_ll_periph_enabled(PERIPH_UART0_MODULE + i)) {
529+
if (uart_ll_is_enabled(i)) {
530530
esp_rom_uart_tx_wait_idle(i);
531531
}
532532
#endif
@@ -541,9 +541,9 @@ static uint32_t s_suspended_uarts_bmap = 0;
541541
static IRAM_ATTR void suspend_uarts(void)
542542
{
543543
s_suspended_uarts_bmap = 0;
544-
for (int i = 0; i < SOC_UART_NUM; ++i) {
544+
for (int i = 0; i < SOC_UART_HP_NUM; ++i) {
545545
#ifndef CONFIG_IDF_TARGET_ESP32
546-
if (!periph_ll_periph_enabled(PERIPH_UART0_MODULE + i)) {
546+
if (!uart_ll_is_enabled(i)) {
547547
continue;
548548
}
549549
#endif
@@ -562,7 +562,7 @@ static IRAM_ATTR void suspend_uarts(void)
562562

563563
static void IRAM_ATTR resume_uarts(void)
564564
{
565-
for (int i = 0; i < SOC_UART_NUM; ++i) {
565+
for (int i = 0; i < SOC_UART_HP_NUM; ++i) {
566566
if (s_suspended_uarts_bmap & 0x1) {
567567
uart_ll_force_xon(i);
568568
}

0 commit comments

Comments
 (0)