stm32l0: rcc: fix incorrect bit shift in rcc_set_lpuart1_sel()
The function `rcc_set_lpuart1_sel()` was incorrectly using `RCC_CCIPR_LPTIM1SEL_SHIFT` instead of `RCC_CCIPR_LPUART1SEL_SHIFT`, causing incorrect LPUART1 clock source selection. This patch corrects the bit shift to ensure the LPUART1SEL field is properly updated. To verify check RM0377 Reference manual section 7.3.19.
This commit is contained in:
@@ -420,8 +420,8 @@ void rcc_set_lptim1_sel(uint32_t lptim1_sel)
|
||||
*/
|
||||
void rcc_set_lpuart1_sel(uint32_t lpuart1_sel)
|
||||
{
|
||||
RCC_CCIPR &= ~(RCC_CCIPR_LPUARTxSEL_MASK << RCC_CCIPR_LPTIM1SEL_SHIFT);
|
||||
RCC_CCIPR |= (lpuart1_sel << RCC_CCIPR_LPTIM1SEL_SHIFT);
|
||||
RCC_CCIPR &= ~(RCC_CCIPR_LPUARTxSEL_MASK << RCC_CCIPR_LPUART1SEL_SHIFT);
|
||||
RCC_CCIPR |= (lpuart1_sel << RCC_CCIPR_LPUART1SEL_SHIFT);
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
Reference in New Issue
Block a user