Browse Source

1.暂时关闭uart的BMS通讯接口
2.判断一帧的超时时间20ms改10ms
3.5s协议的握手字节打开接收

CN\houcf5 3 months ago
parent
commit
1ecd9d3466

+ 1 - 1
1.FrameLayer/Source/app.c

@@ -110,7 +110,7 @@ void AppLoop()
     //ReadFrame_Poll2();
   //  uart_voMainDec();
     UsartRx_Process(&UART_RxBuff_Struct_OBC, &UART_TxBuff_Struct_OBC, &stUSART_FrameBuf_OBC);
-    UsartRx_Process(&UART_RxBuff_Struct_BMS, &UART_TxBuff_Struct_BMS, &stUSART_FrameBuf_BMS);
+    //UsartRx_Process(&UART_RxBuff_Struct_BMS, &UART_TxBuff_Struct_BMS, &stUSART_FrameBuf_BMS);
     
     TimingTaskLoopServer();
      ReceiveCmdHandle();

+ 1 - 1
3.BasicFunction/Include/usart.h

@@ -82,7 +82,7 @@ typedef _Bool  BOOL;
 
 #define UART_BUFF_SIZE			512//256
 #define FRAME_SIZE                      8
-#define FRAMETIMEOUT_Count              20       //ms
+#define FRAMETIMEOUT_Count              10//20       //ms
     
 #define UARTFRAME_BEGIN (UBYTE)0x3A
 #define UARTFRAME_END1 (UBYTE)0x0D

+ 1 - 1
3.BasicFunction/Source/uart_J.c

@@ -171,7 +171,7 @@ void J_USART_DataProcess(USART_Buf_TypeDef* ptUartTx, UBYTE* Data)
     MC_RunInfo.LightSwitch = MC_ControlCode.LightSwitch; //大灯状态更新
     ulOBC_ComTimeOutCount = cp_ulSystickCnt;
     
-    //J_OBCSetPara();//参数更新
+    //J_OBCSetPara(J_stOBC2MCInfo.stSetInfo);//参数更新
     
     J_SendData_OBC(ptUartTx,Data[3]);
 }

+ 2 - 2
3.BasicFunction/Source/uart_bafang.c

@@ -156,7 +156,7 @@ void Bafang_USART_RxData_Process(USART_Buf_TypeDef* ptUartTx, UBYTE* buf, UWORD
             } 
             case 0x11:  //读电池容量
             {
-                Bafang_SendData_BMS(&UART_TxBuff_Struct_BMS, 0x16, 0x0D, 0x01);
+                //Bafang_SendData_BMS(&UART_TxBuff_Struct_BMS, 0x16, 0x0D, 0x01);
                 if(blBMSCommFault == TRUE)
                 {
                     databuf[0] = MC_RunInfo.SOC;
@@ -410,7 +410,7 @@ void Bafang_USART_RxData_Process(USART_Buf_TypeDef* ptUartTx, UBYTE* buf, UWORD
 ****************************************************************/
 void Bafang_SendData_BMS(USART_Buf_TypeDef* ptUartTx, UBYTE Addr, UBYTE Cmd, UBYTE Length)
 {
-#if (SIMULATION == 1)
+#if 0// (SIMULATION == 1)
   return;
 #else
     UBYTE databuf[255] = {0};

+ 1 - 1
3.BasicFunction/Source/usart.c

@@ -360,7 +360,7 @@ void KM5S_USART_DataProcess(USART_Buf_TypeDef* ptUartTx, UWORD Addr, UBYTE Mode,
         }
         else if((Mode == 0x53) && (Length == 0x07))         //参数设置
         {
-//            KM5S_OBCSetPara(Data);
+            KM5S_OBCSetPara(Data);
             KM5S_SendData_OBC(ptUartTx, Mode, 0x05, stOBC_SetInfo.ucShakingCode);
         }
     }