Kaynağa Gözat

Merge branch 'V3-V31XX-7250' of http://git.fast-fun.cn:92/RuiLiWuLian/NB_APP_Code into V3-7250-QTF

LAPTOP-EG88H5BE\86151 3 yıl önce
ebeveyn
işleme
78d66dc20c
4 değiştirilmiş dosya ile 113 ekleme ve 104 silme
  1. 2 2
      inc/AppConfig.h
  2. 84 86
      inc/EmbeddedCoder_inc/BCUCal.h
  3. 21 16
      src/AppFunc.c
  4. 6 0
      src/EmbeddedCoder_src/BCUCal.c

+ 2 - 2
inc/AppConfig.h

@@ -2,7 +2,7 @@
  * @Author       : ChenJie
  * @Date         : 2021-10-14 09:27:15
  * @LastEditors  : ChenJie
- * @LastEditTime : 2021-11-17 14:55:46
+ * @LastEditTime : 2021-11-19 17:59:37
  * @Description  : App Config H file 配置文件,可以针对不同参数进行更改
  * @FilePath     : \PLAT\project\ec616_0h00\apps\qx_app\inc\AppConfig.h
  */
@@ -14,7 +14,7 @@
 #define DATA_MODULE_TYPE (1)           //1表示NB模块,2表示4G cat1
 #define EOLSTATE (0)                   //1表示下线检测跳过,使用默认值,0表示使用下线检测
 #define DEFAULT_SN "RLTEST00000000001" //默认上传的SN编码
-#define APPSWVERSION 0x0301002D        //数据模块软件版本号
+#define APPSWVERSION 0x0301002E        //数据模块软件版本号
 #define RELAYCONFIG 1                  //继电器配置
 #define TCP_ADD "iotp.fast-fun.cn"     //数据上传的地址
 #define TCP_PORT 8712                  //数据上传的端口

+ 84 - 86
inc/EmbeddedCoder_inc/BCUCal.h

@@ -1,97 +1,96 @@
 
 #include "rtwtypes.h"
-#define cmnc_num_cellUNumMax  28
-#define cmnc_num_modTNumMax  8
-extern const uint16_T blcc_R_esr;                          /* 均衡电阻 */
-extern const uint16_T blcc_T_close;                         /* 均衡暂停温度; */
-extern const uint16_T blcc_T_open;                          /* 均衡暂停恢复温度; */
-extern const uint16_T blcc_V_low;                            /* 均衡开启电压阈值 */
+#define cmnc_num_cellUNumMax 28
+#define cmnc_num_modTNumMax 8
+extern const uint16_T blcc_R_esr;   /* 均衡电阻 */
+extern const uint16_T blcc_T_close; /* 均衡暂停温度; */
+extern const uint16_T blcc_T_open;  /* 均衡暂停恢复温度; */
+extern const uint16_T blcc_V_low;   /* 均衡开启电压阈值 */
 
