z8359531l 2 månader sedan
förälder
incheckning
bac0c19f7a
6 ändrade filer med 28 tillägg och 21 borttagningar
  1. 1 1
      Src/soft_can.c
  2. 11 2
      Src/soft_obstacle.c
  3. 1 1
      Src/soft_p_2_c.c
  4. 6 6
      Src/soft_seed_device.c
  5. 5 7
      Src/soft_uart.c
  6. 4 4
      Src/soft_water_device.c

+ 1 - 1
Src/soft_can.c

@@ -147,7 +147,7 @@ void Can_decode_data_function(CAN_RxHeaderTypeDef Rxhead)
          break;
       default:
         //好盈ID基本没有固定位,全检测
-        HobbywingCanRecvHookFunction(Rxhead.ExtId, RxData, RxHeader.DLC);
+        HobbywingCanRecvHookFunction(Rxhead.ExtId, RxData, RxHeader.DLC); 
         break;
       }
     }

+ 11 - 2
Src/soft_obstacle.c

@@ -1217,9 +1217,18 @@ void can_send_info_to_mimo()
 void send_mocib_radar_sensi(void)
 {
     static int radar_sensi_send_time = 0;
-    //uint8_t radar_can_buf[8] = {0};
-    if(HAL_GetTick() > 7000 && HAL_GetTick() - radar_sensi_send_time > 300)
+    // uint8_t radar_can_buf[8] = {0};
+    if(HAL_GetTick() > 7000 && HAL_GetTick() - radar_sensi_send_time > 300) 
     {   
+        // radar_can_buf[0] = 0x55;
+        // radar_can_buf[1] = 0xAA;
+        // radar_can_buf[2] = 0x03;
+        // radar_can_buf[3] = 0x61;
+        // radar_can_buf[4] = 0x03;
+        // radar_can_buf[5] = 0x02;
+        // radar_can_buf[6] = 0x66;
+
+        // can_send_msg_normal(radar_can_buf, 7, 0xfa);
         //给FMU发送雷达灵敏度
         radar_sensi_send_time = HAL_GetTick();
         //上电后 检测到有雷达连接,向飞控发送雷达灵敏度信息

+ 1 - 1
Src/soft_p_2_c.c

@@ -1472,7 +1472,7 @@ void Check_Rst(void)
  * ****************检查是否收到FMU信息************************************
  * ****************************************************************/
 int time_heart[3] = {0};
-int time_count[3] = {0};//test
+int time_count[3] = {0};
 static uint32_t fmu_link_time = 0;
 void check_fmu_link()
 {

+ 6 - 6
Src/soft_seed_device.c

@@ -934,8 +934,8 @@ void  update_device_type_data(void)
                 Dev.L_pump1.rpm =  Lpump1.rpm;
                 break;
             case FAC_HW_ESC:
-                Dev.L_pump1.warn = EscMsg[1].warn_flag;
-                Dev.L_pump1.rpm = EscMsg[1].motorRPM;
+                // Dev.L_pump1.warn = EscMsg[1].warn_flag;
+                // Dev.L_pump1.rpm = EscMsg[1].motorRPM;
                 break;
             default:
                 break;
@@ -952,8 +952,8 @@ void  update_device_type_data(void)
                 Dev.L_pump2.rpm =  Lpump2.rpm;
                 break;
             case FAC_HW_ESC:
-                Dev.L_pump2.warn = EscMsg[2].warn_flag;
-                Dev.L_pump2.rpm = EscMsg[2].motorRPM;
+                // Dev.L_pump2.warn = EscMsg[2].warn_flag;
+                // Dev.L_pump2.rpm = EscMsg[2].motorRPM;
                 break;
             default:
                 break;
@@ -1087,8 +1087,8 @@ void  update_device_type_data(void)
                 Dev.Flow.k2 = flow_inf.ch1.k;
                 break;
             case FAC_HW_ESC:
-                Dev.Flow.speed1 = EscMsg[1].motorRPM / FlOW_KP;
-                Dev.Flow.speed2 = EscMsg[2].motorRPM / FlOW_KP;
+                // Dev.Flow.speed1 = EscMsg[1].motorRPM / FlOW_KP;
+                // Dev.Flow.speed2 = EscMsg[2].motorRPM / FlOW_KP;
                 Dev.Flow.ml1 = 0;//(flow_inf.ch1.ml + 65535 * flow_inf.ch1.overturn) * FlOW_KP * 60 / 1000;
                 Dev.Flow.ml2 = 0;//(flow_inf.ch2.ml + 65535 * flow_inf.ch2.overturn) * FlOW_KP * 60 / 1000;
                 Dev.Flow.warn1 = 0;

+ 5 - 7
Src/soft_uart.c

@@ -115,28 +115,26 @@ bool uart_send_is_ok(uint8_t uart_num)
  **/
 uint32_t uart2_send_delay_time = 0;
 uint32_t uart3_send_delay_time = 0;
+
 void uart2_send_msg(uint8_t *data, uint8_t size)
 {
-	// static uint32_t send_time = 0;
-
-	// send_time = HAL_GetTick();
-	// //防止连续发送使多个数据变成一个
-	// while (HAL_GetTick() - send_time <= 1)
-	// 	;
+	 
 
 	rkfifo_in(&send_uart_rkfifo,data,size);
+
 	// HAL_UART_Transmit_DMA(&huart2, data, size);
 
 	// uart2_send_delay_time = HAL_GetTick();
 	//bspSerialWrite(&serial2,data,size);
 }
 uint8_t send_uart_buf[256 * 4] = {0};
+
 void send_uartfifo_msg(void)
 {
 	uint16_t len = 0;
 	if(uart_send_is_ok(USART_2) == true)
     {
-		len = rkfifo_out(&send_uart_rkfifo, &send_uart_buf, 256);
+		len = rkfifo_out(&send_uart_rkfifo, &send_uart_buf, MAX_UART_BUF * 4);
 
 		if(len > 0) 
 		{

+ 4 - 4
Src/soft_water_device.c

@@ -322,8 +322,8 @@ void HW_CanSetESCInfomation( void )
 
             if ( setESCidInfo.setESCidNum > 0 && setESCidInfo.setESCidNum <= 4 )
             {
-                EscMsg[setESCidInfo.setESCidNum].ResSetID = false;
-                EscMsg[setESCidInfo.setESCidNum].ResSetIDModeExit = false;
+                // EscMsg[setESCidInfo.setESCidNum].ResSetID = false;
+                // EscMsg[setESCidInfo.setESCidNum].ResSetIDModeExit = false;
 
                 setESCidInfo.setESCidStep++;
             }
@@ -385,7 +385,7 @@ void HW_CanSetESCInfomation( void )
             //等待电调的油门信号失能判定时间300ms,每次配置一个电调
             if ( HAL_GetTick() - setESCidInfo.setEscIDDelayTime > 2000 )
             {
-                if ( EscMsg[setESCidInfo.setESCidNum].ResSetID == false )
+                if (1/* EscMsg[setESCidInfo.setESCidNum].ResSetID == false*/ )
                 {
                     send_can_buf[0] = setESCidInfo.setESCidNum;
                     send_can_buf[1] = setESCidInfo.setESCidNum;
@@ -411,7 +411,7 @@ void HW_CanSetESCInfomation( void )
         //nodeID配置完成/失败后退出配置模式,广播发送,全部回复
         else if ( setESCidInfo.setESCidStep == SETESCID_EXIT )
         {
-            if ( EscMsg[setESCidInfo.setESCidNum].ResSetIDModeExit == false )
+            if (1/* EscMsg[setESCidInfo.setESCidNum].ResSetIDModeExit == false */)
             {
                 //广播帧
                 canID  = ( ( HW_PRI_MEDIUM << HW_CANID_PRI_POS ) & HW_CANID_PRI_MASK ) |