stm32: rcc_wait_for_sysclk_status should actually wait
Original implementation only checked whether the user had _selected_ the clock, not whether it had actually switched to the clock or not. For almost all cases, this made this function either a no-op, if you _had_ selected the clock, or a blocking loop if you hadn't selected it ahead of time. Fixes github issue #687
This commit is contained in:
@@ -165,6 +165,7 @@
|
||||
|
||||
/* SWS: System clock switch status */
|
||||
#define RCC_CFGR_SWS_SHIFT 2
|
||||
#define RCC_CFGR_SWS_MASK 0x3
|
||||
#define RCC_CFGR_SWS_HSI 0x0
|
||||
#define RCC_CFGR_SWS_HSE 0x1
|
||||
#define RCC_CFGR_SWS_PLL 0x2
|
||||
|
||||
@@ -159,6 +159,7 @@
|
||||
|
||||
/* SWS: System clock switch status */
|
||||
#define RCC_CFGR_SWS_SHIFT 2
|
||||
#define RCC_CFGR_SWS_MASK 0x3
|
||||
#define RCC_CFGR_SWS_HSI 0x0
|
||||
#define RCC_CFGR_SWS_HSE 0x1
|
||||
#define RCC_CFGR_SWS_PLL 0x2
|
||||
|
||||
@@ -174,6 +174,7 @@
|
||||
|
||||
/* SWS: System clock switch status */
|
||||
#define RCC_CFGR_SWS_SHIFT 2
|
||||
#define RCC_CFGR_SWS_MASK 0x3
|
||||
#define RCC_CFGR_SWS_HSI 0x0
|
||||
#define RCC_CFGR_SWS_HSE 0x1
|
||||
#define RCC_CFGR_SWS_PLL 0x2
|
||||
|
||||
@@ -188,6 +188,8 @@
|
||||
#define RCC_CFGR_SWS_SYSCLKSEL_HSICLK 0x1
|
||||
#define RCC_CFGR_SWS_SYSCLKSEL_HSECLK 0x2
|
||||
#define RCC_CFGR_SWS_SYSCLKSEL_PLLCLK 0x3
|
||||
#define RCC_CFGR_SWS_MASK 0x3
|
||||
#define RCC_CFGR_SWS_SHIFT 2
|
||||
|
||||
/* SW: System clock switch */
|
||||
#define RCC_CFGR_SW_SYSCLKSEL_MSICLK 0x0
|
||||
|
||||
Reference in New Issue
Block a user