Просмотр исходного кода

T555_V03027
1、P1键短按进入学习任务菜单,长按则加锁/解锁键盘
2、F1F2短按调节音量,长按进入班级/学生菜单
3、修复写码模式下不能关机问题
4、去掉留音功能
5、添加菜单进入天线调试模式
6、课程表,通知里面的标题使用中文显示
7、调整学习任务录音音量的评分
8、POC更新到V03017

wangjianlin 3 лет назад
Родитель
Сommit
6ba53b725e
15 измененных файлов с 126 добавлено и 34 удалено
  1. BIN
      Released/T555_V03027.rar
  2. 11 1
      Released/releasenote.txt
  3. 52 5
      app/app.c
  4. 1 0
      app/app.h
  5. 1 1
      app/board.c
  6. 1 1
      app/hook.c
  7. 1 3
      app/includes.h
  8. 9 5
      app/learn/learnAudio.c
  9. 16 5
      app/learn/learnTask.c
  10. 1 1
      app/ohpoc.h
  11. 0 2
      app/ohpocapp.c
  12. 26 4
      app/uiBlock.c
  13. 6 6
      app/uiEntry.c
  14. 1 0
      app/uiEntry.h
  15. BIN
      lib/libohpoc.a

BIN
Released/T555_V03027.rar


+ 11 - 1
Released/releasenote.txt

@@ -111,4 +111,14 @@ V03026
 1、老师不支持任务录音,重听以及排名查看
 2、关机触发后有菜单让用户选择是否关机
 3、修复掉线再登录有可能显示有残留问题
-4、POC更新到V03016
+4、POC更新到V03016
+
+V03027
+1、P1键短按进入学习任务菜单,长按则加锁/解锁键盘
+2、F1F2短按调节音量,长按进入班级/学生菜单
+3、修复写码模式下不能关机问题
+4、去掉留音功能
+5、添加菜单进入天线调试模式
+6、课程表,通知里面的标题使用中文显示
+7、调整学习任务录音音量的评分
+8、POC更新到V03017

+ 52 - 5
app/app.c

@@ -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){

+ 1 - 0
app/app.h

@@ -59,6 +59,7 @@ typedef struct{
 	unsigned char authReady:1;
 	unsigned char pwrKeyStatus:1;//开关机键状态
 	unsigned char activePwrShut:1;//是否触发了关机界面
+	unsigned char antMode:1;
 	unsigned int appSleepStatus;//APP是否可以休眠
 	ACCOUNT_DEF account;
 	int g_iCSQ;

+ 1 - 1
app/board.c

@@ -83,7 +83,7 @@ static void gpioIsqActive(int param){
 		}
 	}
 }
