Browse Source

T555_V03032
1、修复开机老是显示关机问题
2、添加功放模式设置菜单
3、使用纵拓HS390机型EQ参数
4、去掉耳机插入与拔出的ADC检测
5、添加88脚ADC检测电源电压
6、添加低电关机操作

wangjianlin 3 years ago
parent
commit
de294b8bf7
12 changed files with 106 additions and 20 deletions
  1. BIN
      Released/T555_V03032.rar
  2. 9 1
      Released/releasenote.txt
  3. 19 8
      app/app.c
  4. 1 1
      app/app.h
  5. 13 5
      app/board.c
  6. 1 1
      app/ohpoc.h
  7. 1 0
      app/setting.c
  8. 2 1
      app/setting.h
  9. 50 3
      app/uiBlock.c
  10. 3 0
      app/uiBlock.h
  11. 6 0
      app/uiEntry.c
  12. 1 0
      app/uiEntry.h

BIN
Released/T555_V03032.rar


+ 9 - 1
Released/releasenote.txt

@@ -142,4 +142,12 @@ V03030
 V03031
 1、固件恢复到CB模块:N58-R07-STD-OE_V40-002
 2、去掉锁电源IO控制,使用模块关机指令关机
-3、适配新固件其它操作
+3、适配新固件其它操作
+
+V03032
+1、修复开机老是显示关机问题
+2、添加功放模式设置菜单
+3、使用纵拓HS390机型EQ参数
+4、去掉耳机插入与拔出的ADC检测
+5、添加88脚ADC检测电源电压
+6、添加低电关机操作

+ 19 - 8
app/app.c

