yidong 2 тижнів тому
батько
коміт
1808f453d7

+ 1 - 1
BoardInterface/onechip_load_inf.h

@@ -8,7 +8,7 @@
 #define SOFT_VERSION_1  7	//软件版本号
 #define SOFT_VERSION_2  4	//软件版本号
 #define SOFT_VERSION_3  0	//软件版本号
-#define SOFT_VERSION_4  20	//软件版本号
+#define SOFT_VERSION_4  21	//软件版本号
 
 
 

+ 16 - 6
DriverInterface/ESP32_WROOM_32D.c

@@ -421,9 +421,13 @@ void WIFI_recv_deal(void)
     //判断是否接收完成
     if(wifi_state > WIFI_LISTEN)
     {
-        if(data[g_wifi_rx_last-1] != '\n' && data[g_wifi_rx_last-2] != '\n')
+        if(data[g_wifi_rx_last-1] != '\n' && data[g_wifi_rx_last-2] != '\r')
         {
-            return;
+            if(wifi_state == WIFI_TRANS){
+                if(data[g_wifi_rx_last-1] != '>' && data[g_wifi_rx_last-2] != '>'){
+                     return;
+                }
+            }           
         }
     }
 
@@ -535,11 +539,11 @@ void WIFI_recv_deal(void)
             wifi_tx_len = 0;
             //  wifi_receive_clear();
 		}
-		 else if(NULL != find_str_loop(g_wifi_rx_buf, WIFI_RX_BUF_SIZE ,&g_wifi_rx_head, g_wifi_rx_last, "OK\r\n"))
+		 else if(NULL != find_str_loop(g_wifi_rx_buf, WIFI_RX_BUF_SIZE ,&g_wifi_rx_head, g_wifi_rx_last, ">"))
 		{
              wifi_receive_clear();
 		    Van_Device_Printf(VAN_LOG_WIFI,"\n--> OK W %d", wifi_tx_len); 
-			WriteComm2((char *)wifi_tx_buf, wifi_tx_len+1);
+			WriteComm2((char *)wifi_tx_buf, wifi_tx_len);
             wifi_ack_delay = 3000;
 		}
 		//  else if(NULL != find_str_loop(g_wifi_rx_buf, WIFI_RX_BUF_SIZE ,&g_wifi_rx_head, g_wifi_rx_last, ">"))
@@ -574,8 +578,14 @@ void WIFI_recv_deal(void)
             if (iProcLen > 0)   {                        
                 sysinf.pc_channel_recv  = PC_CONNECT_TYPE_WIFI; 
                 sysinf.pc_link_timeout = 0;
-				uart0_massage.data = (char *)uart0_data;    
-                query_pc_cmd(&uart0_massage);
+				uart0_massage.data = (char *)uart0_data;
+                /* The monitor reads lysis worktime through 0x58. This query
+                 * lives in mUnionActionPack, not mPCActionPack. */
+                if (uart0_massage.cmd == UINON_CMD_THEROM_GET && uart0_massage.len == 4) {
+                    deal_mUnion_cmd(&uart0_massage);
+                } else {
+                    query_pc_cmd(&uart0_massage);
+                }
                 wifi_receive_clear();
             }    
             //  wifi_receive_clear();

+ 16 - 12
DriverInterface/communication.c

