|
@@ -77,7 +77,7 @@ char isSleepReady(void){
|
|
|
/*处理UI操作*/
|
|
|
static void uiProcess(unsigned int exeInterval){
|
|
|
if(getAppObjStatus(ASLEEP_PWR) != 0) return;//关机后,不切换菜单,只显示关机页面
|
|
|
- if(sutApp.gtMode!=0) return;//GT模式后按键无效
|
|
|
+ if(sutApp.gtTMode!=0) return;//GT模式后按键无效
|
|
|
uiLoop(exeInterval);
|
|
|
uiResponse(exeInterval);
|
|
|
}
|
|
@@ -98,6 +98,18 @@ static void pwrKeyDetect(unsigned int exeInterval){
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+static void antModePwrDet(void){
|
|
|
+ static int kcnt=0;
|
|
|
+ if(sutApp.pwrKeyStatus==0){
|
|
|
+ if(++kcnt==3){
|
|
|
+ guiShowMessageBox("正在关机");
|
|
|
+ msgAtSend("AT+TRB=2\r\n");
|
|
|
+ nwy_sleep(1000);
|
|
|
+ CTL_LCD_BL(0);
|
|
|
+ CTL_POWER_HOLD(0);
|
|
|
+ }
|
|
|
+ }else kcnt=0;
|
|
|
+}
|
|
|
void uiShowShutOption(char update){
|
|
|
if(update){
|
|
|
guiClearAll(guiGetBackColor());
|
|
@@ -187,7 +199,9 @@ void appRun(void){
|
|
|
msgAtSend("AT+POC_VER\r\n");
|
|
|
msgAtSend("AT+GMR\r\n");//查询模块版本
|
|
|
msgAtSend("AT+MIC=6\r\n");
|
|
|
+#ifdef ENABLE_PTT_VOICE
|
|
|
msgAtSend("AT+VSW=1\r\n");//打开留音功能
|
|
|
+#endif
|
|
|
//msgAtSend("AT+CACCP=0,1,0,\"04000B00\"\r\n");
|
|
|
#ifndef ENABLE_PWM_BEEP
|
|
|
if(newPara.KeySound!=0) msgAtSend("AT+TONES=1\r\n");
|
|
@@ -209,6 +223,11 @@ void appRun(void){
|
|
|
}
|
|
|
}
|
|
|
for(;;){
|
|
|
+ if(sutApp.antMode){
|
|
|
+ msgAtSend("AT+POC=050000\r\n");
|
|
|
+ cnt=0;
|
|
|
+ break;
|
|
|
+ }
|
|
|
lcdReConfig();
|
|
|
ledsProCtl();
|
|
|
adcRead();
|
|
@@ -244,6 +263,11 @@ void appRun(void){
|
|
|
//检测是否关机,这里要放在唤醒后操作
|
|
|
pwrShutPro(APP_SUB_DIV_TIME);
|
|
|
}
|
|
|
+ //检测是否关机了
|
|
|
+ for(;;){
|
|
|
+ antModePwrDet();
|
|
|
+ nwy_sleep(900);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
//////////////////////////////////////用于处理非耗时操作,如LED///////////////////////
|
|
@@ -598,6 +622,7 @@ void showKeyMsg(char *info, unsigned char keyCtl){
|
|
|
|
|
|
static void lockProcess(void){
|
|
|
if(sutApp.keyLock==0){
|
|
|
+ if(sutApp.activePwrShut!=0) return;//触发了关机界面时,不能加锁键盘
|
|
|
sutApp.keyLock=1;
|
|
|
appSleepCtl(ASLEEP_GGROUP, 0);
|
|
|
appSleepCtl(ASLEEP_GUSER, 0);
|
|
@@ -617,11 +642,23 @@ void keyToneStart(void){
|
|
|
msgAtSend("AT+TONE\r\n");
|
|
|
#endif
|
|
|
}
|
|
|
+void quickUiSwitch(int uistatus){
|
|
|
+ if(sutApp.activePwrShut!=0) return;//触发了关机界面时,快捷键无效
|
|
|
+ if(sutApp.keyLock!=0) return;//锁了后,快捷键无效
|
|
|
+ if(true==isUiSwitchReady()) return;
|
|
|
+ uISetNextStatus(uistatus);
|
|
|
+ getStackStruct()->FastUiChange=1;
|
|
|
+}
|
|
|
void mKeyHandler(unsigned char keyCtl){
|
|
|
static unsigned char gtModeCnt=0;
|
|
|
static unsigned char lockCnt=0;
|
|
|
+ static unsigned char f1Cnt=0;
|
|
|
+ static unsigned char f2Cnt=0;
|
|
|
+ char lock_but_enable_key=0;//锁键盘后,也能够关机
|
|
|
|
|
|
- if(sutApp.keyLock!=0 && MKEY_VALUE_P2!=g_usKeyValue){
|
|
|
+ if(sutUIstatus.Status==UIS_MENU_SHUT_UI &&
|
|
|
+ (MKEY_VALUE_MENU==g_usKeyValue || MKEY_VALUE_ESC==g_usKeyValue)) lock_but_enable_key=1;
|
|
|
+ if(sutApp.keyLock!=0 && MKEY_VALUE_PTT!=g_usKeyValue && MKEY_VALUE_P1!=g_usKeyValue && lock_but_enable_key==0){
|
|
|
sutApp.lockShow=1;
|
|
|
return;
|
|
|
}
|
|
@@ -631,9 +668,10 @@ void mKeyHandler(unsigned char keyCtl){
|
|
|
pttHandler(0,0);
|
|
|
break;
|
|
|
case MKEY_VALUE_P1:showKeyMsg("P1",keyCtl);
|
|
|
+ if(lockCnt==1) quickUiSwitch(UIS_MENU_TASK_SEL);
|
|
|
+ lockCnt=0;
|
|
|
break;
|
|
|
case MKEY_VALUE_P2:showKeyMsg("P2",keyCtl);
|
|
|
- lockCnt=0;
|
|
|
break;
|
|
|
case MKEY_VALUE_MENU:showKeyMsg("MENU",keyCtl);
|
|
|
break;
|
|
@@ -644,8 +682,12 @@ void mKeyHandler(unsigned char keyCtl){
|
|
|
case MKEY_VALUE_DOWN:showKeyMsg("DOWN",keyCtl);
|
|
|
break;
|
|
|
case MKEY_VALUE_F1:showKeyMsg("F1",keyCtl);
|
|
|
+ if(f1Cnt==1) volAdjAction(0);
|
|
|
+ f1Cnt=0;
|
|
|
break;
|
|
|
case MKEY_VALUE_F2:showKeyMsg("F2",keyCtl);
|
|
|
+ if(f2Cnt==1) volAdjAction(1);
|
|
|
+ f2Cnt=0;
|
|
|
break;
|
|
|
case MKEY_VALUE_CB_GT:showKeyMsg("CB_GT",keyCtl);
|
|
|
gtModeCnt=0;
|
|
@@ -667,11 +709,11 @@ void mKeyHandler(unsigned char keyCtl){
|
|
|
pttHandler(0,1);
|
|
|
break;
|
|
|
case MKEY_VALUE_P1:showKeyMsg("P1",keyCtl);
|
|
|
- break;
|
|
|
- case MKEY_VALUE_P2:showKeyMsg("P2",keyCtl);
|
|
|
keyInArow=1;
|
|
|
if(++lockCnt==3) lockProcess();
|
|
|
break;
|
|
|
+ case MKEY_VALUE_P2:showKeyMsg("P2",keyCtl);
|
|
|
+ break;
|
|
|
case MKEY_VALUE_MENU:showKeyMsg("MENU",keyCtl);
|
|
|
break;
|
|
|
case MKEY_VALUE_ESC:showKeyMsg("ESC",keyCtl);
|
|
@@ -681,8 +723,12 @@ void mKeyHandler(unsigned char keyCtl){
|
|
|
case MKEY_VALUE_DOWN:showKeyMsg("DOWN",keyCtl);
|
|
|
break;
|
|
|
case MKEY_VALUE_F1:showKeyMsg("F1",keyCtl);
|
|
|
+ keyInArow=1;
|
|
|
+ if(++f1Cnt==3) quickUiSwitch(UIS_MENU_CLASS_SEL);
|
|
|
break;
|
|
|
case MKEY_VALUE_F2:showKeyMsg("F2",keyCtl);
|
|
|
+ keyInArow=1;
|
|
|
+ if(++f2Cnt==3) quickUiSwitch(UIS_MENU_STUDENT_SEL);
|
|
|
break;
|
|
|
case MKEY_VALUE_CB_GT:showKeyMsg("CB_GT",keyCtl);
|
|
|
keyInArow=1;
|
|
@@ -701,6 +747,7 @@ void mKeyHandler(unsigned char keyCtl){
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
//////////////////////////////按键处理结束//////////////////////////
|
|
|
//////////////////////////////其它处理接口//////////////////////////
|
|
|
void hpDetStatusChanged(unsigned char hpStatus){
|