stm32序代码中这段的作用是什么??
if(BKP_ReadBackupRegister(BKP_DR1)!=0xA5A5){/*Backupdataregistervalueisnotcorrectorno...
if(BKP_ReadBackupRegister(BKP_DR1) != 0xA5A5)
{
/* Backup data register value is not correct or not yet programmed (when
the first time the program is executed)当第一次执行程序,备份数据寄存器的值不正确或尚未编程 */
printf("\r\n\n RTC not yet configured...."); //rtc尚未配置
/* RTC Configuration rtc配置*/
RTC_Configuration();
printf("\r\n RTC configured...."); //rtc已配置
/* Adjust time by values entred by the user on the hyperterminal 调整时间值在超级终端用户进入 */
Time_Adjust();
BKP_WriteBackupRegister(BKP_DR1, 0xA5A5);
}
else
{
/* Check if the Power On Reset flag is set 检查是否在复位标志的功率设置*/
if(RCC_GetFlagStatus(RCC_FLAG_PORRST) != RESET)
{
printf("\r\n\n Power On Reset occurred....");
}
/* Check if the Pin Reset flag is set检查销复位标志设置 */
else if(RCC_GetFlagStatus(RCC_FLAG_PINRST) != RESET)
{
printf("\r\n\n External Reset occurred...."); //外部复位发生
}
printf("\r\n No need to configure RTC...."); //无需配置RTC
/* Wait for RTC registers synchronization 等待RTC寄存器同步*/
RTC_WaitForSynchro();
/* Enable the RTC Second 使RTC二 */
RTC_ITConfig(RTC_IT_SEC, ENABLE);
/* Wait until last write operation on RTC registers has finished 等到最后对RTC寄存器的写操作完成 */
RTC_WaitForLastTask();
} 展开
{
/* Backup data register value is not correct or not yet programmed (when
the first time the program is executed)当第一次执行程序,备份数据寄存器的值不正确或尚未编程 */
printf("\r\n\n RTC not yet configured...."); //rtc尚未配置
/* RTC Configuration rtc配置*/
RTC_Configuration();
printf("\r\n RTC configured...."); //rtc已配置
/* Adjust time by values entred by the user on the hyperterminal 调整时间值在超级终端用户进入 */
Time_Adjust();
BKP_WriteBackupRegister(BKP_DR1, 0xA5A5);
}
else
{
/* Check if the Power On Reset flag is set 检查是否在复位标志的功率设置*/
if(RCC_GetFlagStatus(RCC_FLAG_PORRST) != RESET)
{
printf("\r\n\n Power On Reset occurred....");
}
/* Check if the Pin Reset flag is set检查销复位标志设置 */
else if(RCC_GetFlagStatus(RCC_FLAG_PINRST) != RESET)
{
printf("\r\n\n External Reset occurred...."); //外部复位发生
}
printf("\r\n No need to configure RTC...."); //无需配置RTC
/* Wait for RTC registers synchronization 等待RTC寄存器同步*/
RTC_WaitForSynchro();
/* Enable the RTC Second 使RTC二 */
RTC_ITConfig(RTC_IT_SEC, ENABLE);
/* Wait until last write operation on RTC registers has finished 等到最后对RTC寄存器的写操作完成 */
RTC_WaitForLastTask();
} 展开
1个回答
意法半导体(中国)投资有限公司
2023-06-12
展开全部
意法半导体(中国)投资有限公司
2023-06-12 广告
2023-06-12 广告
STM32F103是一款高性能的嵌入式芯片,由意法半导体(STMicroelectronics)公司生产。它是STM32系列芯片之一,具有紧凑、低功耗、高性能等特点,被广泛应用于嵌入式系统中。STM32F103的主要特点包括:1. 集成了A...
点击进入详情页
本回答由意法半导体(中国)投资有限公司提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询