/******************************************************************************** * File Name: MainTask.h * Function Describe: Header file for MainTask.c * Explain: * Writer: ShiLiangWen * Date: 2015-1-30 #define PC_Q_NUM 5 #define PC_MSG_BUF_LEN 300 extern unsigned char PcMsgBuf[PC_Q_NUM][PC_MSG_BUF_LEN]; extern int GpsMsgBufIndex; extern OS_EVENT *GpsQ; *******************************************************************************/ #ifndef __MAIN_TASK_H #define __MAIN_TASK_H /************************************file begin*******************************/ #include //#include "MsgQueue.h" #include "stm32f10x.h" #define MIN_PWR_LEVEL 345 //低于此电压后不工作 //330 #define WARN_PWR_LEVEL 353 //提示请充电电压 typedef enum{ MCU_UNKNOWN, MCU_HK, MCU_ST, }MUC_TYPE; extern MUC_TYPE Mcu_Type; #define USE_RUNNING_MAKE #ifdef USE_RUNNING_MAKE void RunningMake(unsigned short FileID, unsigned long line); #define RunMake(FileID) RunningMake(FileID, __LINE__) #else #define RunMake(FileID) (void)0 #endif #define ONOFF_CK_PIN GPIO_Pin_9 #define ONOFF_CK_PORT GPIOB #define PWR_EN_PIN GPIO_Pin_2 #define PWR_EN_PORT GPIOC #define PWR_EN_HIGH PWR_EN_PORT->BSRR = PWR_EN_PIN #define PWR_EN_LOW PWR_EN_PORT->BRR = PWR_EN_PIN//BRR #define START_TTS_LENGTH (20*4)//开机播报最多20个中文 #define MAIN_TASK_STK_SIZE 2024/8 //2024 //extern SUT_MSG_QUEUE PcMsgQueue; void SetPowerEn(unsigned char en); void PowerCtrlInit(void); void UC2UL(unsigned char *pUC,unsigned long *pUL); void UL2UC(unsigned long UL, unsigned char *pUC); void SysParaInit(void); void SystemReset(void); void ADCInit(void); int GetVbat(void); void CheckVbat(int Vbat); //void ReportVbat(int Vbat); //void ReportCSQ(int CSQ); int OnOffCheck(void); void ReportVbatCsqGps(void); void ReportVersion(void); void ReportUserGroupName(void); int GetParaFromStr(char *Str,char *Para,char *Value); unsigned long ReadPsnFromFlash(void); void SavePsnToFlash(unsigned long PSN); void SaveParaToFlash(void); void ReadParaFromFlash(void); void IWDG_Configuration(unsigned int ); void ReportMcuVer(void); void ReportModemVer(int ver); void AscStrToHexStr(char *AscStr, char *HexStr); void EnterGTMode(void); void GPIO_Config_ALL_AIN(void); void Sys_Standby(void); void UpdataPocVersion(void); void OsDelayTime(unsigned short t);//系统延时 带喂狗 void TSMakeSendStrData(void); void GTMode_Detected(void); void ResetModem(void); void PcMsgHandle2(char *msg); int GetOneceVbat(); void MCU_FACTORY_RECOGNIZE(); __task void MainTask(void); unsigned char AscToHex(unsigned char aHex); short FindTargetIndex(char *source, char sourceEndIndicator, char *target, unsigned char targetLen,unsigned char witchOne); unsigned char GetStringIP2Bytes(unsigned char *IPBytes,char *IPString); void MakeStrEndByNewLine(char *str); uint16_t StrUnicodeToAnsi(uint8_t *dest,uint16_t size,const char *src); uint16_t AnsiToStrUnicode(uint8_t *dest,uint16_t size,const char *src); void StrAsciiToHex(char *src, unsigned char *des); void makeAuthCode(unsigned char *auth); void cmdShutDown(char ); void PrintBufferData(unsigned char *data, unsigned short length); extern unsigned char modemInitReady; extern unsigned char modemPwrOffNow; extern unsigned char pocTimeOutTime; extern unsigned char g_usSOSCnt; extern unsigned char g_usLightCnt; extern unsigned char bootFlag; extern unsigned int bootMapCnt; extern unsigned int pttPressFreeCt; extern unsigned char g_uslockCnt; extern unsigned char g_uslockflag; extern unsigned char Ui_LockFlag; extern unsigned char g_usVoiceCnt; extern unsigned char g_usFastInterfaceCnt; extern unsigned char g_usFactory; extern unsigned char Pttfreeflag; extern int g_iVbat; extern unsigned short g_usFileID; extern unsigned long g_ulFileLine; extern unsigned char g_ucGtMode; extern OS_TID idMainTask; extern U64 stkMainTask[MAIN_TASK_STK_SIZE]; extern unsigned char g_ucEnterGroupFlag; extern unsigned char m_GroupSwitch; extern unsigned char g_ucBackLightCnt; extern char sysStartTTS[START_TTS_LENGTH]; extern unsigned int Vbat; extern unsigned char ReCharge; extern unsigned char g_usGtcnt; extern unsigned char Ui_VolLvFlag; extern unsigned char Ui_VolLvCnt; extern unsigned char g_uckeybeep; extern unsigned char g_ucPoweroffcnt; extern unsigned char g_cMenuBack; /************************************file end ******************************************/ #endif