disable_IRQ();//关闭总中断
CLK_Init();//CLK的初始化
BEEP_Init();
UART_Init(UART_SERIAL_COM1, UART_BAUD_RATE_115200, UART_DATA_BIT8, UART_STOP_BIT1);//串口初始化
FLASH_Init();//FLASH初始化
bResult = UPGRADE_APP_IsUpgrade();
if(bResult == FALSE)
{//执行IAP
BEEP_Func(50);//进入IAP升级,蜂鸣器叫
//串口通讯,将升级文件写入FLASH中
while(1)
{
TREATY_Get();
TREATY_Execute();
TREATY_Analy();
if(UPGRADE_APP_GetUpgradeFlag() == TRUE)
{//升级成功标志
UPGRADE_APP_SetUpgradeFlag(FALSE);
break;
}
}
}
else
{//执行APP
UPGRADE_APP_SetUpgradeFlagCode(RUN_IAP_CODE);
}
//跳到APP地址
GoAddress = *(TFunction*)(APPLICATION_ADDR);
GoAddress(); |