-		
+
 /*
 pid:gpio_pid
 up_down:0-down,1-up,2-null

+ 1 - 1
app/hook.c

@@ -225,7 +225,7 @@ void volUiFlash(unsigned char lev){
 	unsigned short x=GLCD_WIDTH/2-16;
 	unsigned short y=VOL_START_Y+14;
 	char info[10];
-	
+	if(sutUIstatus.Status!=UIS_STANDBY) return;
 	guiClearRect(x, y, x+16+16, y+VOL_HEIGH, guiGetBackColor());
 	guiShowBmp(x, y, "volume.bmp");
 	snprintf(info, sizeof(info), "%d", lev);

+ 1 - 3
app/includes.h

@@ -59,11 +59,9 @@
 #endif
 
 #define SD_TOKEN "/sdcard0"
-
+//define ENABLE_PTT_VOICE //使能留音功能
 //使能通用模式(学习任务,学习排名不显示,班级,同学显示为群组,成员)
 //#define MAKE_IT_COMMON_VERSION
 
-//#define ENABLE_ANT_MODE
-
 //#define DEVELOP_MODE  //研发模式:不授权,手刷不恢复默认生产PSN。 正式时不能开此宏
 #endif

+ 9 - 5
app/learn/learnAudio.c

@@ -278,12 +278,16 @@ static void pcmVolProcess(unsigned char *pcm, unsigned int len){
 		sum=pcmSum/VOL_SHORT_LEV;
 		//snprintf(info, sizeof(info), "[0]{%d}",sum);
 		//nwy_usb_serial_send(info, strlen(info));
-		//MSG_INFO(1, "pcm:%d", sum);
-		sum *= (LEV_NUM-1);
-		sum /=10000;
-		if(sum >(LEV_NUM-1)) sum = LEV_NUM-1;
+		//MSG_INFO(1, "pcm:%lu,%lu", sum,pcmSum);
+		sum *= (LEV_NUM-0);
+		sum /=4000;//10000;
+		//MSG_INFO(1,"===%d",sum);
+		if(sum >(LEV_NUM-0)) sum = LEV_NUM-0;
 		learnRecSetVol(sum);
-		if(sum > recordResult.maxVolume) recordResult.maxVolume=sum;//计算每一帧的最大音量
+		if(sum > recordResult.maxVolume){
+			recordResult.maxVolume=sum;//计算每一帧的最大音量
+			//MSG_INFO(1,"=======%d", sum);
+		}
 		pcmSum=0;
 		frameVolNum=0;
 	}

+ 16 - 5
app/learn/learnTask.c

@@ -814,7 +814,8 @@ static void LearnTaskProcess(void){
 				releaseJson(&sutJson.jsonTask[i]);
 			}
 			sdUnmount();
-			uISetNextStatus(UIS_MENU_MAIN);
+			if(getStackStruct()->FastUiChange)uISetNextStatus(UIS_STANDBY);
+			else uISetNextStatus(UIS_MENU_MAIN);
 			needUpdate=1;
 			break;
 		case LEARN_END:
@@ -1585,12 +1586,18 @@ static void classInfoDetailShow(unsigned char direction){
 	snprintf(info, sizeof(info), "subject:%s", classes.classResult[tIndex]->subject);
 	guiShowStr(x, y, info, FONT_MODE_16X16, REVERSED_NO, COLOR_BLACK, guiGetBackColor());
 #else
+	const char *weekTable[]={
+		"天","一","二","三","四","五","六",""
+	};
 	char info1[50],info2[100];
+	unsigned char index;
 	//显示索引和总数
 	learnUIShowIndexAndTotal(tIndex+1,classes.item);
 	//显示内容
-	snprintf(info1, sizeof(info1), "week:%d%ctime:%s", classes.classResult[tIndex]->week,0x0a,classes.classResult[tIndex]->time);
-	snprintf(info2, sizeof(info2), "subject:%s", classes.classResult[tIndex]->subject);
+	index=classes.classResult[tIndex]->week;
+	if(index>6) index=7;
+	snprintf(info1, sizeof(info1), "星期%s%c时间:%s", weekTable[index],0x0a,classes.classResult[tIndex]->time);
+	snprintf(info2, sizeof(info2), "课程:%s", classes.classResult[tIndex]->subject);
 	newMessageInit(FONT_MODE_16X16,info1, info2, NULL);
 #endif
 }
@@ -1673,7 +1680,7 @@ void LearnClassDetailResponse(void){
 typedef struct{
 	int id;
 	char time[15];
-	char title[30];
+	char title[60];
 }NOTICE_DEF;
 typedef struct{
 	unsigned int item;//rankResult实际使用的个数
@@ -1684,6 +1691,8 @@ NOTICE_RESULT_DEF notices={0,0,0,NULL};
 bool noticeShowReady;
 static int noticetIndex=0;
 static void noticeInfoDetailShow(unsigned char direction){
+	char time[35];
+	char title[100];
 	if(notices.item==0){
 		guiShowMessageBox("无数据");
 		return;
@@ -1714,8 +1723,10 @@ static void noticeInfoDetailShow(unsigned char direction){
 	snprintf(info, sizeof(info), "time:%s", notices.noticeResult[noticetIndex]->time);
 	guiShowStr(x, y, info, FONT_MODE_16X16, REVERSED_NO, COLOR_BLACK, guiGetBackColor());
 #else
+	snprintf(time, sizeof(time), "时间:%s", notices.noticeResult[noticetIndex]->time);
+	snprintf(title, sizeof(title), "标题:%s", notices.noticeResult[noticetIndex]->title);
 	learnUIShowIndexAndTotal(noticetIndex+1,notices.item);
-	newMessageInit(FONT_MODE_16X16, notices.noticeResult[noticetIndex]->time,notices.noticeResult[noticetIndex]->title, NULL);
+	newMessageInit(FONT_MODE_16X16, time, title, NULL);
 #endif
 }
 static void getNoticeShowMessage(void);

+ 1 - 1
app/ohpoc.h

@@ -7,7 +7,7 @@
 #define OHPOC_APP_NAME "T555"
 //#define OHPOC_APP_NAME "RTL-TEST"
 
-#define OHPOC_VERSION "03026"  //外部OCPU 应用维护
+#define OHPOC_VERSION "03027"  //外部OCPU 应用维护
 #define OHPOC_MODLE	"N58" //作为OPEN时,此值用于FOTA升级标识使用
 #define OHPOC_CUST OHPOC_APP_NAME //作为OPEN时,此值用于FOTA升级标识使用
 

+ 0 - 2
app/ohpocapp.c

@@ -145,9 +145,7 @@ static void mainTask(void *param){
 #if 1
     dataInit();
 	boardInit();
-#ifndef ENABLE_ANT_MODE
 	ohpocStart();
-#endif
 	uioStatusInit();
 	appRun();
 #endif

+ 26 - 4
app/uiBlock.c

@@ -531,6 +531,8 @@ void MenuMainResponse(void){
 /****************************主菜单显示部分结束*************************************/
 
 /*****************************群组选择/成员选择部分开始*********************************/
