关键语句就在于__HAL_RCC_WAKEUPSTOP_CLK_CONFIG,以下是该宏的原型:
/**
* @brief Macro to configures the wake up from stop clock.
* @param __RCC_STOPWUCLK__ specifies the clock source used after wake up from stop
* This parameter can be one of the following values:
* @ARG @ref RCC_STOP_WAKEUPCLOCK_MSI MSI selected as system clock source
* @arg @ref RCC_STOP_WAKEUPCLOCK_HSI HSI selected as system clock source
* @retval None
*/
#define __HAL_RCC_WAKEUPSTOP_CLK_CONFIG(__RCC_STOPWUCLK__) (MODIFY_REG(RCC->CFGR,\
RCC_CFGR_STOPWUCK, (uint32_t)(__RCC_STOPWUCLK__) ))
在这里说的已经很清楚,唤醒后的主时钟智能选择MSI或HSI,这也就是为什么低功耗程序都是能HSI时钟的原因了。
|