-extern const uint16_T cmnc_Q_ratedCp;                       /* 电池容量; */
-extern const uint16_T cmnc_num_cellUNum;                     /* 电压采样点实际个数; */
-extern const uint16_T cmnc_num_modTNum;                       /* 温度采样点实际个数; */
-extern const uint16_T cmnc_tm_parkTime;                    /* 静置时间阈值; */
-extern const uint16_T cmnm_F_polar[13]; /* 电池放电参数的C数组; */
-extern const uint16_T cmnm_R_ohm[13];       /* 电池放电参数的Ro数组; */
-extern const uint16_T cmnm_R_polar[13];       /* 电池放电参数的Rp数组; */
-extern const uint16_T cmnm_V_ocv[13];       /* 电池放电参数的OCV数组; */
-extern const uint16_T cmnm_pct_soc[13];                         /* 电池放电参数的SOC数组; */
-extern const uint16_T cmnc_V_chrgFul;                     /* 充满电的截至电压; */
-
-extern const int16_T sfmc_I_chrgCurrOverThr;                 /* 充电电流阈值 */
-extern const int16_T sfmc_I_disChrgCurrOverThr;              /* 放电电流阈值 */
-extern const int16_T sfmc_T_ACPlugTOverThrFlt1;              /* 慢充插头温度过高1级故障诊断阈值 */
-extern const int16_T sfmc_T_ACPlugTOverThrFlt2;              /* 慢充插头温度过高2级故障诊断阈值 */
-extern const int16_T sfmc_T_ACPlugTOverThrRec1;              /* 慢充插头温度过高1级故障恢复阈值 */
-extern const int16_T sfmc_T_ACPlugTOverThrRec2;              /* 慢充插头温度过高2级故障恢复阈值 */
-extern const int16_T sfmc_T_DCPlugTOverThrFlt1;              /* 快充插头温度过高1级故障诊断阈值 */
-extern const int16_T sfmc_T_DCPlugTOverThrFlt2;              /* 快充插头温度过高2级故障诊断阈值 */
-extern const int16_T sfmc_T_DCPlugTOverThrRec1;              /* 快充插头温度过高1级故障恢复阈值 */
-extern const int16_T sfmc_T_DCPlugTOverThrRec2;              /* 快充插头温度过高2级故障恢复阈值 */
-extern const uint16_T sfmc_T_chrgModTLowThrFlt1;             /* 充电模组温度过低1级故障诊断阈值 */
-extern const uint16_T sfmc_T_chrgModTLowThrFlt2;             /* 充电模组温度过低2级故障诊断阈值 */
-extern const uint16_T sfmc_T_chrgModTLowThrRec1;             /* 充电模组温度过低1级故障恢复阈值 */
-extern const uint16_T sfmc_T_chrgModTLowThrRec2;             /* 充电模组温度过低2级故障恢复阈值 */
-extern const uint16_T sfmc_T_chrgModTOverThrFlt1;            /* 充电模组温度过高1级故障诊断阈值 */
-extern const uint16_T sfmc_T_chrgModTOverThrFlt2;           /* 充电模组温度过高2级故障诊断阈值 */
-extern const uint16_T sfmc_T_chrgModTOverThrRec1;            /* 充电模组温度过高1级故障恢复阈值 */
-extern const uint16_T sfmc_T_chrgModTOverThrRec2;            /* 充电模组温度过高2级故障恢复阈值 */
-extern const int16_T sfmc_T_chrgMosTOverThrFlt1;             /* 充电Mos温度过高1级故障诊断阈值 */
-extern const int16_T sfmc_T_chrgMosTOverThrFlt2;             /* 充电Mos温度过高2级故障诊断阈值 */
-extern const int16_T sfmc_T_chrgMosTOverThrRec1;             /* 充电Mos温度过高1级故障恢复阈值 */
-extern const int16_T sfmc_T_chrgMosTOverThrRec2;             /* 充电Mos温度过高2级故障恢复阈值 */
-extern const uint16_T sfmc_T_disChrgModTLowThrFlt1;          /* 放电模组温度过低1级故障诊断阈值 */
-extern const uint16_T sfmc_T_disChrgModTLowThrFlt2;          /* 放电模组温度过低2级故障诊断阈值 */
-extern const uint16_T sfmc_T_disChrgModTLowThrRec1;          /* 放电模组温度过低1级故障恢复阈值 */
-extern const uint16_T sfmc_T_disChrgModTLowThrRec2;          /* 放电模组温度过低2级故障恢复阈值 */
-extern const uint16_T sfmc_T_disChrgModTOverThrFlt1;         /* 放电模组温度过高1级故障诊断阈值 */
-extern const uint16_T sfmc_T_disChrgModTOverThrFlt2;        /* 放电模组温度过高2级故障诊断阈值 */
-extern const uint16_T sfmc_T_disChrgModTOverThrRec1;         /* 放电模组温度过高1级故障恢复阈值 */
-extern const uint16_T sfmc_T_disChrgModTOverThrRec2;         /* 放电模组温度过高2级故障恢复阈值 */
-extern const int16_T sfmc_T_heatPanTOverThrFlt1;             /* 加热板温度过高1级故障诊断阈值 */
-extern const int16_T sfmc_T_heatPanTOverThrFlt2;             /* 加热板温度过高2级故障诊断阈值 */
-extern const int16_T sfmc_T_heatPanTOverThrRec1;             /* 加热板温度过高1级故障恢复阈值 */
-extern const int16_T sfmc_T_heatPanTOverThrRec2;             /* 加热板温度过高2级故障恢复阈值 */
-extern const int16_T sfmc_T_modTDiffThrFlt1;                  /* 模组温差过大1级故障诊断阈值 */
-extern const int16_T sfmc_T_modTDiffThrFlt2;                  /* 模组温差过大2级故障诊断阈值 */
-extern const int16_T sfmc_T_modTDiffThrRec1;                  /* 模组温差过大1级故障恢复阈值 */
-extern const int16_T sfmc_T_modTDiffThrRec2;                  /* 模组温差过大2级故障恢复阈值 */
-extern const uint16_T sfmc_V_battULowThrFlt1;               /* 总压欠压1级故障诊断阈值 */
-extern const uint16_T sfmc_V_battULowThrFlt2;               /* 总压欠压2级故障诊断阈值 */
-extern const uint16_T sfmc_V_battULowThrRec1;               /* 总压欠压1级故障恢复阈值 */
-extern const uint16_T sfmc_V_battULowThrRec2;               /* 总压欠压2级故障恢复阈值 */
-extern const uint16_T sfmc_V_battUOverThrFlt1;              /* 总压过压1级故障诊断阈值 */
-extern const uint16_T sfmc_V_battUOverThrFlt2;              /* 总压过压2级故障诊断阈值 */
-extern const uint16_T sfmc_V_battUOverThrRec1;              /* 总压过压1级故障恢复阈值 */
-extern const uint16_T sfmc_V_battUOverThrRec2;              /* 总压过压2级故障恢复阈值 */
+extern const uint16_T cmnc_Q_ratedCp;                /* 电池容量; */
+extern const uint16_T cmnc_num_cellUNum;             /* 电压采样点实际个数; */
+extern const uint16_T cmnc_num_modTNum;              /* 温度采样点实际个数; */
+extern const uint16_T cmnc_tm_parkTime;              /* 静置时间阈值; */
+extern const uint16_T cmnm_F_polar[13];              /* 电池放电参数的C数组; */
+extern const uint16_T cmnm_R_ohm[13];                /* 电池放电参数的Ro数组; */
+extern const uint16_T cmnm_R_polar[13];              /* 电池放电参数的Rp数组; */
+extern const uint16_T cmnm_V_ocv[13];                /* 电池放电参数的OCV数组; */
+extern const uint16_T cmnm_pct_soc[13];              /* 电池放电参数的SOC数组; */
+extern const uint16_T cmnc_V_chrgFul;                /* 充满电的截至电压; */
+extern const uint16_T cmnm_R_voloffset[28];          /*电压铜牌阻值补偿,单位moh*/
+extern const int16_T sfmc_I_chrgCurrOverThr;         /* 充电电流阈值 */
+extern const int16_T sfmc_I_disChrgCurrOverThr;      /* 放电电流阈值 */
+extern const int16_T sfmc_T_ACPlugTOverThrFlt1;      /* 慢充插头温度过高1级故障诊断阈值 */
+extern const int16_T sfmc_T_ACPlugTOverThrFlt2;      /* 慢充插头温度过高2级故障诊断阈值 */
+extern const int16_T sfmc_T_ACPlugTOverThrRec1;      /* 慢充插头温度过高1级故障恢复阈值 */
+extern const int16_T sfmc_T_ACPlugTOverThrRec2;      /* 慢充插头温度过高2级故障恢复阈值 */
+extern const int16_T sfmc_T_DCPlugTOverThrFlt1;      /* 快充插头温度过高1级故障诊断阈值 */
+extern const int16_T sfmc_T_DCPlugTOverThrFlt2;      /* 快充插头温度过高2级故障诊断阈值 */
+extern const int16_T sfmc_T_DCPlugTOverThrRec1;      /* 快充插头温度过高1级故障恢复阈值 */
+extern const int16_T sfmc_T_DCPlugTOverThrRec2;      /* 快充插头温度过高2级故障恢复阈值 */
+extern const uint16_T sfmc_T_chrgModTLowThrFlt1;     /* 充电模组温度过低1级故障诊断阈值 */
+extern const uint16_T sfmc_T_chrgModTLowThrFlt2;     /* 充电模组温度过低2级故障诊断阈值 */
+extern const uint16_T sfmc_T_chrgModTLowThrRec1;     /* 充电模组温度过低1级故障恢复阈值 */
+extern const uint16_T sfmc_T_chrgModTLowThrRec2;     /* 充电模组温度过低2级故障恢复阈值 */
+extern const uint16_T sfmc_T_chrgModTOverThrFlt1;    /* 充电模组温度过高1级故障诊断阈值 */
+extern const uint16_T sfmc_T_chrgModTOverThrFlt2;    /* 充电模组温度过高2级故障诊断阈值 */
+extern const uint16_T sfmc_T_chrgModTOverThrRec1;    /* 充电模组温度过高1级故障恢复阈值 */
+extern const uint16_T sfmc_T_chrgModTOverThrRec2;    /* 充电模组温度过高2级故障恢复阈值 */
+extern const int16_T sfmc_T_chrgMosTOverThrFlt1;     /* 充电Mos温度过高1级故障诊断阈值 */
+extern const int16_T sfmc_T_chrgMosTOverThrFlt2;     /* 充电Mos温度过高2级故障诊断阈值 */
+extern const int16_T sfmc_T_chrgMosTOverThrRec1;     /* 充电Mos温度过高1级故障恢复阈值 */
+extern const int16_T sfmc_T_chrgMosTOverThrRec2;     /* 充电Mos温度过高2级故障恢复阈值 */
+extern const uint16_T sfmc_T_disChrgModTLowThrFlt1;  /* 放电模组温度过低1级故障诊断阈值 */
+extern const uint16_T sfmc_T_disChrgModTLowThrFlt2;  /* 放电模组温度过低2级故障诊断阈值 */
+extern const uint16_T sfmc_T_disChrgModTLowThrRec1;  /* 放电模组温度过低1级故障恢复阈值 */
+extern const uint16_T sfmc_T_disChrgModTLowThrRec2;  /* 放电模组温度过低2级故障恢复阈值 */
+extern const uint16_T sfmc_T_disChrgModTOverThrFlt1; /* 放电模组温度过高1级故障诊断阈值 */
+extern const uint16_T sfmc_T_disChrgModTOverThrFlt2; /* 放电模组温度过高2级故障诊断阈值 */
+extern const uint16_T sfmc_T_disChrgModTOverThrRec1; /* 放电模组温度过高1级故障恢复阈值 */
+extern const uint16_T sfmc_T_disChrgModTOverThrRec2; /* 放电模组温度过高2级故障恢复阈值 */
+extern const int16_T sfmc_T_heatPanTOverThrFlt1;     /* 加热板温度过高1级故障诊断阈值 */
+extern const int16_T sfmc_T_heatPanTOverThrFlt2;     /* 加热板温度过高2级故障诊断阈值 */
+extern const int16_T sfmc_T_heatPanTOverThrRec1;     /* 加热板温度过高1级故障恢复阈值 */
+extern const int16_T sfmc_T_heatPanTOverThrRec2;     /* 加热板温度过高2级故障恢复阈值 */
+extern const int16_T sfmc_T_modTDiffThrFlt1;         /* 模组温差过大1级故障诊断阈值 */
+extern const int16_T sfmc_T_modTDiffThrFlt2;         /* 模组温差过大2级故障诊断阈值 */
+extern const int16_T sfmc_T_modTDiffThrRec1;         /* 模组温差过大1级故障恢复阈值 */
+extern const int16_T sfmc_T_modTDiffThrRec2;         /* 模组温差过大2级故障恢复阈值 */
+extern const uint16_T sfmc_V_battULowThrFlt1;        /* 总压欠压1级故障诊断阈值 */
+extern const uint16_T sfmc_V_battULowThrFlt2;        /* 总压欠压2级故障诊断阈值 */
+extern const uint16_T sfmc_V_battULowThrRec1;        /* 总压欠压1级故障恢复阈值 */
+extern const uint16_T sfmc_V_battULowThrRec2;        /* 总压欠压2级故障恢复阈值 */
+extern const uint16_T sfmc_V_battUOverThrFlt1;       /* 总压过压1级故障诊断阈值 */
+extern const uint16_T sfmc_V_battUOverThrFlt2;       /* 总压过压2级故障诊断阈值 */
+extern const uint16_T sfmc_V_battUOverThrRec1;       /* 总压过压1级故障恢复阈值 */
+extern const uint16_T sfmc_V_battUOverThrRec2;       /* 总压过压2级故障恢复阈值 */
 extern const uint16_T sfmc_V_cellULowThrFlt1;        /* 单体电压欠压1级故障诊断阈值 */