@@ -9,7 +9,6 @@ APP_DEF sutApp;
 
 static void appDataInit(void){
 	memset((unsigned char *)&sutApp, 0, sizeof(APP_DEF));
-	sutApp.pcant=4;//默认免提
 	appSleepCtl(ASLEEP_POC, 1);
 	appSleepCtl(ASLEEP_LCD, 1);
 	readInfoNow();
@@ -84,7 +83,7 @@ static void uiProcess(unsigned int exeInterval){
 static void pwrKeyDetect(unsigned int exeInterval){
 	static char pressed=0;
 	static int kcnt=0,cnt=0;
-	if(sutApp.pwrKeyStatus==0){//按下了
+	if(sutApp.pwrKeyStatus!=0){//按下了
 		appSleepCtl(ASLEEP_PWRKEY, 1);
 		if(pressed==0){
 			kcnt=1;
@@ -133,7 +132,7 @@ void shutSysNow(void){
 }
 static void antModePwrDet(void){
 	static int kcnt=0;
-	if(sutApp.pwrKeyStatus==0){
+	if(sutApp.pwrKeyStatus!=0){
 		if(++kcnt==3){
 			guiShowMessageBox("正在关机");
 			CTL_LCD_BL(0);
@@ -174,7 +173,8 @@ static void pwrShutPro(unsigned int exeInterval){
 	msgAtSend("AT+CFUN=0\r\n");
 	if(shutFlag==0){
 		//显示关机界面
-		guiShowMessageBox("正在关机");
+		if(sutApp.lowPwrMsg==0) guiShowMessageBox("正在关机");
+		else guiShowMessageBox("低压关机");
 		shutFlag=1;
 		nwy_sleep(1000);
 	}
@@ -834,10 +834,11 @@ static void adcRead(void){
 	int adcValueTmp;
 	static int siVbat=0;
 	static int laSiVbat;
-	static unsigned char index=0;
+	static unsigned char index=0,lcnt=0;
 	int x=(GLCD_WIDTH-16)/2;
 	int y=GLCD_HEIGHT-12;
 
+	#if 0//原来是ADC检测耳机接入与否,现在用来检测电压
 	//检测音量旋钮电压
 	adcValueTmp=nwy_adc_get(NWY_ADC_CHANNEL3, NWY_ADC_SCALE_1V250);
 	if(adcValueTmp>0){//15   1227
@@ -859,15 +860,25 @@ static void adcRead(void){
 			}
 		}else if(sutApp.earStatus != 0) sutApp.earStatus=0;//切到其它菜单后再切回来还能显示
 	}
-	
+	#endif
 	//检测电池电压
-	adcValueTmp=nwy_adc_get(NWY_ADC_CHANNEL4, NWY_ADC_SCALE_5V000);
+	//adcValueTmp=nwy_adc_get(NWY_ADC_CHANNEL4, NWY_ADC_SCALE_5V000);
+	adcValueTmp=nwy_adc_get(NWY_ADC_CHANNEL3, NWY_ADC_SCALE_1V250);
 	siVbat += adcValueTmp;
 	if(++index>=VBAT_READ_TIME){
-		sutApp.g_iBAT=siVbat / VBAT_READ_TIME / 10;
+		siVbat=siVbat / VBAT_READ_TIME / 10;
+		sutApp.g_iBAT = siVbat*147/47;
 		if(laSiVbat!=sutApp.g_iBAT){
 			//MSG_INFO(1, "bat:%d", sutApp.g_iBAT);
 			laSiVbat=sutApp.g_iBAT;
+			if(sutApp.g_iBAT<=MIN_PWR_LEVEL){
+				MSG_WARN(1,"Low power:%d", lcnt++);
+				if(lcnt>=10){
+					MSG_INFO(1, "Low power ,shut");
+					sutApp.lowPwrMsg=1;
+					appSleepCtl(ASLEEP_PWR, 1);
+				}
+			}else lcnt=0;
 		}
 		siVbat=0;
 		index=0;

+ 1 - 1
app/app.h

@@ -53,6 +53,7 @@ typedef struct{
 	unsigned char enableKey:1;//延时界面是否完成,用于阻止延时期间禁止按键操作
 	unsigned char keyLock:1;//键盘是否被锁了
 	unsigned char lockShow:1;//显示一下解锁提示信息
+	unsigned char lowPwrMsg:1;
 	unsigned char groupTTSEnable:1;//收到86可以播放
 	unsigned char skipTTS:1;//不同时候禁止播放TTS
 	unsigned char earStatus:1;
@@ -68,7 +69,6 @@ typedef struct{
 	char pocVersion[10];
 	unsigned char simSel;//卡用的是哪个:0,1
 	char modemVer[30];
-	unsigned char pcant;
 	unsigned char lcdReconfigCnt;
 	VOICE_DEF voiceInfo;
 	unsigned char fotaStatus;

+ 13 - 5
app/board.c

@@ -13,9 +13,9 @@ static void _openkeypad(nwy_key_t key, nwy_keyState_t evt)
 		if(sutUIstatus.Status!=UIS_STANDBY) backLightReset();//主界面后面会处理点亮操作
 		tryWakeupApp();
 		if(evt == key_state_press){
-			sutApp.pwrKeyStatus=0;
-		}else{
 			sutApp.pwrKeyStatus=1;
+		}else{
+			sutApp.pwrKeyStatus=0;
 		}
 	}
 }
@@ -276,7 +276,7 @@ void paControl(bool status){
 	#error "pls select pa control type"
 #endif
 #endif
-	char PACNT=sutApp.pcant;
+	char PACNT=newPara.paCnt;
 	if(newPara.spkVol<=0){
 		CTL_SPK_EN(0);
 		return;
@@ -353,16 +353,20 @@ static void pwmTimerCb(void *param){//beep 结束操作
 void beepStart(int freq){}
 #endif
 ///////////////////////PWM控制结束////////////////////////////////
-
+#define USE_HS390_EQ
 //////////////////////修改EQ增益配置值///////////////////////////////
 void modifyEqData(void){
+#ifndef USE_HS390_EQ
 	const char *handFreeEq="AT+CAVQE=0,1,12,\"01000700c800070002000000800c07000300f4ffa4060f000300fbff9001070000000000e803070000000000d007070000000000a60e070001000000\"\r\n";
-	
+#else	//HS390
+	const char *handFreeEq="AT+CAVQE=0,1,12,\"010007009600070002000000800c07000000f4ffdc0507000300fdff9001070000000000e803070000000000d007070000000000a60e070000000000\"\r\n";
+#endif
 	msgAtSend(handFreeEq);
 }
 
 //////////////////////修改输出增益配置///////////////////////////////
 void modifyAudioOutGainConfig(void){
+#ifndef USE_HS390_EQ
 	char cmd[20]="AT+CACCP=0,1,2,\"";
 	unsigned char alg1=211,alg2=0xff;
 	unsigned char dac=125;//default=46
@@ -379,4 +383,8 @@ void modifyAudioOutGainConfig(void){
 		alg1 += 3;
 	}
 	msgAtSend("\"\r\n");
+#else //HS390
+	const char cmd[]="AT+CACCP=0,1,2,\"000009000000000001000100000000000100050000000000010009000000000001000c000000000001000f000000000001001200000000000100150000000000010018000000000001001b000000000001001e00000000000100220000000000010026000000000001002a000000000001002e00000000000100320000000000\"\r\n";
+	msgAtSend(cmd);
+#endif
 }

+ 1 - 1
app/ohpoc.h

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

+ 1 - 0
app/setting.c

@@ -123,6 +123,7 @@ void sysIniRead(void){
 		if(newPara.ttsMessage[0]!=0 && newPara.ttsCodeType==0) ttsToBEStr(newPara.ttsMessage, strlen(newPara.ttsMessage));
 		//强制默认�
 		newPara.spkVol=6;
+		newPara.paCnt=2;//FM
 	}
 	if(newPara.serverMenuPass!=NULL) memcpy(menu_key, newPara.serverMenuPass,6);
 	//测试开�

+ 2 - 1
app/setting.h

@@ -55,7 +55,8 @@ typedef struct{
 	unsigned char Mode;//配置文件所属机型
 	///////////////////////////////////////
 	unsigned char spkVol;
-	unsigned char reversed[49];//保留段
+	unsigned char paCnt;
+	unsigned char reversed[48];//保留段
 	///////////////////////////////////////
 	char ttsMessage[20*4];//开机TTS,空则不播放
 	unsigned char ttsCodeType;//TTS编码类型

+ 50 - 3
app/uiBlock.c

@@ -1,8 +1,6 @@
 
 #include "includes.h"
 /****************************状态栏显示部分开始***********************************/
-#define MIN_PWR_LEVEL 315  //低于此电压后不工作
-#define WARN_PWR_LEVEL 325 //提示请充电电压
 static const char *NullPtr="";
 
 //显示信号强度
@@ -747,6 +745,7 @@ void uiShowMenuSysSetup(char flash){
 		"7,终端信息",
 		"8,SD卡检测",
 		"9,天线调试",
+		"10,功放模式",
 #ifdef MENU_TEST
 		"10,测试",
 #endif
@@ -795,6 +794,9 @@ void sysTemSetResponse(void){
 			case 8://天线调试
 				uISetNextStatus(UIS_MENU_SYS_ANT);
 				break;
+			case 9://功放模式
+				uISetNextStatus(UIS_MENU_SYS_PA);
+				break;
 #ifdef MENU_TEST				
 			case 9://测试
 				uISetNextStatus(UIS_MENU_SYS_TEST);
@@ -803,7 +805,7 @@ void sysTemSetResponse(void){
 		if(sutMenuSysSetup.handle<=9)
 #else
 		}
-		if(sutMenuSysSetup.handle<=8)
+		if(sutMenuSysSetup.handle<=9)
 #endif
 		uiPushStack(sutMenuSysSetup.handle);
 	}else if(MKEY_VALUE_ESC==key) uISetNextStatus(UIS_MENU_MAIN);
@@ -1603,6 +1605,51 @@ void uiShowNoteSelResponse(void){
 }
 /*****************************提示音设置结束********************************/
 
+/*****************************功放模式开始********************************/
+static void paFlash(void){
+	char info[30];
+	unsigned short x,y,len;
+	
+	if(noteSetTmp==2) snprintf(info, sizeof(info), "FM模式");
+	else snprintf(info, sizeof(info), "免提模式");
+	
+	len=guiGetStrXLen((char *)info, FONT_MODE_12X12);
+	x=(GLCD_WIDTH-len)/2;
+	y=UI_CONTENT_SHOW_Y+(GLCD_HEIGHT-UI_CONTENT_SHOW_Y)/2-12;
+	guiClearRect(0, y, GLCD_WIDTH-1, y+12, guiGetBackColor());
+	guiShowStr(x,y,info, FONT_MODE_12X12, REVERSED_NO, COLOR_BLACK, guiGetBackColor());
+}
+void uiShowPA(char StatusUpdate){
+	if(StatusUpdate){
+		guiClearAll(guiGetBackColor());
+		guiShowCaption(0,"功放模式设置",UI_STATUS_ITEM_Y+1,guiGetBackColor(),guiGetForeColor(),FONT_MODE_12X12);
+		uiMenuShowBottomLine();
+		noteSetTmp=newPara.paCnt;
+		paFlash();
+		uiMenuShowBottomIndacitor("保存", "返回");
+	}
+}
+
+void uiShowPAResponse(void){
+	unsigned short key=getKeyValue();
+	if(MKEY_VALUE_ESC==key) uISetNextStatus(UIS_MENU_SYS_SEL);
+	else if(MKEY_VALUE_MENU==key){
+		getStackStruct()->ok_back=1;
+		if(newPara.paCnt != noteSetTmp){
+			newPara.paCnt=noteSetTmp;
+			if(newPara.paCnt==2) MSG_INFO(1,"FM Mode:%d", newPara.paCnt);
+			else MSG_INFO(1,"MIAN TI MODE:%d", newPara.paCnt);
+			sysIniSave();
+		}
+		uISetNextStatus(UIS_MENU_SYS_SEL);
+	}else if(MKEY_VALUE_DOWN || MKEY_VALUE_UP){
+		if(noteSetTmp==2) noteSetTmp=4;
+		else noteSetTmp=2;
+		paFlash();
+	}
+}
+/*****************************功放模式结束********************************/
+
 void uiShowPassword(char StatusUpdate){
 	int len,x,y=GLCD_HEIGHT/2;
 	char info[60];

+ 3 - 0
app/uiBlock.h

@@ -20,6 +20,9 @@
 #define BAT_ICON_X (TIME_ICON_X+TIME_ICON_WX+2)
 #define BAT_ICON_WX (21)
 
+#define WARN_TTS_INTERVAL 30000  //定时提示充电间隔
+#define MIN_PWR_LEVEL 320  //低于此电压后不工作
+#define WARN_PWR_LEVEL 340 //提示请充电电压
 extern unsigned char netshowvalue;
 
 void uiShowStatusBar(char flash,unsigned int exeInterval);

+ 6 - 0
app/uiEntry.c

@@ -146,6 +146,9 @@ void uiLoop(unsigned int exeInterval){
 		case UIS_MENU_SYS_ANT:
 			uiShowANT(StatusUpdate);
 			break;
+		case UIS_MENU_SYS_PA:
+			uiShowPA(StatusUpdate);
+			break;
 		case UIS_MENU_SYS_PASS:
 			uiShowPassword(StatusUpdate);
 			break;
@@ -305,6 +308,9 @@ void uiResponse(unsigned int exeInterval){
 		case UIS_MENU_SYS_ANT:
 			uiShowANTResponse();
 			break;
+		case UIS_MENU_SYS_PA:
+			uiShowPAResponse();
+			break;
 		case UIS_MENU_SYS_PASS:
 			uiShowPasswordResponse();
 			break;

+ 1 - 0
app/uiEntry.h

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