BJQX-ZHENGCHAO\Zhengchao 1 rok temu
rodzic
commit
7530068c7f

+ 1 - 1
.cproject

@@ -30,7 +30,7 @@
 							<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="cdt.managedbuild.targetPlatform.gnu.cross.64147430" isAbstract="false" osList="all" superClass="cdt.managedbuild.targetPlatform.gnu.cross"/>
 							<builder buildPath="${workspace_loc:/S32K146_4G}/Debug_FLASH" id="com.freescale.s32ds.cross.gnu.builder.466747471" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="FSL Make Builder" superClass="com.freescale.s32ds.cross.gnu.builder"/>
 							<tool id="com.nxp.s32ds.cle.arm.mbs.arm32.bare.gnu.9.2.tool.c.compiler.1980082058" name="Standard S32DS C Compiler" superClass="com.nxp.s32ds.cle.arm.mbs.arm32.bare.gnu.9.2.tool.c.compiler">
-								<option defaultValue="gnu.c.optimization.level.none" id="gnu.c.compiler.option.optimization.level.1168627068" name="Optimization Level" superClass="gnu.c.compiler.option.optimization.level" useByScannerDiscovery="false" value="gnu.c.optimization.level.size" valueType="enumerated"/>
+								<option defaultValue="gnu.c.optimization.level.none" id="gnu.c.compiler.option.optimization.level.1168627068" name="Optimization Level" superClass="gnu.c.compiler.option.optimization.level" useByScannerDiscovery="false" value="gnu.c.optimization.level.none" valueType="enumerated"/>
 								<option defaultValue="gnu.c.debugging.level.max" id="gnu.c.compiler.option.debugging.level.1120041103" name="Debug Level" superClass="gnu.c.compiler.option.debugging.level" useByScannerDiscovery="false" value="gnu.c.debugging.level.max" valueType="enumerated"/>
 								<option id="com.freescale.s32ds.cross.gnu.tool.c.compiler.option.optimization.functionsections.1916093778" name="Function sections (-ffunction-sections)" superClass="com.freescale.s32ds.cross.gnu.tool.c.compiler.option.optimization.functionsections" useByScannerDiscovery="true" value="false" valueType="boolean"/>
 								<option id="com.freescale.s32ds.cross.gnu.tool.c.compiler.option.optimization.datasections.499071697" name="Data sections (-fdata-sections)" superClass="com.freescale.s32ds.cross.gnu.tool.c.compiler.option.optimization.datasections" useByScannerDiscovery="true" value="false" valueType="boolean"/>

+ 2 - 2
Project_Settings/Debugger/S32K146_4G_Debug_FLASH_PNE.launch

@@ -77,7 +77,7 @@
 <booleanAttribute key="com.pemicro.debug.gdbjtag.pne.cyc_usb.STARTUP_USE_SWD" value="true"/>
 <booleanAttribute key="com.pemicro.debug.gdbjtag.pne.doContinue" value="true"/>
 <booleanAttribute key="com.pemicro.debug.gdbjtag.pne.doGdbServerAllocateSemihostingConsole" value="true"/>
-<booleanAttribute key="com.pemicro.debug.gdbjtag.pne.doPartitioning" value="false"/>
+<booleanAttribute key="com.pemicro.debug.gdbjtag.pne.doPartitioning" value="true"/>
 <booleanAttribute key="com.pemicro.debug.gdbjtag.pne.enableSemihosting" value="true"/>
 <booleanAttribute key="com.pemicro.debug.gdbjtag.pne.enableSemihostingIoclientGdbClient" value="false"/>
 <booleanAttribute key="com.pemicro.debug.gdbjtag.pne.enableSemihostingIoclientTelnet" value="true"/>
@@ -112,7 +112,7 @@
 <stringAttribute key="com.pemicro.debug.gdbjtag.pne.ml.SWO_BAUDRATE_SWITCH_MULTILINK_VALUE" value="-1.000000"/>
 <stringAttribute key="com.pemicro.debug.gdbjtag.pne.ml.SWO_BAUDRATE_SWITCH_TARGET_VALUE" value="-1.000000"/>
 <stringAttribute key="com.pemicro.debug.gdbjtag.pne.otherRunCommands" value=""/>
-<intAttribute key="com.pemicro.debug.gdbjtag.pne.partitionParam" value="0"/>
+<intAttribute key="com.pemicro.debug.gdbjtag.pne.partitionParam" value="523"/>
 <booleanAttribute key="com.pemicro.debug.gdbjtag.pne.preserveMemory0" value="false"/>
 <booleanAttribute key="com.pemicro.debug.gdbjtag.pne.preserveMemory1" value="false"/>
 <booleanAttribute key="com.pemicro.debug.gdbjtag.pne.preserveMemory2" value="false"/>

+ 12 - 17
Project_Settings/Linker_Files/linker_flash_s32k146.ld

@@ -31,18 +31,13 @@
 
 MEMORY
 {         
-    int_flash_interrupts    : ORIGIN = 0x00014200, LENGTH = 0x00000400    /* 1K */    /* Do not change this section */
-   /* int_flash_config        : ORIGIN = 0x00000400, LENGTH = 0x00000010    /* 16bytes */ /* Do not change this section */
-     int_flash               : ORIGIN = 0x00014600, LENGTH = 0x000EBA00    /* ~1.0MB */ 
-/*	int_flash_interrupts    : ORIGIN = 0x00080200, LENGTH = 0x00000400	/**/
-/*	int_flash               : ORIGIN = 0x00080600, LENGTH = 0x0007FA00	/**/
-	
-	m_flexram				: ORIGIN = 0x14000000, LENGTH = 0x00001000	
+    int_flash_interrupts    : ORIGIN = 0x00000000, LENGTH = 0x00000400    /* 1K */    /* Do not change this section */
+    int_flash_config        : ORIGIN = 0x00000400, LENGTH = 0x00000010    /* 16bytes */ /* Do not change this section */
+    int_flash               : ORIGIN = 0x00000410, LENGTH = 0x000FFBF0    /* ~1.0MB */ 
     int_sram_results        : ORIGIN = 0x1FFF0000, LENGTH = 0x00000100    /* 256bytes */
     int_sram                : ORIGIN = 0x1FFF0100, LENGTH = 0x0001DF00    /* ~120K */
-    int_sram_stack_c0       : ORIGIN = 0x2000E000, LENGTH = 0x00001000 - 0x10    /* 4K  */
-    ram_rsvd2               : ORIGIN = 0x2000EFF0, LENGTH = 0             /* End of SRAM */
-    ExchangeInfo            : ORIGIN = 0x2000EFF0, LENGTH = 0x10          
+    int_sram_stack_c0       : ORIGIN = 0x2000E000, LENGTH = 0x00001000    /* 4K  */
+    ram_rsvd2               : ORIGIN = 0x2000F000, LENGTH = 0             /* End of SRAM */
 }
 
 