-extern const uint16_T sfmc_V_cellULowThrFlt2;              /* 单体电压欠压2级故障诊断阈值 */
-extern const uint16_T sfmc_V_cellULowThrRec1;              /* 单体电压欠压1级故障恢复阈值 */
-extern const uint16_T sfmc_V_cellULowThrRec2;              /* 单体电压欠压2级故障恢复阈值 */
-extern const uint16_T sfmc_V_cellUOverThrFlt1;             /* 单体电压过压1级故障诊断阈值 */
-extern const uint16_T sfmc_V_cellUOverThrFlt2;             /* 单体电压过压2级故障诊断阈值 */
-extern const uint16_T sfmc_V_cellUOverThrRec1;             /* 单体电压过压1级故障恢复阈值 */
-extern const uint16_T sfmc_V_cellUOverThrRec2;             /* 单体电压过压2级故障恢复阈值 */
-extern const uint16_T sfmc_flg_cellUDiffThrFlt1;            /* 压差过大1级故障诊断阈值 */
-extern const uint16_T sfmc_flg_cellUDiffThrFlt2;            /* 压差过大2级故障诊断阈值 */
-extern const uint16_T sfmc_flg_cellUDiffThrRec1;            /* 压差过大1级故障恢复阈值 */
-extern const uint16_T sfmc_flg_cellUDiffThrRec2;            /* 压差过大2级故障恢复阈值 */
+extern const uint16_T sfmc_V_cellULowThrFlt2;        /* 单体电压欠压2级故障诊断阈值 */
+extern const uint16_T sfmc_V_cellULowThrRec1;        /* 单体电压欠压1级故障恢复阈值 */
+extern const uint16_T sfmc_V_cellULowThrRec2;        /* 单体电压欠压2级故障恢复阈值 */
+extern const uint16_T sfmc_V_cellUOverThrFlt1;       /* 单体电压过压1级故障诊断阈值 */
+extern const uint16_T sfmc_V_cellUOverThrFlt2;       /* 单体电压过压2级故障诊断阈值 */
+extern const uint16_T sfmc_V_cellUOverThrRec1;       /* 单体电压过压1级故障恢复阈值 */
+extern const uint16_T sfmc_V_cellUOverThrRec2;       /* 单体电压过压2级故障恢复阈值 */
+extern const uint16_T sfmc_flg_cellUDiffThrFlt1;     /* 压差过大1级故障诊断阈值 */
+extern const uint16_T sfmc_flg_cellUDiffThrFlt2;     /* 压差过大2级故障诊断阈值 */
+extern const uint16_T sfmc_flg_cellUDiffThrRec1;     /* 压差过大1级故障恢复阈值 */
+extern const uint16_T sfmc_flg_cellUDiffThrRec2;     /* 压差过大2级故障恢复阈值 */
 extern const uint16_T sfmc_T_disChrgMosTOverThrFlt1;
 extern const uint16_T sfmc_T_disChrgMosTOverThrRec1;
 extern const uint16_T sfmc_T_disChrgMosTOverThrFlt2;
 extern const uint16_T sfmc_T_disChrgMosTOverThrRec2;
 