+bool uiSwitchLock=false;
+bool isUiSwitchReady(void){return uiSwitchLock;}
 static char GUListBoxInited=0;
 static char SelMachine=0;
 static void ReFlashItemGU(char type);
@@ -550,6 +552,7 @@ void uiShowGUSel(char StatusUpdate,unsigned int exeInterval,char type){
 				uTimerStart(&timer, 1000);
 				machine=1;
 			}else{
+				uiSwitchLock=true;
 				if(type==0) appSleepCtl(ASLEEP_GGROUP, 1);//要获取群组信息,不让休眠,记得超时或获取成功或获取失败后需要释放
 				else appSleepCtl(ASLEEP_GUSER, 1);
 				UiassistStart(0);
@@ -578,6 +581,7 @@ void uiShowGUSel(char StatusUpdate,unsigned int exeInterval,char type){
 				//获取成功后退出释放休眠
 				if(type==0) appSleepCtl(ASLEEP_GGROUP, 0);
 				else appSleepCtl(ASLEEP_GUSER, 0);
+				uiSwitchLock=false;
 			}
 			break;
 	}
@@ -737,7 +741,7 @@ void uiShowMenuSysSetup(char flash){
 		"6,提示音设置",
 		"7,终端信息",
 		"8,SD卡检测",
-		"9,留音记录",
+		"9,天线调试",
 #ifdef MENU_TEST
 		"10,测试",
 #endif
@@ -783,8 +787,8 @@ void sysTemSetResponse(void){
 			case 7://SD卡检测
 				uISetNextStatus(UIS_MENU_SYS_SD);
 				break;
-			case 8://留音记录设置
-				uISetNextStatus(UIS_MENU_SYS_VOICE);
+			case 8://天线调试
+				uISetNextStatus(UIS_MENU_SYS_ANT);
 				break;
 #ifdef MENU_TEST				
 			case 9://测试
@@ -995,7 +999,25 @@ void uiShowInformationResponse(void){
 	}
 }
 /*****************************终端信息结束**********************************/
-
+/*****************************天线调试**************************************/
+void uiShowANT(char update){
+	if(update){
+		guiClearAll(guiGetBackColor());
+		guiShowCaption(0,"天线调试",UI_STATUS_BAR_HEIGH,guiGetBackColor(),guiGetForeColor(),FONT_MODE_12X12);
+		guiShowMessageBox("确定进入?");
+		uiMenuShowBottomLine();
+		uiMenuShowBottomIndacitor("确定", "返回");
+	}
+}
+void uiShowANTResponse(void){
+	unsigned short key=getKeyValue();
+	if(MKEY_VALUE_ESC==key) uISetNextStatus(sutUIstatus.LastStatus);
+	else if(MKEY_VALUE_MENU==key){
+		sutApp.antMode=1;
+		guiShowMessageBox("天线模式");
+	}
+}
+/*****************************天线调试****************************************/
 /*******************************留音记录开始**********************************/
 void uiShowVoiceInfo(char update){
 	static unsigned int timer;

+ 6 - 6
app/uiEntry.c

@@ -143,6 +143,9 @@ void uiLoop(unsigned int exeInterval){
 		case UIS_MENU_SYS_VOICE:
 			uiShowVoiceInfo(StatusUpdate);
 			break;
+		case UIS_MENU_SYS_ANT:
+			uiShowANT(StatusUpdate);
+			break;
 		case UIS_MENU_SYS_PASS:
 			uiShowPassword(StatusUpdate);
 			break;
@@ -203,12 +206,6 @@ void uiResponse(unsigned int exeInterval){
 				case MKEY_VALUE_MENU:		
 					uISetNextStatus(UIS_MENU_MAIN);
 					break;
-				case MKEY_VALUE_UP:
-					volAdjAction(0);
-					break;
-				case MKEY_VALUE_DOWN:
-					volAdjAction(1);
-					break;
 				case MKEY_VALUE_ESC:
 					if(sutPocStatus.danHuStatus!=0) msgAtSend("AT+POC=500000\r\n");
 					break;
@@ -305,6 +302,9 @@ void uiResponse(unsigned int exeInterval){
 		case UIS_MENU_SYS_VOICE:
 			uiShowVoiceInfoResponse();
 			break;
+		case UIS_MENU_SYS_ANT:
+			uiShowANTResponse();
+			break;
 		case UIS_MENU_SYS_PASS:
 			uiShowPasswordResponse();
 			break;

+ 1 - 0
app/uiEntry.h

@@ -31,6 +31,7 @@ typedef enum{
 	UIS_MENU_SYS_INFO,		//1.4.8:终端信息菜单
 	UIS_MENU_SYS_SD,		//1.4.9:终端设置SD卡检测
 	UIS_MENU_SYS_VOICE,		//1.4.10:留音记录菜单
+	UIS_MENU_SYS_ANT, 
 	UIS_MENU_SYS_PASS,
 	
 	UIS_MENU_TASK_QUERY,	//1.1.1:(学习任务)查看任务内容

BIN
lib/libohpoc.a