123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107 |
- #ifndef __APP_H__
- #define __APP_H__
- #include "board.h"
- #include "nwy_osi_api.h"
- #define APP_TASK_SLEEP_TIME 10
- #define APP_SUB_DIV_TIME (APP_TASK_SLEEP_TIME*2) //暂时未明白
- typedef enum{
- ENCODE_USER_GBK=1,
- ENCODE_USER_UNICODE_BE
- }ENCODE_USER_ENUM;
- typedef enum{
- ASLEEP_POC,//POC是否休眠
- ASLEEP_ADC,//音量旋钮是否忙
- ASLEEP_KEY,//普通KEY是否可以休眠,无按键可以休眠(持续按下不休眠)
- ASLEEP_MKEY,//矩阵KEY
- ASLEEP_PWR,//电源是否执行了关闭
- ASLEEP_LCD,//LCD是否休眠
- ASLEEP_GGROUP,//用于获取群组列表时不要休眠
- ASLEEP_GUSER,//用于获取成员列表时不要休眠
- ASLEEP_LEARN,//用于学习录音/播放时不要休眠使用
- ASLEEP_PWRKEY,
- }ASLEEP_ENUM;
- #define VOICE_ITEM_NUM 3
- #pragma pack(push)
- #pragma pack(1)
- typedef struct{
- unsigned int psn;
- char password[30];
- }ACCOUNT_DEF;
- typedef struct{
- unsigned char index;
- char info[30];//显示的信息
- }VOICE_INFO_DEF;
- typedef struct{
- unsigned char update;
- unsigned char voiceStatus;
- unsigned char aNum;
- unsigned char vNum;
- unsigned char voiceValidNum;
- VOICE_INFO_DEF info[VOICE_ITEM_NUM];
- }VOICE_DEF;
- typedef struct{
- unsigned char guiStatus:1;//gui是否初始化完成
- unsigned char pocInitStatus:1;//poc是否启动完成
- unsigned char appStatus:1;//app是否休眠
- unsigned char pocParaDone:1;//poc参数是否检测完成
- unsigned char cardStatus:1;//
- unsigned char gtMode:1;//GT模式
- unsigned char gtTMode:1;//TM模式
- unsigned char pocPpp:1;
- unsigned char pwrLock:1;//电源是否锁定,只有在电源未锁定时,开机了才关机
- unsigned char enableKey:1;//延时界面是否完成,用于阻止延时期间禁止按键操作
- unsigned char keyLock:1;//键盘是否被锁了
- unsigned char lockShow:1;//显示一下解锁提示信息
- unsigned char groupTTSEnable:1;//收到86可以播放
- unsigned char skipTTS:1;//不同时候禁止播放TTS
- unsigned char earStatus:1;
- 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;
- int g_iBAT;
- char fotaVersion[10];
- char pocVersion[10];
- unsigned char simSel;//卡用的是哪个:0,1
- char modemVer[30];
- unsigned char pcant;
- unsigned char lcdReconfigCnt;
- VOICE_DEF voiceInfo;
- unsigned char fotaStatus;
- }APP_DEF;
- #pragma pack(pop)
- extern APP_DEF sutApp;
- extern nwy_osiThread_t *mainThreadPtr;
- extern int keyNum;
- char isKeyPress(void);
- void dataInit(void);
- void appRun(void);
- void usbCmdHandler(const char *data,uint32 length);
- void keyHandler(unsigned short key,unsigned char status);
- void hpDetStatusChanged(unsigned char hpStatus);
- void subTask(void *param);
- void threadSendEvent(nwy_osiThread_t *threadID, uint32 id, uint32 param1,uint32 param2,uint32 param3);
- void tryWakeupApp(void);
- void keyStatusCtlAll(char high_low);
- void keyCheck(unsigned short);
- void mKeyCheck(void);
- unsigned short getKeyValue(void);
- void ttsPlay(ENCODE_USER_ENUM type, char *tts);
- void backLightCb(void *param);
- void StrAsciiToHex(char *src, unsigned char *des);
- void appSleepCtl(ASLEEP_ENUM ctlType, char status);
- char getAppObjStatus(ASLEEP_ENUM ctlType);
- void volAdjAction(char direction);
- void splVolumeSet(unsigned char level);
- #endif
|