-extern const uint16_T sohc_Q_countThr;                       /*                    */
-extern const uint16_T sohc_Q_updateDeltThr;                 /*                    */
+extern const uint16_T sohc_Q_countThr;      /*                    */
+extern const uint16_T sohc_Q_updateDeltThr; /*                    */
 extern const uint16_T sohc_pct_low;
 extern const uint16_T sohc_pct_up;
 
-
-extern const uint16_T socc_pct_battSocLow;                    /* SOC下限值; */
-extern const uint16_T socc_pct_battSocUp;                  /* SOC上限值; */
-extern const int16_T socm_I_chrgCor[4];   /* 充电CCV对应的电流数据; */
-extern const int16_T socm_I_disChrgCor[3]; /* 放电CCV对应的电流数据; */
-extern const uint16_T socm_V_chrgCor[4];/* 充电CCV对应的电压; */
+extern const uint16_T socc_pct_battSocLow;  /* SOC下限值; */
+extern const uint16_T socc_pct_battSocUp;   /* SOC上限值; */
+extern const int16_T socm_I_chrgCor[4];     /* 充电CCV对应的电流数据; */
+extern const int16_T socm_I_disChrgCor[3];  /* 放电CCV对应的电流数据; */
+extern const uint16_T socm_V_chrgCor[4];    /* 充电CCV对应的电压; */
 extern const uint16_T socm_V_disChrgCor[3]; /* 放电CCV对应的电压; */
 extern const uint16_T socc_pct_chrgCor;
 extern const uint16_T socc_pct_disChrgCor;
