Ver código fonte

删除部分不需要变量

huang_chao 1 ano atrás
pai
commit
51ee3bebf3
4 arquivos alterados com 8 adições e 46 exclusões
  1. 1 4
      src/AppGlobalVar.c
  2. 1 4
      src/AppGlobalVar.h
  3. 1 10
      src/AppTaskUart0.c
  4. 5 28
      src/hal_adapter.c

+ 1 - 4
src/AppGlobalVar.c

@@ -148,9 +148,6 @@ uint8  AT_WPROTCLOSE_FLAG = 0;
 uint8  AT_WPROTSET_FLAG = 0;
 uint8  W_IP_FLAG = 0;
 uint8  W_TcpDisconnect = 0;
-uint8  IP_SetInfo[56] = {0};	/* 第0字节表示设置IP信息长度,后续字节表示设置IP信息 */
-uint8  IP_GetInfo[86] = {0};
-uint8  Port_info[9] = {6,'1',',',0}; /* 长度 1字节 + 固定两字节 + 端口号最多4字节 + \r\n*/
-uint8  WiFi_Info[64] = {0}; 	/* 第0字节表示WiFi信息长度,后续字节表示信息 */
+
 
 uint8 lock_sta = 2;   /* 锁止状态 1 解锁  2 上锁 */

+ 1 - 4
src/AppGlobalVar.h

@@ -149,10 +149,7 @@ extern uint8  AT_WPROTCLOSE_FLAG;
 extern uint8  AT_WPROTSET_FLAG;
 extern uint8  W_IP_FLAG;
 extern uint8  W_TcpDisconnect;
-extern uint8  IP_SetInfo[56];
-extern uint8  IP_GetInfo[86];
-extern uint8  Port_info[9];
-extern uint8  WiFi_Info[64];
+
 
 
 

+ 1 - 10
src/AppTaskUart0.c

@@ -81,12 +81,7 @@ void McuATCmdTransmit(char *Readptr, uint16 Readlen, char *AnsPtr, uint8 *AnsPtr
 sint8 McuAtCallbackFunc(char *Readptr, uint16 ReadLen, McuAtCmd McuAtIdx, char *AnsPtr, uint8 *AnsPtrLen)
 {
 
-	char *SucAns = "OK\r\n";
-	char *ErrAns = "ERROR\r\n";
-	char *OffAns = "OFF\r\n";
-	char *OnAns = "ON\r\n";
-	char *SlaveAns = "S";
-	char *MasterAns = "M";
+
 
 	return 0;
 }
@@ -150,8 +145,4 @@ void GlobeVariableHandle_W0(void)
 	{
 		UART_Send_Data(UART_LPUART0,(const uint8*)"Command executed but not changed\r\n",strlen("Command executed but not changed\r\n"),100);
 	}
-	else if(5 == ATRet)
-	{
-		UART_Send_Data(UART_LPUART0,IP_GetInfo+1,IP_GetInfo[0],100);
-	}
 }

+ 5 - 28
src/hal_adapter.c

@@ -133,6 +133,7 @@ uint32_t read_ringBuffer(uint8_t *buffer, uint32_t size, ringbuffer_t *ringBuf)
 
     return size;
 }
+
 Std_ReturnType UART_Query_Data(uint8 transChannel, uint8 recvChannel, uint8 *txBuffer, uint16 sendLength, uint8 *rxBuffer, uint16 *rxlen, uint32 T_timeout)
 {
     UartMsg_t UartRecvMsg;
@@ -144,6 +145,7 @@ Std_ReturnType UART_Query_Data(uint8 transChannel, uint8 recvChannel, uint8 *txB
     UartSendMsg.dataPtr = txBuffer;
     *rxlen = 0;
     Sendret = xQueueSend(UartSendQueue[transChannel], &UartSendMsg, 50);
+
     if (Sendret == pdTRUE)
     {
         Recvret = xQueueReceive(UartRecvQueue[recvChannel], &UartRecvMsg, T_timeout);
@@ -215,7 +217,7 @@ void UartInit(void)
     UartSendQueue[2] = xQueueCreate(1, sizeof(UartMsg_t));
     UartHalQueueHandle = xQueueCreate(9, sizeof(UartHalMsg_t));
 
-    xTaskCreate(Uart_Hal_RecvTask, (const char *const)"UartRecv", 256, (void *)0, main_TASK_PRIORITY + 5, NULL);
+    xTaskCreate(Uart_Hal_RecvTask, (const char *const)"UartRecv", 512, (void *)0, main_TASK_PRIORITY + 5, NULL);
     xTaskCreate(Uart_Hal_SendTask, (const char *const)"UartSend", 256, (void *)0, main_TASK_PRIORITY + 4, NULL);
 }
 Std_ReturnType UartStartRecvFunc(uint8 channel)
@@ -271,10 +273,7 @@ void Uart_Hal_RecvTask(void *pvParameters)
         {
             UartState[UartIdx] = UartRecvComplete;
         }
-        else
-        {
-
-        }
+        else{}
 
         if ((UartState[UartIdx] == UartAbortRecv) || (UartState[UartIdx] == UartRecvComplete)) //判定UART开始接收:UART停止后开始接收
         {
@@ -298,10 +297,6 @@ void Uart_Hal_RecvTask(void *pvParameters)
                     UartRecvMsg.dataAddr = (uint32)(uartRingBuffer[UartHalMsgRecv.Channel].bw + uartRingBuffer[UartHalMsgRecv.Channel].source - UartHalMsgRecv.value);
                     ret_send = xQueueSend(UartRecvQueue[UartHalMsgRecv.Channel], &UartRecvMsg, 10);
                 }
-#if SEGGER_PRINTF==1
-  if(UartHalMsgRecv.Channel == 0X01)
-	SEGGER_RTT_printf("send cmd and receive [%d]:{ %s }\r\n",UartRecvMsg.DataLen,UartRecvMsg.dataAddr);
-#endif
                 T_timeout[UartHalMsgRecv.Channel] = 0;
                 UartState[UartHalMsgRecv.Channel] = UartRecvComplete;
             }
@@ -323,25 +318,7 @@ void Uart_Hal_SendTask(void *pvParameters)
 
         if (ret == pdTRUE)
         {
-        	if(2 == UartIdx)
-        	{
-#if 1
-	SEGGER_RTT_printf("ble rec:%s\r\n", UartSendMsg.dataPtr);
-#endif
-        	}
-
-#if SEGGER_PRINTF==1
-    	if(UartIdx==1 && UartSendMsg.dataPtr==0x1FFF3BD4)
-    	{
-    		SEGGER_RTT_printf("send [%d]:{ %X }\r\n",UartSendMsg.DataLen,UartSendMsg.dataPtr);
-    		for(uint8 i=0;i<UartSendMsg.DataLen;i++)
-    		{
-    			SEGGER_RTT_printf("%02X ",*(UartSendMsg.dataPtr+i));
-    		}
-    		SEGGER_RTT_printf("\r\n");
-    		SEGGER_RTT_printf("send [%d]:{ %s }\r\n",UartSendMsg.DataLen,UartSendMsg.dataPtr);
-    	}
-#endif
+
             T_Uart_Status[UartIdx] = Uart_AsyncSend(UartIdx, UartSendMsg.dataPtr, UartSendMsg.DataLen);
             if (E_OK != T_Uart_Status[UartIdx])
             {