@@ -101,9 +101,11 @@ int data_send_to_pc(pc_cmd_type cmd, char *data, unsigned short len)
 
 	if((sysinf.pc_channel_recv  == PC_CONNECT_TYPE_WIFI || cmd == PC_CMD_SETIP ) && ((PC_CMD_SETWIFI != cmd) && (PC_CMD_UPDATETEMP != cmd) && (PC_CMD_DATASCOPE != cmd)))
 	{	
-		wifi_tx_len = sendlen;		
-		memcpy(wifi_tx_buf, com_tx_buf, wifi_tx_len);
-		return WIFI_ReSend();
+         if(wifi_tx_len == 0){                
+            wifi_tx_len = sendlen;		
+            memcpy(wifi_tx_buf, com_tx_buf, wifi_tx_len);
+            return WIFI_ReSend();
+         }
 	}
 	else
 	{	
@@ -129,20 +131,22 @@ int data_send_to_pc_withindex(pc_cmd_type cmd, char *data, unsigned short len, u
 	check += checkSum((const unsigned char *)data, len);
 	msg.checksum = check & 0xFF;
 	msg.tail = (check >> 8);	
-	if(check_to_pc_busy()){		
-		memcpy(&wifi_tx_buf[0], (uint8_t*)&msg, MSG_CMDFRAME_LEN);
-		memcpy(&wifi_tx_buf[MSG_CMDFRAME_LEN], data, len);
-		memcpy(&wifi_tx_buf[MSG_CMDFRAME_LEN+len],  (uint8_t*)&check, 2);
-	}else{
-		return ret;
-	}	
+	
 	if((sysinf.pc_channel_recv  == PC_CONNECT_TYPE_WIFI || cmd == PC_CMD_SETIP ) && PC_CMD_SETWIFI != cmd)
 	{	
-		wifi_tx_len = MSG_CMDFRAME_LEN+len+2;			
-		return WIFI_ReSend();
+        if(wifi_tx_len == 0){
+			memcpy(&wifi_tx_buf[0], (uint8_t*)&msg, MSG_CMDFRAME_LEN);
+			memcpy(&wifi_tx_buf[MSG_CMDFRAME_LEN], data, len);
+			memcpy(&wifi_tx_buf[MSG_CMDFRAME_LEN+len],  (uint8_t*)&check, 2);
+            wifi_tx_len = MSG_CMDFRAME_LEN+len+2;			
+            return WIFI_ReSend();
+        }
 	}
 	else
 	{	
+		memcpy(&wifi_tx_buf[0], (uint8_t*)&msg, MSG_CMDFRAME_LEN);
+		memcpy(&wifi_tx_buf[MSG_CMDFRAME_LEN], data, len);
+		memcpy(&wifi_tx_buf[MSG_CMDFRAME_LEN+len],  (uint8_t*)&check, 2);
 	    wifi_tx_len = MSG_CMDFRAME_LEN+len+2;	
         Van_Debug_UART_Send_DMA((unsigned char *)wifi_tx_buf, wifi_tx_len); //将收到的信息发送出		
 		memset(wifi_tx_buf, 0, sizeof(wifi_tx_buf));

+ 2 - 2
DriverInterface/ws2812.c

@@ -168,7 +168,7 @@ void light_set(uint8_t mode_select, uint16_t speed_ms, uint32_t rgb_color, uint8
  *参数:uint16_t speed_ms:变化周期
  *参数:uint32_t rgb_color:颜色, 低24位有效
  *参数:uint8_t channel:通道,0左,1右
- *返回:无
+ *返回:无SS
  *其他:无
  ********************************************************************/
 void light_update(void){
@@ -179,7 +179,7 @@ void light_update(void){
         light_set(MODE_NORMAL,1000, COLOR_RED,0);	//仪器故障,双边同步
         light_set(MODE_NORMAL,1000, COLOR_RED,1);	//
         return ;
-    } else   if(sysinf.pc_link_timeout == OFFLINE_TIME){
+    } else   if(sysinf.pc_link_timeout >= OFFLINE_TIME){
         light_set(MODE_BLINK,1000, COLOR_YELLOW,0);	//
         // light_set(MODE_BLINK,1000, COLOR_YELLOW,1);	//
         sysinf.pc_channel_recv  = PC_CONNECT_TYPE_NULL;

+ 1 - 1
MDK-ARM/mini7_V2.uvoptx

@@ -73,7 +73,7 @@
         <LExpSel>0</LExpSel>
       </OPTXL>
       <OPTFL>
-        <tvExp>1</tvExp>
+        <tvExp>0</tvExp>
         <tvExpOptDlg>0</tvExpOptDlg>
         <IsCurrentTarget>1</IsCurrentTarget>
       </OPTFL>