@@ -100,7 +99,6 @@ extern const int16_T cmm_T_ChrgCurr[3];
 extern const int16_T cmm_V_ChrgCurr[6];
 extern const int16_T cmm_I_ChrgCurr[3][6];
 
-extern const uint16_T tmsc_T_openThr;                         /* 热管理开启温度; */
-extern const uint16_T tmsc_T_closeMinThr;                     /* 热管理关闭温度(最低模组); */
-extern const uint16_T tmsc_T_closeMaxThr;                     /* 热管理开启温度(最高模组); */
-
+extern const uint16_T tmsc_T_openThr;     /* 热管理开启温度; */
+extern const uint16_T tmsc_T_closeMinThr; /* 热管理关闭温度(最低模组); */
+extern const uint16_T tmsc_T_closeMaxThr; /* 热管理开启温度(最高模组); */

+ 21 - 16
src/AppFunc.c

@@ -3,13 +3,14 @@
  * @Date         : 2021-11-09 12:08:17
  * @Version      : V3.0
  * @LastEditors  : ChenJie
- * @LastEditTime : 2021-11-12 18:25:36
+ * @LastEditTime : 2021-11-22 11:12:04
  * @Description  : file content
  * @FilePath     : \PLAT\project\ec616_0h00\apps\qx_app\src\AppFunc.c
  */
 #include "AppFunc.h"
 #include "numeric.h"
 #include "hal_module_adapter.h"
