123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107 |
- /*
- * @Author: chenjie
- * @Date: 2022-06-06
- * @LastEditTime: 2022-10-27
- * @LastEditors: chenjie
- * @Description:
- * @FilePath: \S32K146_4G\code\app\AppGlobalVar.c
- * Copyright (c) 2022 by chenjie, All Rights Reserved.
- */
- /*
- * AppGlobalVar.c
- *应用层全局变量
- * Created on: 2022年1月19日
- * Author: QiXiang_CHENJIE
- */
- #include "AppGlobalVar.h"
- //#define APP_RELEASE
- #ifdef APP_RELEASE
- const char WebSiteName[] = "\"iotp.fast-fun.cn\"";
- uint16 WebSitePort = 8712;
- #else
- const char WebSiteName[] = "\"nas.fast-fun.cn\"";
- uint16 WebSitePort = 8812;
- #endif
- #define defaultSn "SPFPFL264S226D001"
- const uint32 AppSwVersion = 0x00000108;
- const uint8 DataModuleType = 0x02;//01=NB,02-4G
- const uint16 HwVersion = 0x001;
- const uint32 BlSwVersion = 0x00000001;
- const uint32 DrvSwVersion = 0x00000001;
- const uint8 BmsManuFacture = 0xff;
- const uint8 BmsInfo = 0xff;
- uint8 TcpbattSN[BATT_SN_LEN] = {0x31};
- volatile uint32 TimerCounter = 0; // ms单位
- uint8 Fota_update_flag = 0;
- uint8 Fota_error_flag = 0;
- /*GPS*/
- QueueHandle_t GpsDataQueueHandle;
- sint16 xyzData[3] = {0};
- /*Hal_Can*/
- uint8 CanIf_u8TxConfirmCnt = 0U;
- boolean CanIf_bTxFlag = false;
- uint8 CanIf_u8RxIndicationCnt = 0U;
- boolean CanIf_bRxFlag = false;
- QueueHandle_t CanRecvQueueHandle;
- /*TCP相关变量*/
- bool TcpSysReboot = 1; // tcp无法联网时,重启使能
- char ImeiNum[15] = {0};
- char IccidNum[20] = {0};
- uint8 CSQValue = 0;
- sint8 SocketId = -1; // 联网状态
- sint8 RegChkRet = 0; // 驻网状态
- char WebSiteIp[20] = {0};
- uint8 TcpWorkState = 0;
- #define EEP_START_SEC_VAR_INIT_8_NO_CACHEABLE
- #include "Eep_MemMap.h"
- AppConfigBody AppConfigInfo = {false, true, {defaultSn}, {0}};
- #define EEP_STOP_SEC_VAR_INIT_8_NO_CACHEABLE
- #include "Eep_MemMap.h"
- /*以下变量均为串口协议相关变量*/
- #ifdef APP_UART0_ENABLE
- AppDataBody AppDataInfo = {BMS_CELLNUM, BMS_TEMPNUM};
- uint16 avrgCellVol = 0; // 平均电压
- uint16 bmsHwVersion = 0;
- uint32 bmsSwVersion = 0;
- uint16 battCellU[BMS_CELLNUM]; // 电池电压
- uint16 battI = 10000; // BMS电流(tcp上传)
- uint16 battPackVol = 0; // bms电压
- uint16 maxCellVol = 0; // 最大单体电压
- uint16 minCellVol = 0; // 最小单体电压
- // uint16 socd_pct_vcuSoc = 0; // soc(tcp上传,精度0.1)
- // uint16 sohd_pct_bcuSoh = 0; // soh(tcp上传,精度0.1)
- uint32 battBalanceoInfo = 0; //
- uint32 battProtectState = 0; // bms保护状态
- uint32 battWarningState = 0; // bms告警状态
- uint8 AvgBattTemp = 0; // 平均单体温度
- uint8 battCellTemp[BMS_TEMPNUM]; // 电池温度
- uint8 Battdesigncap = 0; // 电池包设计容量
- uint8 battHeatEnableState = 0; // bms加热状态
- uint8 battMOSSwitchState = 0; // bms mos开关状态
- uint8 battSOC = 0; // bms发送soc
- uint8 battSOH = 0; // bms发送soh
- uint8 battWorkState = 0; // bms工作状态
- uint8 BmsOtherTemp = 0; // BMS其他温度,没有其他温度,为0
- uint8 maxCellTemp = 0; // 最大单体温度
- uint8 minCellTemp = 0; // 最小单体温度
- uint8 OtherTemp = 0; // 通讯模块其他温度
- uint8 battHeatState = 0;
- uint8 battFanState = 0;
- uint8 battRelayState = 0;
- uint8 battConverState = 0;
- uint8 battSeparateEnable = 0;
- uint8 battSeparateCtlState = 0;
- uint8 battSeparateState = 0;
- uint16 ErrorArray[5] = {0};
- uint32 meterAllPwr[2] = {0};
- uint32 meterPosPwr[2] = {0};
- uint32 meterNegPwr[2] = {0};
- uint32 BattTempR[4] = {0xFF};
- #endif
|