ST的HSE_STARTUP_TIMEOUT这个参数是0x0500,如果我把它设成0XFFFF有没有问题呢?我看了下用到这个参数的函数以下这几个:RCC_WaitForHSEStartUp(void),SetSysClockToHSE(void),void SetSysClockTo24(void),void SetSysClockTo36(void)....我查了下我只用到RCC_WaitForHSEStartUp(void)这个函数,判断外部时钟是否正常,不正常则启用内部时钟。而看了这个函数把HSE_STARTUP_TIMEOUT设大好象没问题,最多就是如果外部时钟故障等待时间长了点而已,请问还有其它问题吗?附上这个函数。
ErrorStatus RCC_WaitForHSEStartUp(void)
{
__IO uint32_t StartUpCounter = 0;
ErrorStatus status = ERROR;
FlagStatus HSEStatus = RESET;
/* Wait till HSE is ready and if Time out is reached exit */
do
{
HSEStatus = RCC_GetFlagStatus(RCC_FLAG_HSERDY);
StartUpCounter++;
} while((StartUpCounter != HSE_STARTUP_TIMEOUT) && (HSEStatus == RESET));
if (RCC_GetFlagStatus(RCC_FLAG_HSERDY) != RESET)
{
status = SUCCESS;
}
else
{
status = ERROR;
}
return (status);
}
|