Sfoglia il codice sorgente

fix:c_common和bsp_common冲突

alienwalker 3 anni fa
parent
commit
bda2f9808b

+ 0 - 10
components/ethernet/common/common_client.c

@@ -1,12 +1,2 @@
-#include "luat_base.h"
-#if defined(LUAT_USE_DHCP) || defined(LUAT_USE_DNS)
-#include "dhcp_def.h"
-#include "dns_def.h"
-#include "c_common.h"
 
-typedef struct
-{
-	dhcp_client_info_t dhcp_client[2];
-}common_client_struct;
-#endif
 

+ 1 - 1
components/ethernet/common/dhcp_client.c

@@ -1,7 +1,7 @@
 #include "luat_base.h"
 #ifdef LUAT_USE_DHCP
+#include "luat_network_adapter.h"
 #include "dhcp_def.h"
-#include "c_common.h"
 #define DHCP_OPTION_138 138
 extern void DBG_Printf(const char* format, ...);
 extern void DBG_HexPrintf(void *Data, unsigned int len);

+ 0 - 1
components/ethernet/common/dhcp_def.h

@@ -3,7 +3,6 @@
 #define __ETHERNET_COMMON_DHCP_DEF_H__
 #include "luat_base.h"
 #ifdef LUAT_USE_DHCP
-#include "c_common.h"
 
 #ifdef __cplusplus
 extern "C" {

+ 2 - 2
components/ethernet/common/dns_client.c

@@ -1,9 +1,9 @@
 #include "luat_base.h"
 #ifdef LUAT_USE_DNS
-#include "luat_network_adapter.h"
-#include "c_common.h"
+
 #include "dns_def.h"
 #include "ctype.h"
+#include "luat_network_adapter.h"
 #define dnsONE_QUESTION                 0x0001
 #define dnsFLAG_QUERY_RESPONSE_BIT      0x8000
 #define dnsFLAG_OPERATION_CODE_BITS     0x7800

+ 1 - 1
components/ethernet/w5500/luat_lib_w5500.c

@@ -7,7 +7,6 @@
 
 #include "luat_base.h"
 #ifdef LUAT_USE_W5500
-#include "luat_network_adapter.h"
 #include "luat_rtos.h"
 #include "luat_zbuff.h"
 #include "luat_spi.h"
@@ -15,6 +14,7 @@
 #include "luat_log.h"
 
 #include "w5500_def.h"
+#include "luat_network_adapter.h"
 /*
 初始化w5500
 @api w5500.init(spiid, speed, cs_pin, irq_pin, rst_pin, link_pin)

+ 4 - 3
components/ethernet/w5500/w5500.c

@@ -1,15 +1,16 @@
+#include "platform_def.h"
 #include "luat_base.h"
 #include "luat_spi.h"
 #ifdef LUAT_USE_W5500
 #include "luat_rtos.h"
 #include "luat_zbuff.h"
 #include "luat_gpio.h"
-#include "luat_network_adapter.h"
-#include "c_common.h"
 #include "w5500_def.h"
+
+
+#include "luat_network_adapter.h"
 #include "dhcp_def.h"
 #include "dns_def.h"
-#include "platform_def.h"
 
 extern void DBG_Printf(const char* format, ...);
 extern void DBG_HexPrintf(void *Data, unsigned int len);

+ 3 - 3
components/network/adapter/luat_network_adapter.c

@@ -1,12 +1,12 @@
 
 #include "luat_base.h"
 #ifdef LUAT_USE_NETWORK
-#include "luat_network_adapter.h"
+
 #include "luat_rtos.h"
 #include "platform_def.h"
-#include "c_common.h"
 #include "ctype.h"
-
+#include "luat_network_adapter.h"
+#include "dhcp_def.h"
 extern void DBG_Printf(const char* format, ...);
 extern void DBG_HexPrintf(void *Data, unsigned int len);
 //#define DBG(x,y...)		DBG_Printf("%s %d:"x"\r\n", __FUNCTION__,__LINE__,##y)

+ 4 - 2
components/network/adapter/luat_network_adapter.h

@@ -3,7 +3,7 @@
 #include "luat_base.h"
 #ifdef LUAT_USE_NETWORK
 #include "luat_rtos.h"
-#include "c_common.h"
+
 #ifdef LUAT_USE_TLS
 #include "mbedtls/ssl.h"
 #include "mbedtls/platform.h"
@@ -14,7 +14,9 @@
 #include "mbedtls/entropy.h"
 #include "mbedtls/sha1.h"
 #endif
-
+#ifndef __BSP_COMMON_H__
+#include "c_common.h"
+#endif
 #define MAX_DNS_IP		(4)	//每个URL最多保留4个IP
 
 enum