|
@@ -1425,6 +1425,13 @@ void fotaMsgShow(char *msg){
|
|
guiClearRect(0, 60, GLCD_WIDTH-1, 60+16,guiGetBackColor());
|
|
guiClearRect(0, 60, GLCD_WIDTH-1, 60+16,guiGetBackColor());
|
|
guiShowStr((GLCD_WIDTH-len)/2,60, msg,FONT_MODE_16X16, REVERSED_NO, COLOR_BLACK, guiGetBackColor());
|
|
guiShowStr((GLCD_WIDTH-len)/2,60, msg,FONT_MODE_16X16, REVERSED_NO, COLOR_BLACK, guiGetBackColor());
|
|
}
|
|
}
|
|
|
|
+void fotaMsgShow2(char *msg1, char *msg2){
|
|
|
|
+ guiClearRect(0, 45, GLCD_WIDTH-1, 45+16+2+16,guiGetBackColor());
|
|
|
|
+ int len=guiGetStrXLen((char *)msg1,FONT_MODE_16X16);
|
|
|
|
+ guiShowStr((GLCD_WIDTH-len)/2,45, msg1,FONT_MODE_16X16, REVERSED_NO, COLOR_BLACK, guiGetBackColor());
|
|
|
|
+ len=guiGetStrXLen((char *)msg2,FONT_MODE_16X16);
|
|
|
|
+ guiShowStr((GLCD_WIDTH-len)/2,45+16+2, msg2,FONT_MODE_16X16, REVERSED_NO, COLOR_BLACK, guiGetBackColor());
|
|
|
|
+}
|
|
void uiShowVersionSel(char StatusUpdate){
|
|
void uiShowVersionSel(char StatusUpdate){
|
|
if(StatusUpdate){
|
|
if(StatusUpdate){
|
|
sutApp.fotaVersion[0]=0;
|
|
sutApp.fotaVersion[0]=0;
|
|
@@ -1452,13 +1459,10 @@ void uiShowVersionSel(char StatusUpdate){
|
|
fotaStep=4;
|
|
fotaStep=4;
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
- case 3://升级成功,等待重启
|
|
|
|
- msgAtSend("AT+POC=050000\r\n");//停止POC后复位
|
|
|
|
- MSG_INFO(1, "Stop poc");
|
|
|
|
- nwy_sleep(2000);
|
|
|
|
- msgAtSend("AT+TRB=2\r\n");
|
|
|
|
- MSG_INFO(1, "Reset system!!!");
|
|
|
|
- while(1){nwy_sleep(1000);}
|
|
|
|
|
|
+ case 3://下载成功
|
|
|
|
+ nwy_sleep(1000);
|
|
|
|
+ fotaStep=6;
|
|
|
|
+ fotaMsgShow2("确定将关机,需长按开","机键直至开机(约60秒)");
|
|
break;
|
|
break;
|
|
case 4://延时显示2秒后退出
|
|
case 4://延时显示2秒后退出
|
|
uTimerStart(&fotaTick, 2000);
|
|
uTimerStart(&fotaTick, 2000);
|
|
@@ -1467,12 +1471,14 @@ void uiShowVersionSel(char StatusUpdate){
|
|
case 5://退出升级流程
|
|
case 5://退出升级流程
|
|
if(uTimerExpired(&fotaTick)) uISetNextStatus(UIS_MENU_SYS_SEL);
|
|
if(uTimerExpired(&fotaTick)) uISetNextStatus(UIS_MENU_SYS_SEL);
|
|
break;
|
|
break;
|
|
|
|
+ case 6:
|
|
|
|
+ break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
void uiShowVersionSelResponse(void){
|
|
void uiShowVersionSelResponse(void){
|
|
unsigned char key=getKeyValue();
|
|
unsigned char key=getKeyValue();
|
|
-
|
|
|
|
|
|
+ if(fotaStep!=1 && fotaStep!=6) return;
|
|
if(MKEY_VALUE_ESC==key) uISetNextStatus(UIS_MENU_SYS_SEL);
|
|
if(MKEY_VALUE_ESC==key) uISetNextStatus(UIS_MENU_SYS_SEL);
|
|
else if(MKEY_VALUE_MENU==key){
|
|
else if(MKEY_VALUE_MENU==key){
|
|
if(fotaStep==1){
|
|
if(fotaStep==1){
|
|
@@ -1480,6 +1486,15 @@ void uiShowVersionSelResponse(void){
|
|
fotaStep=2;
|
|
fotaStep=2;
|
|
msgAtSend("AT+FOTA=1\r\n");
|
|
msgAtSend("AT+FOTA=1\r\n");
|
|
uTimerStart(&fotaTick, 10000);
|
|
uTimerStart(&fotaTick, 10000);
|
|
|
|
+ }else if(fotaStep==6){
|
|
|
|
+ if(nwy_version_update(true)<0){
|
|
|
|
+ MSG_ERR(1, "nwy_version_update failed");
|
|
|
|
+ fotaMsgShow("升级异常");
|
|
|
|
+ fotaStep=5;
|
|
|
|
+ }
|
|
|
|
+ msgAtSend("AT+TRB=2\r\n");
|
|
|
|
+ MSG_INFO(1, "Reset system!!!");
|
|
|
|
+ while(1){nwy_sleep(1000);}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|