123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105 |
- /********************************************************************************
- * 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 <rtl.h>
- #include "MsgQueue.h"
- #define MIN_PWR_LEVEL 330 //低于此电压后不工作
- #define WARN_PWR_LEVEL 340 //提示请充电电压
- #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
- extern unsigned short g_usFileID;
- extern unsigned long g_ulFileLine;
- #define ONOFF_CK_PIN GPIO_Pin_9
- #define ONOFF_CK_PORT GPIOB
- #define PWR_EN_PIN GPIO_Pin_5
- #define PWR_EN_PORT GPIOB
- #define PWR_EN_HIGH PWR_EN_PORT->BSRR = PWR_EN_PIN
- #define PWR_EN_LOW PWR_EN_PORT->BRR = PWR_EN_PIN
- #define MAIN_TASK_STK_SIZE 1024/8
- extern OS_TID idMainTask;
- extern U64 stkMainTask[MAIN_TASK_STK_SIZE];
- extern int g_iVbat;
- //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);
- 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 AscStrToHexStr1(char *AscStr, char *HexStr,unsigned char len);
- void EnterGTMode(void);
- void GPIO_Config_ALL_AIN(void);
- void Sys_Standby(void);
- void ExitGroupSelect(void);
- unsigned char AscToHex(unsigned char aHex);
- extern unsigned char GroupSelectStat;
- extern unsigned char GroupSelectFlag;
- extern unsigned char g_net_flag;
- //从source查找长度为targetLen目标的target,找到后返回目标段后一字节的索引,没找到返回-1,source结束为sourceEndIndicator
- //witchOne: 找第几个目标
- short FindTargetIndex(char *source, char sourceEndIndicator, char *target, unsigned char targetLen,unsigned char witchOne);
- __task void MainTask(void);
- void ReportPocGpsIP(void);
- char changeDataFormat(char *asciiData, unsigned short len);
- void MakeStrEndByNewLine(char *str);
- void Select_Net(unsigned char net);
- void GetMododexWithCard(void);
- void BroadCast_Net();
- void CSQ_Prompt();
- void NumStrToUnicode(char *pNum,char *pUnicode);
- extern unsigned char g_ucEnterGroupFlag;
- unsigned char GetStringIP2Bytes(unsigned char *IPBytes,char *IPString);
- extern unsigned char modemInitReady;
- extern unsigned char modemPwrOffNow;
- extern unsigned char pocTimeOutTime;
- extern unsigned char g_net_cnt;
- extern unsigned char net_sure;
- extern unsigned char CSQ_flag;
- extern unsigned char CSQ_ct;
- /************************************file end ******************************************/
- #endif
|