Skip to content

Commit

Permalink
Merge branch 'bugfix/fix_uart_ll_compatible_with_cpp' into 'master'
Browse files Browse the repository at this point in the history
fix(uart): Fixed C++ type conversion compile error in uart_ll_get_sclk

Closes IDFGH-10573

See merge request espressif/esp-idf!24690
  • Loading branch information
songruo committed Jul 12, 2023
2 parents 4918dca + b60f4a6 commit 9526273
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 25 deletions.
4 changes: 2 additions & 2 deletions components/hal/esp32/include/hal/uart_ll.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,10 @@ FORCE_INLINE_ATTR void uart_ll_get_sclk(uart_dev_t *hw, soc_module_clk_t *source
switch (hw->conf0.tick_ref_always_on) {
default:
case 0:
*source_clk = UART_SCLK_REF_TICK;
*source_clk = (soc_module_clk_t)UART_SCLK_REF_TICK;
break;
case 1:
*source_clk = UART_SCLK_APB;
*source_clk = (soc_module_clk_t)UART_SCLK_APB;
break;
}
}
Expand Down
8 changes: 4 additions & 4 deletions components/hal/esp32c2/include/hal/uart_ll.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2020-2022 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2020-2023 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
Expand Down Expand Up @@ -135,13 +135,13 @@ FORCE_INLINE_ATTR void uart_ll_get_sclk(uart_dev_t *hw, soc_module_clk_t *source
switch (hw->clk_conf.sclk_sel) {
default:
case 1:
*source_clk = UART_SCLK_PLL_F40M;
*source_clk = (soc_module_clk_t)UART_SCLK_PLL_F40M;
break;
case 2:
*source_clk = UART_SCLK_RTC;
*source_clk = (soc_module_clk_t)UART_SCLK_RTC;
break;
case 3:
*source_clk = UART_SCLK_XTAL;
*source_clk = (soc_module_clk_t)UART_SCLK_XTAL;
break;
}
}
Expand Down
8 changes: 4 additions & 4 deletions components/hal/esp32c3/include/hal/uart_ll.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2021-2023 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
Expand Down Expand Up @@ -137,13 +137,13 @@ FORCE_INLINE_ATTR void uart_ll_get_sclk(uart_dev_t *hw, soc_module_clk_t *source
switch (hw->clk_conf.sclk_sel) {
default:
case 1:
*source_clk = UART_SCLK_APB;
*source_clk = (soc_module_clk_t)UART_SCLK_APB;
break;
case 2:
*source_clk = UART_SCLK_RTC;
*source_clk = (soc_module_clk_t)UART_SCLK_RTC;
break;
case 3:
*source_clk = UART_SCLK_XTAL;
*source_clk = (soc_module_clk_t)UART_SCLK_XTAL;
break;
}
}
Expand Down
10 changes: 5 additions & 5 deletions components/hal/esp32c6/include/hal/uart_ll.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,10 @@ static inline void lp_uart_ll_get_sclk(uart_dev_t *hw, soc_module_clk_t *source_
switch (LP_CLKRST.lpperi.lp_uart_clk_sel) {
default:
case 0:
*source_clk = LP_UART_SCLK_LP_FAST;
*source_clk = (soc_module_clk_t)LP_UART_SCLK_LP_FAST;
break;
case 1:
*source_clk = LP_UART_SCLK_XTAL_D2;
*source_clk = (soc_module_clk_t)LP_UART_SCLK_XTAL_D2;
break;
}
}
Expand Down Expand Up @@ -224,13 +224,13 @@ static inline void uart_ll_get_sclk(uart_dev_t *hw, soc_module_clk_t *source_clk
switch (UART_LL_PCR_REG_GET(hw, sclk_conf, sclk_sel)) {
default:
case 1:
*source_clk = UART_SCLK_PLL_F80M;
*source_clk = (soc_module_clk_t)UART_SCLK_PLL_F80M;
break;
case 2:
*source_clk = UART_SCLK_RTC;
*source_clk = (soc_module_clk_t)UART_SCLK_RTC;
break;
case 3:
*source_clk = UART_SCLK_XTAL;
*source_clk = (soc_module_clk_t)UART_SCLK_XTAL;
break;
}
} else {
Expand Down
6 changes: 3 additions & 3 deletions components/hal/esp32h2/include/hal/uart_ll.h
Original file line number Diff line number Diff line change
Expand Up @@ -169,13 +169,13 @@ static inline void uart_ll_get_sclk(uart_dev_t *hw, soc_module_clk_t *source_clk
switch (UART_LL_PCR_REG_GET(hw, sclk_conf, sclk_sel)) {
default:
case 1:
*source_clk = UART_SCLK_PLL_F48M;
*source_clk = (soc_module_clk_t)UART_SCLK_PLL_F48M;
break;
case 2:
*source_clk = UART_SCLK_RTC;
*source_clk = (soc_module_clk_t)UART_SCLK_RTC;
break;
case 3:
*source_clk = UART_SCLK_XTAL;
*source_clk = (soc_module_clk_t)UART_SCLK_XTAL;
break;
}
}
Expand Down
4 changes: 2 additions & 2 deletions components/hal/esp32s2/include/hal/uart_ll.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,10 @@ FORCE_INLINE_ATTR void uart_ll_get_sclk(uart_dev_t *hw, soc_module_clk_t *source
switch (hw->conf0.tick_ref_always_on) {
default:
case 0:
*source_clk = UART_SCLK_REF_TICK;
*source_clk = (soc_module_clk_t)UART_SCLK_REF_TICK;
break;
case 1:
*source_clk = UART_SCLK_APB;
*source_clk = (soc_module_clk_t)UART_SCLK_APB;
break;
}
}
Expand Down
9 changes: 4 additions & 5 deletions components/hal/esp32s3/include/hal/uart_ll.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
Expand Down Expand Up @@ -109,13 +109,13 @@ FORCE_INLINE_ATTR void uart_ll_get_sclk(uart_dev_t *hw, soc_module_clk_t *source
switch (hw->clk_conf.sclk_sel) {
default:
case 1:
*source_clk = UART_SCLK_APB;
*source_clk = (soc_module_clk_t)UART_SCLK_APB;
break;
case 2:
*source_clk = UART_SCLK_RTC;
*source_clk = (soc_module_clk_t)UART_SCLK_RTC;
break;
case 3:
*source_clk = UART_SCLK_XTAL;
*source_clk = (soc_module_clk_t)UART_SCLK_XTAL;
break;
}
}
Expand Down Expand Up @@ -552,7 +552,6 @@ FORCE_INLINE_ATTR void uart_ll_set_data_bit_num(uart_dev_t *hw, uart_word_length
}

/**
FORCE_INLINE_ATTR void uart_ll_get_sclk(uart_dev_t *hw, uart_sclk_t *source_clk)
* @brief Set the rts active level.
*
* @param hw Beginning address of the peripheral registers.
Expand Down

0 comments on commit 9526273

Please sign in to comment.