+#include "BCUDisp.h"
 /**
  * @brief : 保护板保护状态解码
  * @param {*}
@@ -828,21 +829,7 @@ BOOL uartBattInfoDecode(UINT8 *dataPtr)
 	printf("BattCellCount:%d,BATT_CELL_VOL_NUM:%d ", AppDataInfo.BattCellCount, BATT_CELL_VOL_NUM);
 	printf("BattTempCount:%d,BATT_TEMP_NUM:%d ", AppDataInfo.BattTempCount, BATT_TEMP_NUM);
 #endif
-	for (i = 0; i < BATT_CELL_VOL_NUM; i++)
-	{
-		battCellU[i] = (dataPtr[(0x02 + i) * 2] << 8) | dataPtr[(0x02 + i) * 2 + 1];
-		Battsumvoltage = Battsumvoltage + battCellU[i];
-	}
-	battWorkState = (dataPtr[(0x03 + BATT_CELL_VOL_NUM) * 2 + 1]) & 0x03; //电池状态(原始数据),0表示静置,1表示放电,2表示充电
-	TEMP_NUM = BATT_TEMP_NUM + BMS_OTHER_TEMP;
-	for (i = 0; i < BATT_TEMP_NUM; i++)
-	{
-		battCellTemp[i] = dataPtr[(0x06 + BATT_CELL_VOL_NUM + i) * 2 + 1];
-	}
-	avrgCellVol = Battsumvoltage / BATT_CELL_VOL_NUM;
-	MOSTemp = dataPtr[(0x06 + BATT_CELL_VOL_NUM + BATT_TEMP_NUM) * 2 + 1];
-	packTemp = dataPtr[(0x06 + BATT_CELL_VOL_NUM + BATT_TEMP_NUM + 1) * 2 + 1];
-	chargerConnectState = (dataPtr[(0x03 + BATT_CELL_VOL_NUM) * 2 + 1] >> 2) & 0x01; //充电器连接状态,0表示未连接,1表示已连接
+
 	Batt_current = (dataPtr[(0x02 + BATT_CELL_VOL_NUM) * 2] << 8) | (dataPtr[(0x02 + BATT_CELL_VOL_NUM) * 2 + 1]);
 	//原始数据:充电为负,放电为正
 	if (battWorkState == 0x02) //充电过程
@@ -879,6 +866,24 @@ BOOL uartBattInfoDecode(UINT8 *dataPtr)
 	}
 
 	battI = Batt_current * BattCurrentNegFlag + 0x2710;
+	INT16 BattI_Temp = 0;
+	BattI_Temp = Batt_current * BattCurrentNegFlag;
+	for (i = 0; i < BATT_CELL_VOL_NUM; i++)
+	{
+		battCellU[i] = ((dataPtr[(0x02 + i) * 2] << 8) | dataPtr[(0x02 + i) * 2 + 1]) + (INT16)(cmnm_R_voloffset[i] * BattI_Temp / 10000);
+		Battsumvoltage = Battsumvoltage + battCellU[i];
+	}
+	avrgCellVol = Battsumvoltage / BATT_CELL_VOL_NUM;
+	battWorkState = (dataPtr[(0x03 + BATT_CELL_VOL_NUM) * 2 + 1]) & 0x03; //电池状态(原始数据),0表示静置,1表示放电,2表示充电
+	TEMP_NUM = BATT_TEMP_NUM + BMS_OTHER_TEMP;
+	for (i = 0; i < BATT_TEMP_NUM; i++)
+	{
+		battCellTemp[i] = dataPtr[(0x06 + BATT_CELL_VOL_NUM + i) * 2 + 1];
+	}
+	MOSTemp = dataPtr[(0x06 + BATT_CELL_VOL_NUM + BATT_TEMP_NUM) * 2 + 1];
+	packTemp = dataPtr[(0x06 + BATT_CELL_VOL_NUM + BATT_TEMP_NUM + 1) * 2 + 1];
+	chargerConnectState = (dataPtr[(0x03 + BATT_CELL_VOL_NUM) * 2 + 1] >> 2) & 0x01; //充电器连接状态,0表示未连接,1表示已连接
+
 	//bit0 ~ bit31 represent cell0 ~ cell31
 	battBalanceoInfo = dataPtr[(0x06 + BATT_CELL_VOL_NUM + TEMP_NUM) * 2 + 1] | (dataPtr[(0x06 + BATT_CELL_VOL_NUM + TEMP_NUM) * 2] << 8) + (dataPtr[(0x07 + BATT_CELL_VOL_NUM + TEMP_NUM) * 2 + 1] << 16) | (dataPtr[(0x07 + BATT_CELL_VOL_NUM + TEMP_NUM) * 2] << 24);
 

+ 6 - 0
src/EmbeddedCoder_src/BCUCal.c

@@ -16,6 +16,12 @@ const uint16_T cmnm_R_polar[13] = {1837U, 1055U, 1352U, 1453U, 1181U, 1125U, 120
 const uint16_T cmnm_V_ocv[13] = {3234U, 3444U, 3476U, 3553U, 3610U, 3638U, 3674U, 3758U, 3845U, 3942U, 4051U, 4106U, 4175U};             /* 电池放电参数的OCV数组; */
 const uint16_T cmnm_pct_soc[13] = {0U, 50U, 100U, 200U, 300U, 400U, 500U, 600U, 700U, 800U, 900U, 950U, 1000U};                          /* 电池放电参数的SOC数组; */
 const uint16_T cmnc_V_chrgFul = 4200U;                                                                                                   /* 充满电的截至电压; */
+const uint16_T cmnm_R_voloffset[28] = {0, 0, 0, 0, 0,
+                                       0, 770, 0, 0, 0,
+                                       0, 0, 0, 540, 0,
+                                       0, 0, 0, 0, 0,
+                                       0, 0, 0, 0, 0,
+                                       0, 0, 0}; /*电压铜牌阻值补偿,单位moh*/
 
 const uint16_T sfmc_I_chrgCurrOverThr = 600;     /* 充电电流阈值 */
 const uint16_T sfmc_I_disChrgCurrOverThr = 600;  /* 放电电流阈值 */