@@ -56,19 +51,20 @@ SECTIONS
    {						
     	*(.eeprom)			
     } >m_flexram			
+    
 	.flash_interrupts :
 	{
-		. = ALIGN(512);
+		. = ALIGN(4096);
         __interrupts_rom_start = .;
         KEEP(*(.intc_vector))    
-        . = ALIGN(512);
+        . = ALIGN(4);
         __interrupts_rom_end = .;
 	} > int_flash_interrupts
 	
-/*	.flash_config :				*/
-/*	{							*/
-/*		KEEP(*(.flash_config))	*/
-/*	} > int_flash_config		*/
+	.flash_config :
+	{
+		KEEP(*(.flash_config))
+	} > int_flash_config
 	
 	.flash :
 	{
@@ -115,7 +111,6 @@ SECTIONS
 		__DATA_ROM = .;
 	} > int_flash
     
-    
     . = ALIGN(4);
     PROVIDE(__exidx_start = .);
     .ARM.exidx :

+ 17 - 12
Project_Settings/Linker_Files/linker_flash_s32k146.ldfls → Project_Settings/Linker_Files/linker_flash_s32k146.ldota

@@ -31,13 +31,18 @@
 
 MEMORY
 {         
-    int_flash_interrupts    : ORIGIN = 0x00000000, LENGTH = 0x00000400    /* 1K */    /* Do not change this section */
-    int_flash_config        : ORIGIN = 0x00000400, LENGTH = 0x00000010    /* 16bytes */ /* Do not change this section */
-    int_flash               : ORIGIN = 0x00000410, LENGTH = 0x000FFBF0    /* ~1.0MB */ 
+    int_flash_interrupts    : ORIGIN = 0x00014200, LENGTH = 0x00000400    /* 1K */    /* Do not change this section */
+   /* int_flash_config        : ORIGIN = 0x00000400, LENGTH = 0x00000010    /* 16bytes */ /* Do not change this section */
+     int_flash               : ORIGIN = 0x00014600, LENGTH = 0x000EBA00    /* ~1.0MB */ 
+/*	int_flash_interrupts    : ORIGIN = 0x00080200, LENGTH = 0x00000400	/**/
+/*	int_flash               : ORIGIN = 0x00080600, LENGTH = 0x0007FA00	/**/
+	
+	m_flexram				: ORIGIN = 0x14000000, LENGTH = 0x00001000	
     int_sram_results        : ORIGIN = 0x1FFF0000, LENGTH = 0x00000100    /* 256bytes */
     int_sram                : ORIGIN = 0x1FFF0100, LENGTH = 0x0001DF00    /* ~120K */
-    int_sram_stack_c0       : ORIGIN = 0x2000E000, LENGTH = 0x00001000    /* 4K  */
-    ram_rsvd2               : ORIGIN = 0x2000F000, LENGTH = 0             /* End of SRAM */
+    int_sram_stack_c0       : ORIGIN = 0x2000E000, LENGTH = 0x00001000 - 0x10    /* 4K  */
+    ram_rsvd2               : ORIGIN = 0x2000EFF0, LENGTH = 0             /* End of SRAM */
+    ExchangeInfo            : ORIGIN = 0x2000EFF0, LENGTH = 0x10          
 }
 
 
@@ -51,20 +56,19 @@ SECTIONS
    {						
     	*(.eeprom)			
     } >m_flexram			
-    
 	.flash_interrupts :
 	{
-		. = ALIGN(4096);
+		. = ALIGN(512);
         __interrupts_rom_start = .;
         KEEP(*(.intc_vector))    
-        . = ALIGN(4);
+        . = ALIGN(512);
         __interrupts_rom_end = .;
 	} > int_flash_interrupts
 	
-	.flash_config :
-	{
-		KEEP(*(.flash_config))
-	} > int_flash_config
+/*	.flash_config :				*/
+/*	{							*/
+/*		KEEP(*(.flash_config))	*/
+/*	} > int_flash_config		*/
 	
 	.flash :
 	{
@@ -111,6 +115,7 @@ SECTIONS
 		__DATA_ROM = .;
 	} > int_flash
     
+    
     . = ALIGN(4);
     PROVIDE(__exidx_start = .);
     .ARM.exidx :

+ 9 - 3
code/BCU/BBox_Bcu.c

@@ -32,6 +32,7 @@ void BBox_BCU_Task(void *pvParameters)
         {
 			if (TimerCounter % 100 == 0)
 			{
+				IH_Data_Update();
 				/*
 				bswv_V_cellU = 0;
 				bswv_T_modT = 0;
@@ -47,14 +48,19 @@ void BBox_BCU_Task(void *pvParameters)
 				ihd_I_battCurr_T1 = 0;
 				ihd_V_battU_T1 = 0;
 				*/
-				BCU_step();
+//				Dio_WriteChannel(DioConf_DioChannel_PTE7_GPIO_OUT_MCU_LED3, STD_OFF);
+//				BCU_step();
 				//
 				if (socd_flg_EEsave == 1)
 				{
 					BCUEEDataSave();
 				}
+//				Dio_WriteChannel(DioConf_DioChannel_PTE7_GPIO_OUT_MCU_LED3, STD_ON);
+				OH_Data_Update();
 			}
-			vTaskDelay(10);
+
+			vTaskDelay(pdMS_TO_TICKS(10));
+
             break;
         }
         default:
@@ -73,7 +79,7 @@ void BBox_BCU_Task(void *pvParameters)
 
 void BCUEEDataRead(void)
 {
-	memcpy(rtev_flg_EESt, 0, sizeof(rtev_flg_EESt));
+	memset(rtev_flg_EESt, 0, sizeof(rtev_flg_EESt));
     //时间
 	ihd_tm_yearEi =    BcuAppSaveDataInfo.ihd_tm_yearE;
 	ihd_tm_monthEi =    BcuAppSaveDataInfo.ihd_tm_monthE;

+ 0 - 1
code/BCU/BCUModel/BCU.c

@@ -9,7 +9,6 @@
 #define SOC_MDLREF_HIDE_CHILD_
 #include "SOC.h"
 
-ExtU_BCU_T BCU_U;
 static RT_MODEL_BCU_T BCU_M_;
 RT_MODEL_BCU_T *const BCU_M = &BCU_M_;
 void BCU_step(void)

+ 0 - 5
code/BCU/BCUModel/BCU.h

@@ -25,15 +25,10 @@
 #define rtmGetErrorStatusPointer(rtm)  ((const char_T **)(&((rtm)->errorStatus)))
 #endif
 
-typedef struct {
-  real32_T ihd_pct_socCor;
-} ExtU_BCU_T;
-
 struct tag_RTM_BCU_T {
   const char_T *errorStatus;
 };
 
-extern ExtU_BCU_T BCU_U;
 extern void BCU_initialize(void);
 extern void BCU_step(void);
 extern void BCU_terminate(void);

+ 1 - 1
code/BCU/BCUModel/BCUCal.c

@@ -3,7 +3,7 @@
 #include "zero_crossing_types.h"
 #include "BCU_types.h"
 
-const real32_T cmnc_Q_ratedCp = 237.0F;
+const real32_T cmnc_Q_ratedCp = 228.0F;
 const real32_T cmnc_V_chrgLim = 3.65F;
 const uint16_T cmnc_tm_parkTime = 1800U;
 const real32_T cmnm_V_ocv[13] = { 3.018F, 3.2036F, 3.2097F, 3.2576F, 3.2883F,

+ 5 - 2
code/BCU/BCUModel/BCUDisp.c

@@ -48,6 +48,7 @@ real32_T ihd_V_battU_T2;
 real32_T ihd_V_cellUAvrg;
 real32_T ihd_V_cellUMax;
 real32_T ihd_V_cellUMin;
+real32_T ihd_pct_socCor;
 uint8_T ihd_tm_dayEi;
 uint8_T ihd_tm_dayEo;
 uint8_T ihd_tm_hourEi;
@@ -62,14 +63,16 @@ uint8_T ihd_tm_secEi;
 uint8_T ihd_tm_secEo;
 uint8_T ihd_tm_yearEi;
 uint8_T ihd_tm_yearEo;
-boolean_T ihv_flg_EESt[10];
+boolean_T ihv_flg_EESt[4];
 uint8_T rted_tm_day;
 uint8_T rted_tm_hour;
 uint8_T rted_tm_min;
 uint8_T rted_tm_month;
 uint8_T rted_tm_sec;
 uint8_T rted_tm_year;
-boolean_T rtev_flg_EESt[10];
+boolean_T rtev_flg_EESt[4];
+real32_T socd_Q_dMax;
+real32_T socd_Q_dMin;
 boolean_T socd_flg_EEsave;
 real32_T socd_pct_ahSoc;
 real32_T socd_pct_battSoc;

+ 5 - 2
code/BCU/BCUModel/BCUDisp.h

@@ -59,6 +59,7 @@ extern real32_T ihd_V_battU_T2;
 extern real32_T ihd_V_cellUAvrg;
 extern real32_T ihd_V_cellUMax;
 extern real32_T ihd_V_cellUMin;
+extern real32_T ihd_pct_socCor;
 extern uint8_T ihd_tm_dayEi;
 extern uint8_T ihd_tm_dayEo;
 extern uint8_T ihd_tm_hourEi;
@@ -73,14 +74,16 @@ extern uint8_T ihd_tm_secEi;
 extern uint8_T ihd_tm_secEo;
 extern uint8_T ihd_tm_yearEi;
 extern uint8_T ihd_tm_yearEo;
-extern boolean_T ihv_flg_EESt[10];
+extern boolean_T ihv_flg_EESt[4];
 extern uint8_T rted_tm_day;
 extern uint8_T rted_tm_hour;
 extern uint8_T rted_tm_min;
 extern uint8_T rted_tm_month;
 extern uint8_T rted_tm_sec;
 extern uint8_T rted_tm_year;
-extern boolean_T rtev_flg_EESt[10];
+extern boolean_T rtev_flg_EESt[4];
+extern real32_T socd_Q_dMax;
+extern real32_T socd_Q_dMin;
 extern boolean_T socd_flg_EEsave;
 extern real32_T socd_pct_ahSoc;
 extern real32_T socd_pct_battSoc;

+ 4 - 4
code/BCU/BCUModel/IH100.c

@@ -9,7 +9,6 @@ B_IH100_c_T IH100_B;
 DW_IH100_f_T IH100_DW;
 void IH100(uint16_T *rty_ihd_tm_parkTime)
 {
-  int32_T i;
   ihd_tm_yearEo = rted_tm_year;
   ihd_tm_monthEo = rted_tm_month;
   ihd_tm_dayEo = rted_tm_day;
@@ -86,9 +85,10 @@ void IH100(uint16_T *rty_ihd_tm_parkTime)
 
   IH100_DW.UnitDelay1_DSTATE++;
   ihd_tm_realTime = IH100_DW.UnitDelay1_DSTATE / 10U + IH100_B.Add1;
-  for (i = 0; i < 10; i++) {
-    ihv_flg_EESt[i] = rtev_flg_EESt[i];
-  }
+  ihv_flg_EESt[0] = rtev_flg_EESt[0];
+  ihv_flg_EESt[1] = rtev_flg_EESt[1];
+  ihv_flg_EESt[2] = rtev_flg_EESt[2];
+  ihv_flg_EESt[3] = rtev_flg_EESt[3];
 }
 
 void IH100_initialize(const char_T **rt_errorStatus)

Plik diff jest za duży
+ 317 - 567
code/BCU/BCUModel/SOC.c


+ 26 - 40
code/BCU/BCUModel/SOC.h

@@ -32,10 +32,6 @@ typedef struct {
 #ifndef SOC_MDLREF_HIDE_CHILD_
 
 typedef struct {
-  real_T AhArr[301];
-  real_T deltaAh[303];
-  real_T AhArr_p[301];
-  real_T deltaAh_p[303];
   real32_T in1;
   real32_T in2;
   real32_T in1_i;
@@ -45,6 +41,7 @@ typedef struct {
   real32_T Switch1;
   real32_T Switch;
   real32_T Divide;
+  boolean_T LogicalOperator_j;
 } B_SOC_c_T;
 
 #endif
@@ -58,64 +55,56 @@ typedef struct {
   real32_T Delay_DSTATE;
   real32_T Delay_DSTATE_l;
   real32_T Delay1_DSTATE;
+  real32_T P_Delay_DSTATE[4];
+  real32_T Delay2_DSTATE;
+  real32_T Delay1_DSTATE_a;
+  real32_T P_Delay_DSTATE_k[4];
+  real32_T Delay2_DSTATE_k;
+  real32_T Delay1_DSTATE_n;
   real32_T socd_pct_battSoc0_Delay_DSTATE;
   real32_T socd_pct_bcuSoc0_Delay_DSTATE;
   real32_T socd_flg_EEsave_Delay_DSTATE;
   real32_T socd_flg_EEsave_Delay1_DSTATE;
+  real32_T UnitDelay1_DSTATE;
+  real32_T UnitDelay_DSTATE_o;
+  real32_T UnitDelay1_DSTATE_h;
+  real32_T Delay_DSTATE_f[10];
+  real32_T UnitDelay_DSTATE_i;
+  real32_T UnitDelay2_DSTATE;
+  real32_T UnitDelay3_DSTATE;
+  real32_T UnitDelay1_DSTATE_a;
+  real32_T Delay_DSTATE_lp[10];
   real32_T Delay_DSTATE_h;
   real32_T Delay_DSTATE_h0;
   real32_T UnitDelay_DSTATE_b;
-  real32_T Delay_DSTATE_ho[2];
-  real32_T P_Delay_DSTATE[4];
-  real32_T Delay_DSTATE_k[2];
-  real32_T P_Delay_DSTATE_k[4];
-  real32_T UnitDelay_DSTATE_a;
-  real32_T Delay_DSTATE_d;
-  real32_T Delay1_DSTATE_f;
-  real32_T P_Delay_DSTATE_p[4];
-  real32_T Delay_DSTATE_j;
-  real32_T Delay1_DSTATE_c;
-  real32_T P_Delay_DSTATE_g[4];
   real32_T Divide_DWORK4;
-  real32_T Divide_DWORK4_a;
-  real32_T Divide_DWORK4_h;
-  real32_T Divide_DWORK4_m;
+  real32_T Divide_DWORK4_l;
   uint16_T UnitDelay_DSTATE_n;
   uint16_T UnitDelay_DSTATE_m;
   uint16_T UnitDelay_DSTATE_p;
-  uint16_T UnitDelay_DSTATE_o;
+  uint16_T UnitDelay_DSTATE_ol;
   uint16_T UnitDelay_DSTATE_o2;
   uint16_T UnitDelay_DSTATE_dx;
   uint16_T UnitDelay_DSTATE_h;
-  uint16_T UnitDelay1_DSTATE;
-  uint16_T UnitDelay2_DSTATE;
-  uint16_T UnitDelay4_DSTATE;
-  uint16_T idx1;
-  uint16_T idx2;
-  uint16_T k;
-  uint16_T idx1_o;
-  uint16_T idx2_h;
-  uint16_T k_f;
+  uint16_T UnitDelay5_DSTATE;
+  uint16_T UnitDelay5_DSTATE_k;
   boolean_T UnitDelay_DSTATE_ca;
   boolean_T UnitDelay_DSTATE_f;
   boolean_T UnitDelay_DSTATE_fs;
   boolean_T UnitDelay_DSTATE_e;
-  chrgSt Delay2_DSTATE;
+  chrgSt Delay2_DSTATE_b;
   int8_T If_ActiveSubsystem;
-  int8_T If_ActiveSubsystem_a;
   int8_T If_ActiveSubsystem_j;
   boolean_T icLoad;
   boolean_T icLoad_j;
+  boolean_T icLoad_o;
+  boolean_T icLoad_i;
+  boolean_T icLoad_p;
+  boolean_T icLoad_a;
   boolean_T icLoad_l;
   boolean_T icLoad_m;
   boolean_T icLoad_n;
   boolean_T icLoad_g;
-  boolean_T icLoad_lr;
-  boolean_T icLoad_o;
-  boolean_T icLoad_e;
-  boolean_T icLoad_d;
-  boolean_T icLoad_gk;
-  boolean_T icLoad_j0;
 } DW_SOC_f_T;
 
 #endif
@@ -148,10 +137,7 @@ typedef struct {
   const real_T Add_m;
   const real_T Add_i;
   const real32_T Add4;
-  const real32_T Add4_g;
-  const real32_T Add4_i;
-  const real32_T Add4_f;
-  const boolean_T RelationalOperator;
+  const real32_T Add4_j;
 } ConstB_SOC_h_T;
 
 #endif

+ 1 - 4
code/BCU/BCUModel/SOC_data.c

@@ -6,8 +6,5 @@ const ConstB_SOC_h_T SOC_ConstB = {
   4.0,
   256.0,
   0.02F,
-  0.02F,
-  0.02F,
-  0.02F,
-  1
+  0.02F
 };

+ 0 - 63
code/BCU/BCUModel/SOC_private.h

@@ -5,53 +5,6 @@
 #include "BCUDisp.h"
 #include "SOC.h"
 #include "SOC_types.h"
-#ifndef UCHAR_MAX
-#include <limits.h>
-#endif
-
-#if ( UCHAR_MAX != (0xFFU) ) || ( SCHAR_MAX != (0x7F) )
-#error Code was generated for compiler with different sized uchar/char. \
-Consider adjusting Test hardware word size settings on the \
-Hardware Implementation pane to match your compiler word sizes as \
-defined in limits.h of the compiler. Alternatively, you can \
-select the Test hardware is the same as production hardware option and \
-select the Enable portable word sizes option on the Code Generation > \
-Verification pane for ERT based targets, which will disable the \
-preprocessor word size checks.
-#endif
-
-#if ( USHRT_MAX != (0xFFFFU) ) || ( SHRT_MAX != (0x7FFF) )
-#error Code was generated for compiler with different sized ushort/short. \
-Consider adjusting Test hardware word size settings on the \
-Hardware Implementation pane to match your compiler word sizes as \
-defined in limits.h of the compiler. Alternatively, you can \
-select the Test hardware is the same as production hardware option and \
-select the Enable portable word sizes option on the Code Generation > \
-Verification pane for ERT based targets, which will disable the \
-preprocessor word size checks.
-#endif
-
-#if ( UINT_MAX != (0xFFFFFFFFU) ) || ( INT_MAX != (0x7FFFFFFF) )
-#error Code was generated for compiler with different sized uint/int. \
-Consider adjusting Test hardware word size settings on the \
-Hardware Implementation pane to match your compiler word sizes as \
-defined in limits.h of the compiler. Alternatively, you can \
-select the Test hardware is the same as production hardware option and \
-select the Enable portable word sizes option on the Code Generation > \
-Verification pane for ERT based targets, which will disable the \
-preprocessor word size checks.
-#endif
-
-#if ( ULONG_MAX != (0xFFFFFFFFU) ) || ( LONG_MAX != (0x7FFFFFFF) )
-#error Code was generated for compiler with different sized ulong/long. \
-Consider adjusting Test hardware word size settings on the \
-Hardware Implementation pane to match your compiler word sizes as \
-defined in limits.h of the compiler. Alternatively, you can \
-select the Test hardware is the same as production hardware option and \
-select the Enable portable word sizes option on the Code Generation > \
-Verification pane for ERT based targets, which will disable the \
-preprocessor word size checks.
-#endif
 
 #ifndef rtmGetErrorStatus
 #define rtmGetErrorStatus(rtm)         (*((rtm)->errorStatus))
@@ -69,22 +22,6 @@ preprocessor word size checks.
 #define rtmSetErrorStatusPointer(rtm, val) ((rtm)->errorStatus = (val))
 #endif
 
-extern const real32_T rtCP_pooled_PWCN3PI6SKtV[13];
-extern const real32_T rtCP_pooled_xXediYsBLvOR[13];
-extern const real32_T rtCP_pooled_5zAQrHz9BfRv[13];
-extern const real32_T rtCP_pooled_oEA0O8An4j2c[13];
-extern const uint16_T rtCP_pooled_NGeZA8FCL6Al[301];
-
-#define rtCP_uDLookupTable2_tableData  rtCP_pooled_PWCN3PI6SKtV
-#define rtCP_uDLookupTable3_tableData  rtCP_pooled_xXediYsBLvOR
-#define rtCP_uDLookupTable5_tableData  rtCP_pooled_5zAQrHz9BfRv
-#define rtCP_uDLookupTable4_tableData  rtCP_pooled_oEA0O8An4j2c
-#define rtCP_uDLookupTable2_tableData_o rtCP_pooled_PWCN3PI6SKtV
-#define rtCP_uDLookupTable3_tableData_d rtCP_pooled_xXediYsBLvOR
-#define rtCP_uDLookupTable5_tableData_f rtCP_pooled_5zAQrHz9BfRv
-#define rtCP_uDLookupTable4_tableData_a rtCP_pooled_oEA0O8An4j2c
-#define rtCP_Constant5_Value_f         rtCP_pooled_NGeZA8FCL6Al
-
 extern const ConstB_SOC_h_T SOC_ConstB;
 
 #endif

+ 0 - 51
code/BCU/BCUModel/const_params.c

@@ -4,61 +4,10 @@ extern const uint16_T rtCP_pooled_38ieQigmLwUn[12];
 const uint16_T rtCP_pooled_38ieQigmLwUn[12] = { 0U, 31U, 59U, 90U, 120U, 151U,
   181U, 212U, 243U, 273U, 304U, 334U } ;
 
-extern const real32_T rtCP_pooled_5zAQrHz9BfRv[13];
-const real32_T rtCP_pooled_5zAQrHz9BfRv[13] = { 39.0948F, 21.5908051F,
-  21.3452168F, 18.6239891F, 16.1059246F, 16.5651855F, 17.7142353F, 18.5940838F,
-  15.3873701F, 17.5136662F, 18.7477512F, 24.3475819F, 31.4556694F } ;
-
 extern const uint8_T rtCP_pooled_Gh9RpM5of8Do[12];
 const uint8_T rtCP_pooled_Gh9RpM5of8Do[12] = { 0U, 1U, 2U, 3U, 4U, 5U, 6U, 7U,
   8U, 9U, 10U, 11U } ;
 
-extern const uint16_T rtCP_pooled_NGeZA8FCL6Al[301];
-const uint16_T rtCP_pooled_NGeZA8FCL6Al[301] = { 3350U, 3351U, 3352U, 3353U,
-  3354U, 3355U, 3356U, 3357U, 3358U, 3359U, 3360U, 3361U, 3362U, 3363U, 3364U,
-  3365U, 3366U, 3367U, 3368U, 3369U, 3370U, 3371U, 3372U, 3373U, 3374U, 3375U,
-  3376U, 3377U, 3378U, 3379U, 3380U, 3381U, 3382U, 3383U, 3384U, 3385U, 3386U,
-  3387U, 3388U, 3389U, 3390U, 3391U, 3392U, 3393U, 3394U, 3395U, 3396U, 3397U,
-  3398U, 3399U, 3400U, 3401U, 3402U, 3403U, 3404U, 3405U, 3406U, 3407U, 3408U,
-  3409U, 3410U, 3411U, 3412U, 3413U, 3414U, 3415U, 3416U, 3417U, 3418U, 3419U,
-  3420U, 3421U, 3422U, 3423U, 3424U, 3425U, 3426U, 3427U, 3428U, 3429U, 3430U,
-  3431U, 3432U, 3433U, 3434U, 3435U, 3436U, 3437U, 3438U, 3439U, 3440U, 3441U,
-  3442U, 3443U, 3444U, 3445U, 3446U, 3447U, 3448U, 3449U, 3450U, 3451U, 3452U,
-  3453U, 3454U, 3455U, 3456U, 3457U, 3458U, 3459U, 3460U, 3461U, 3462U, 3463U,
-  3464U, 3465U, 3466U, 3467U, 3468U, 3469U, 3470U, 3471U, 3472U, 3473U, 3474U,
-  3475U, 3476U, 3477U, 3478U, 3479U, 3480U, 3481U, 3482U, 3483U, 3484U, 3485U,
-  3486U, 3487U, 3488U, 3489U, 3490U, 3491U, 3492U, 3493U, 3494U, 3495U, 3496U,
-  3497U, 3498U, 3499U, 3500U, 3501U, 3502U, 3503U, 3504U, 3505U, 3506U, 3507U,
-  3508U, 3509U, 3510U, 3511U, 3512U, 3513U, 3514U, 3515U, 3516U, 3517U, 3518U,
-  3519U, 3520U, 3521U, 3522U, 3523U, 3524U, 3525U, 3526U, 3527U, 3528U, 3529U,
-  3530U, 3531U, 3532U, 3533U, 3534U, 3535U, 3536U, 3537U, 3538U, 3539U, 3540U,
-  3541U, 3542U, 3543U, 3544U, 3545U, 3546U, 3547U, 3548U, 3549U, 3550U, 3551U,
-  3552U, 3553U, 3554U, 3555U, 3556U, 3557U, 3558U, 3559U, 3560U, 3561U, 3562U,
-  3563U, 3564U, 3565U, 3566U, 3567U, 3568U, 3569U, 3570U, 3571U, 3572U, 3573U,
-  3574U, 3575U, 3576U, 3577U, 3578U, 3579U, 3580U, 3581U, 3582U, 3583U, 3584U,
-  3585U, 3586U, 3587U, 3588U, 3589U, 3590U, 3591U, 3592U, 3593U, 3594U, 3595U,
-  3596U, 3597U, 3598U, 3599U, 3600U, 3601U, 3602U, 3603U, 3604U, 3605U, 3606U,
-  3607U, 3608U, 3609U, 3610U, 3611U, 3612U, 3613U, 3614U, 3615U, 3616U, 3617U,
-  3618U, 3619U, 3620U, 3621U, 3622U, 3623U, 3624U, 3625U, 3626U, 3627U, 3628U,
-  3629U, 3630U, 3631U, 3632U, 3633U, 3634U, 3635U, 3636U, 3637U, 3638U, 3639U,
-  3640U, 3641U, 3642U, 3643U, 3644U, 3645U, 3646U, 3647U, 3648U, 3649U, 3650U } ;
-
-extern const real32_T rtCP_pooled_PWCN3PI6SKtV[13];
-const real32_T rtCP_pooled_PWCN3PI6SKtV[13] = { 2.9601F, 3.2158F, 3.2276F,
-  3.2826F, 3.3049F, 3.3059F, 3.3079F, 3.319F, 3.3415F, 3.341F, 3.3395F, 3.3385F,
-  3.4F } ;
-
 extern const uint16_T rtCP_pooled_bGtbEevhgRDy[12];
 const uint16_T rtCP_pooled_bGtbEevhgRDy[12] = { 0U, 31U, 60U, 91U, 121U, 152U,
   182U, 213U, 244U, 274U, 305U, 335U } ;
-
-extern const real32_T rtCP_pooled_oEA0O8An4j2c[13];
-const real32_T rtCP_pooled_oEA0O8An4j2c[13] = { 1.390625F, 0.553403735F,
-  0.555566311F, 0.488408864F, 0.471825957F, 0.5160864F, 0.580782056F,
-  0.65997988F, 0.57442838F, 0.667438686F, 0.799259F, 1.06011963F, 1.36369705F } ;
-
-extern const real32_T rtCP_pooled_xXediYsBLvOR[13];
-const real32_T rtCP_pooled_xXediYsBLvOR[13] = { 0.290831238F, 0.277362019F,
-  0.276512295F, 0.273136497F, 0.267234594F, 0.266811758F, 0.266827792F,
-  0.265981555F, 0.263857156F, 0.265984416F, 0.265129417F, 0.265543342F,
-  0.265971273F } ;

+ 7 - 3
code/app/AppGlobalVar.c

@@ -16,7 +16,7 @@
 
 #include "AppGlobalVar.h"
 
-#define defaultSn "ZLTEST00000000001"
+#define defaultSn "ZLTEST00000000002"
 
 #define APP_RELEASE
 
@@ -25,7 +25,7 @@ const char WebSiteName[] = "\"iotp.fast-fun.cn\"";
 uint16 WebSitePort = 8712;
 #define EEP_START_SEC_VAR_INIT_8_NO_CACHEABLE
 #include "Eep_MemMap.h"
-AppConfigBody AppConfigInfo = {false, false, {defaultSn}, {0}};
+AppConfigBody AppConfigInfo = {false, true, {defaultSn}, {0}};
 BcuAppSaveBody BcuAppSaveDataInfo = {0};
 #define EEP_STOP_SEC_VAR_INIT_8_NO_CACHEABLE
 #include "Eep_MemMap.h"
@@ -35,6 +35,7 @@ uint16 WebSitePort = 8812;
 #define EEP_START_SEC_VAR_INIT_8_NO_CACHEABLE
 #include "Eep_MemMap.h"
 AppConfigBody AppConfigInfo = {false, true, {defaultSn}, {0}};
+BcuAppSaveBody BcuAppSaveDataInfo = {0};
 #define EEP_STOP_SEC_VAR_INIT_8_NO_CACHEABLE
 #include "Eep_MemMap.h"
 #endif
@@ -337,9 +338,12 @@ UINT8 BBox_PackSOC = 0x00;						//BBox计算SOC,Re-0.4,Off-0;
 UINT8 BBox_PackSOH = 0x00;						//BBox计算SOH,Re-1,Off-0;
 UINT32 BBox_TotalDischarCapy = 0x00;			//BBox计算累计放电Ah,Re-0.1,Off-0,Ah
 UINT32 BBox_TotalCharCapy = 0x00;				//BBox计算累计充电Ah,Re-0.1,Off-0,Ah
+UINT32 BBox_TotalBackCharCapy = 0x00;			//BBox计算累计动能回收Ah,Re-0.1,Off-0,Ah
 UINT32 BBox_TotalDischarEngy = 0x00;			//BBox计算累计放电能量,Re-0.1,Off-0,Kwh
 UINT32 BBox_TotalCharEngy = 0x00;				//BBox计算累计充电能量,Re-0.1,Off-0,Kwh
-UINT32 BBox_DV_DQ = 0x00;						//BBox计算dv/dq,Re-0.001,Off-0,Ah/10mV
+UINT32 BBox_TotalBackCharEngy = 0x00;			//BBox计算累计动能回收能量,Re-0.1,Off-0,Kwh
+UINT32 BBox_Dq_Dv_MAX = 0x00;					//BBox计算dq/dv_MAX,Re-0.001,Off-0,Ah/10mV
+UINT32 BBox_Dq_Dv_MIN = 0x00;					//BBox计算dq/dv_MIN,Re-0.001,Off-0,Ah/10mV
 
 
 #endif

+ 4 - 1
code/app/AppGlobalVar.h

@@ -337,8 +337,11 @@ extern UINT8 BBox_PackSOC;
 extern UINT8 BBox_PackSOH;
 extern UINT32 BBox_TotalDischarCapy;
 extern UINT32 BBox_TotalCharCapy;
+extern UINT32 BBox_TotalBackCharCapy;
 extern UINT32 BBox_TotalDischarEngy;
 extern UINT32 BBox_TotalCharEngy;
-extern UINT32 BBox_DV_DQ;
+extern UINT32 BBox_TotalBackCharEngy;
+extern UINT32 BBox_Dq_Dv_MAX;
+extern UINT32 BBox_Dq_Dv_MIN;
 
 #endif /* APPGLOBALVAR_H_ */

+ 37 - 21
code/app/AppTaskUart1.c

@@ -263,8 +263,8 @@ static void TcpDataSendFeqHandFunc(uint8* DataIdx)
 	if(BMS_CharSt==1)//充电中
 	{
 		TcpDataFeq.GpsFeqCnt[1] = 60*3;
-		TcpDataFeq.TrkVehichleFeqCnt[1] = TcpDataFeq.GpsFeqCnt[1];
 		TcpDataFeq.TrkBattFeqCnt[1]  = 10;
+		TcpDataFeq.TrkVehichleFeqCnt[1] = TcpDataFeq.TrkBattFeqCnt[1];//0x90(vin)与(0x91)电池信息同频上传
 		if(timerDelayFlag == 0)
 		{
 			TcpDataFeq.BattHighFeqCnt[1] = 10;
@@ -274,8 +274,8 @@ static void TcpDataSendFeqHandFunc(uint8* DataIdx)
 	else if(BMS_Mode==2)//放电中
 	{
 		TcpDataFeq.GpsFeqCnt[1] = 10;
-		TcpDataFeq.TrkVehichleFeqCnt[1] = TcpDataFeq.GpsFeqCnt[1];
 		TcpDataFeq.TrkBattFeqCnt[1]  = 30;
+		TcpDataFeq.TrkVehichleFeqCnt[1] = TcpDataFeq.TrkBattFeqCnt[1];//0x90(vin)与(0x91)电池信息同频上传
 		if(timerDelayFlag == 0)
 		{
 			TcpDataFeq.BattHighFeqCnt[1] = 30;
@@ -285,8 +285,8 @@ static void TcpDataSendFeqHandFunc(uint8* DataIdx)
 	else//没有上高压状态
 	{
 		TcpDataFeq.GpsFeqCnt[1] = 60;
-		TcpDataFeq.TrkVehichleFeqCnt[1] = TcpDataFeq.GpsFeqCnt[1];
 		TcpDataFeq.TrkBattFeqCnt[1]  = 60;
+		TcpDataFeq.TrkVehichleFeqCnt[1] = TcpDataFeq.TrkBattFeqCnt[1]; //0x90(vin)与(0x91)电池信息同频上传
 		if(timerDelayFlag == 0)
 		{
 			TcpDataFeq.BattHighFeqCnt[1] = 60;
@@ -318,9 +318,8 @@ static void TcpDataSendFeqHandFunc(uint8* DataIdx)
 	if(wakeup1==STD_LOW && wakeup2==STD_LOW)
 	{
 		TcpDataFeq.DebugMsgFeqCnt[1] = 10*60;
-//		TcpDataFeq.TrkVehichleFeqCnt[1] = 10*60;
+		TcpDataFeq.TrkVehichleFeqCnt[1] = 10*60;
 		TcpDataFeq.GpsFeqCnt[1] = 3*60;
-		TcpDataFeq.TrkVehichleFeqCnt[1] = TcpDataFeq.GpsFeqCnt[1]; //0x90(vin)与(0x82)gps同频上传
 		TcpDataFeq.BattHighFeqCnt[1] = 10*60;
 		TcpDataFeq.BattAlgmMsgFeqCnt[1] = 10*60;
 	}
@@ -1285,7 +1284,7 @@ void TcpDataEncode(uint8 DataIdx,uint32 *PtrSendAddr, uint16 *SendLen)
 		*(SendBuffer + 3) = TCP_ANS_SYM;
 		memcpy(SendBuffer + 4, TcpbattSN, BATT_SN_LEN);
 		*(SendBuffer + 0x15) = (TCP_ENCPT_DISABLE & 0xFF); // uint8	TCP_ENCPT_DISABLE
-		uint16 DataLen = 0x18;
+		uint16 DataLen = 0x17;
 		*(SendBuffer + 0x16) = ((DataLen >> 8) & 0xFF); // uint16	DataLen
 		*(SendBuffer + 0x17) = (DataLen & 0xFF);
 		*(SendBuffer + 0x18) = ((UTC8TimeTcp.year) & 0xFF);		   // uint8	year
@@ -1317,7 +1316,7 @@ void TcpDataEncode(uint8 DataIdx,uint32 *PtrSendAddr, uint16 *SendLen)
 	}
 	case 0x96:
 	{
-		*SendLen = 0x3E;
+		*SendLen = 0x4A;
 		SendBuffer = pvPortMalloc(*SendLen);
 		*(SendBuffer + 0) = TCP_START_SYM1;
 		*(SendBuffer + 1) = TCP_START_SYM2;
@@ -1325,7 +1324,7 @@ void TcpDataEncode(uint8 DataIdx,uint32 *PtrSendAddr, uint16 *SendLen)
 		*(SendBuffer + 3) = TCP_ANS_SYM;
 		memcpy(SendBuffer + 4, TcpbattSN, BATT_SN_LEN);
 		*(SendBuffer + 0x15) = (TCP_ENCPT_DISABLE & 0xFF); // uint8	TCP_ENCPT_DISABLE
-		uint16 DataLen = 0x18;
+		uint16 DataLen = 0x31;
 		*(SendBuffer + 0x16) = ((DataLen >> 8) & 0xFF); // uint16	DataLen
 		*(SendBuffer + 0x17) = (DataLen & 0xFF);
 		*(SendBuffer + 0x18) = ((UTC8TimeTcp.year) & 0xFF);		   // uint8	year
@@ -1353,19 +1352,36 @@ void TcpDataEncode(uint8 DataIdx,uint32 *PtrSendAddr, uint16 *SendLen)
 		*(SendBuffer + 0x2E) = ((BBox_TotalCharCapy >> 16) & 0xFF);
 		*(SendBuffer + 0x2F) = ((BBox_TotalCharCapy >> 8) & 0xFF);
 		*(SendBuffer + 0x30) = ((BBox_TotalCharCapy) & 0xFF);
-		*(SendBuffer + 0x31) = ((BBox_TotalDischarEngy >> 24) & 0xFF); 	// uint32	BBox计算累计放电能量 Kwh
-		*(SendBuffer + 0x32) = ((BBox_TotalDischarEngy >> 16) & 0xFF);
-		*(SendBuffer + 0x33) = ((BBox_TotalDischarEngy >> 8) & 0xFF);
-		*(SendBuffer + 0x34) = ((BBox_TotalDischarEngy) & 0xFF);
-		*(SendBuffer + 0x35) = ((BBox_TotalCharEngy >> 24) & 0xFF); 	// uint32	BBox计算累计充电能量 Kwh
-		*(SendBuffer + 0x36) = ((BBox_TotalCharEngy >> 16) & 0xFF);
-		*(SendBuffer + 0x37) = ((BBox_TotalCharEngy >> 8) & 0xFF);
-		*(SendBuffer + 0x38) = ((BBox_TotalCharEngy) & 0xFF);
-		*(SendBuffer + 0x39) = ((BBox_DV_DQ >> 24) & 0xFF); 			// uint32	BBox计算Dv/Dq
-		*(SendBuffer + 0x3A) = ((BBox_DV_DQ >> 16) & 0xFF);
-		*(SendBuffer + 0x3B) = ((BBox_DV_DQ >> 8) & 0xFF);
-		*(SendBuffer + 0x3C) = ((BBox_DV_DQ) & 0xFF);
-		*(SendBuffer + 0x3D) = bcc_chk(SendBuffer, 0x3D);
+
+		*(SendBuffer + 0x31) = ((BBox_TotalBackCharCapy >> 24) & 0xFF); 	// uint32	BBox计算累计动能回收安时数  Ah 精度 0.1Ah
+		*(SendBuffer + 0x32) = ((BBox_TotalBackCharCapy >> 16) & 0xFF);
+		*(SendBuffer + 0x33) = ((BBox_TotalBackCharCapy >> 8) & 0xFF);
+		*(SendBuffer + 0x34) = ((BBox_TotalBackCharCapy) & 0xFF);
+
+		*(SendBuffer + 0x35) = ((BBox_TotalDischarEngy >> 24) & 0xFF); 	// uint32	BBox计算累计放电能量 Kwh
+		*(SendBuffer + 0x36) = ((BBox_TotalDischarEngy >> 16) & 0xFF);
+		*(SendBuffer + 0x37) = ((BBox_TotalDischarEngy >> 8) & 0xFF);
+		*(SendBuffer + 0x38) = ((BBox_TotalDischarEngy) & 0xFF);
+
+		*(SendBuffer + 0x39) = ((BBox_TotalCharEngy >> 24) & 0xFF); 	// uint32	BBox计算累计充电能量 Kwh
+		*(SendBuffer + 0x3A) = ((BBox_TotalCharEngy >> 16) & 0xFF);
+		*(SendBuffer + 0x3B) = ((BBox_TotalCharEngy >> 8) & 0xFF);
+		*(SendBuffer + 0x3C) = ((BBox_TotalCharEngy) & 0xFF);
+
+		*(SendBuffer + 0x3D) = ((BBox_TotalBackCharEngy >> 24) & 0xFF); 	// uint32	BBox计算累计动能回收能量 Kwh
+		*(SendBuffer + 0x3E) = ((BBox_TotalBackCharEngy >> 16) & 0xFF);
+		*(SendBuffer + 0x3F) = ((BBox_TotalBackCharEngy >> 8) & 0xFF);
+		*(SendBuffer + 0x40) = ((BBox_TotalBackCharEngy) & 0xFF);
+
+		*(SendBuffer + 0x41) = ((BBox_Dq_Dv_MAX >> 24) & 0xFF); 			// uint32	BBox计算Dq/Dv_MAX
+		*(SendBuffer + 0x42) = ((BBox_Dq_Dv_MAX >> 16) & 0xFF);
+		*(SendBuffer + 0x43) = ((BBox_Dq_Dv_MAX >> 8) & 0xFF);
+		*(SendBuffer + 0x44) = ((BBox_Dq_Dv_MAX) & 0xFF);
+		*(SendBuffer + 0x45) = ((BBox_Dq_Dv_MIN >> 24) & 0xFF); 			// uint32	BBox计算Dq/Dv_MAX
+		*(SendBuffer + 0x46) = ((BBox_Dq_Dv_MIN >> 16) & 0xFF);
+		*(SendBuffer + 0x47) = ((BBox_Dq_Dv_MIN >> 8) & 0xFF);
+		*(SendBuffer + 0x48) = ((BBox_Dq_Dv_MIN) & 0xFF);
+		*(SendBuffer + 0x49) = bcc_chk(SendBuffer, 0x49);
 		break;
 	}
 	default:

+ 36 - 2
code/hal/hal_adapter.c

@@ -1202,14 +1202,15 @@ void SystemModulesInit(void)
 	{
 		// if so, the adc is failed to Calibrate;
 	}
-	/* Partition only if it was not partitioned before for EERAM with code 0x4 */
-//    Eep_DepartParitition(T_EEEPROM_SIZE);
+
 	/* Initialize Eep driver */
 #if defined (EEP_PRECOMPILE_SUPPORT)
 	Eep_Init(NULL_PTR);
 #else
 	Eep_Init(&Eep_Config_VS_0);
 #endif
+	/* Partition only if it was not partitioned before for EERAM with code 0x4 */
+//	Eep_DepartParitition(T_EEEPROM_SIZE);
 	//Init Flash Driver
 #if defined (FLS_PRECOMPILE_SUPPORT)
 	Fls_Init(NULL_PTR);
@@ -1241,3 +1242,36 @@ void displayResetReasonWithLED(void)
 	Mcu_ResetType bootreason;
 	bootreason = Mcu_GetResetReason();
 }
+
+void IH_Data_Update(void)
+{
+	ihd_pct_socCor = 0;
+	sohd_pct_bcuSoh = (real32_T)(BMS_PackSOH*0.4);
+	ihd_V_cellUAvrg = (real32_T)(BMS_AverCellVolt/1000.0);
+	ihd_V_cellUMax = (real32_T)(BMS_MaxCellVolt/1000.0);
+	ihd_V_cellUMin = (real32_T)(BMS_MinCellVolt/1000.0);
+	ihd_V_battU_T2 = (real32_T)(BMS_BattVolt*0.1);
+	ihd_I_battCurr_T2 = (real32_T)(BMS_PackCurr*0.1)-1000;
+	dcmd_st_chrgSt_T2 = BMS_CharSt;
+
+}
+
+void OH_Data_Update(void)
+{
+
+	//socd_pct_ekfSoc;			//EKFSOC
+	//socd_pct_battSoc;			//电池SOC
+	//socd_pct_bcuSoc;				//显示SOC
+	BBox_PackSOC 			= (uint8)(socd_pct_ahSoc /0.4);		//安时SOC
+	BBox_PackSOH 			= (uint8)(BMS_PackSOH*0.4);
+	BBox_Dq_Dv_MIN 			= (uint32)(socd_Q_dMin * 1000);					//dQ/dV
+	BBox_Dq_Dv_MAX 			= (uint32)(socd_Q_dMax * 1000);					//dQ/dV
+	BBox_TotalCharEngy 		= (uint32)(damd_E_totalChrgEng*10);			//累计充电电量
+	BBox_TotalDischarEngy	= (uint32)(damd_E_totalDisChrgEng*10);		//累计放电电电量
+	BBox_TotalBackCharEngy 	= (uint32)(damd_E_totalRegenEng*10);		//累计回收电量
+	BBox_TotalCharCapy 		= (uint32)(damd_Q_totalChrgCp*10);			//累计充电容量
+	BBox_TotalDischarEngy 	= (uint32)(damd_Q_totalDisChrgCp*10);		//累计放电电容量
+	BBox_TotalBackCharCapy 	= (uint32)(damd_Q_totalRegenCp*10);			//累计回收容量
+}
+
+

+ 4 - 0
code/hal/hal_adapter.h

@@ -45,6 +45,7 @@
 #include "SEGGER_RTT.h"
 #include "hal_Wdg.h"
 #include "rtwtypes.h"
+#include "BCUDisp.h"
 /*适应性定义*/
 typedef unsigned char UINT8;
 typedef unsigned short UINT16;
@@ -263,4 +264,7 @@ void MCUSleep(void);
 void MCUEnterSleep(void);
 void displayResetReasonWithLED(void);
 
+void IH_Data_Update(void);
+void OH_Data_Update(void);
+
 #endif /* HAL_ADAPTER_H_ */

+ 1 - 1
code/main.c

@@ -89,7 +89,7 @@ int main(void)
 	xTaskCreate(CanTask, (const char *const)"CanTask", 512, (void *)0, main_TASK_PRIORITY + 2, &CanTask_Handle);
 	xTaskCreate(GpsTask, (const char *const)"GpsTask", 2048, (void *)0, main_TASK_PRIORITY + 1, &GpsTask_Handle);
 	xTaskCreate(Uart_4G_Task, (const char *const)"Uart_4G_Task", 2048, (void *)0, main_TASK_PRIORITY + 0, &Uart_4G_Task_Handle);
-	xTaskCreate(BBox_BCU_Task, (const char *const)"BBox_BCU_Task", 2048, (void *)0, main_TASK_PRIORITY + 0, &BBox_BCU_Task_Handle);
+//	xTaskCreate(BBox_BCU_Task, (const char *const)"BBox_BCU_Task", 2048, (void *)0, main_TASK_PRIORITY + 3, &BBox_BCU_Task_Handle);
 	vTaskStartScheduler();
 
 	for (;;)

Niektóre pliki nie zostały wyświetlone z powodu dużej ilości zmienionych plików