diff --git a/Project/Src/rt-thread/components/net/lwip-2.1.0/src/api/tcpip.c b/Project/Src/rt-thread/components/net/lwip-2.1.0/src/api/tcpip.c index 743553a..b0382e8 100644 --- a/Project/Src/rt-thread/components/net/lwip-2.1.0/src/api/tcpip.c +++ b/Project/Src/rt-thread/components/net/lwip-2.1.0/src/api/tcpip.c @@ -519,7 +519,7 @@ tcpip_api_call(tcpip_api_call_fn fn, struct tcpip_api_call_data *call) * e.g. the message is allocated once and posted several times from an IRQ * using tcpip_callbackmsg_trycallback(). * Example usage: Trigger execution of an ethernet IRQ DPC routine in lwIP thread context. - * + * * @param function the function to call * @param ctx parameter passed to function * @return a struct pointer to pass to tcpip_callbackmsg_trycallback(). diff --git a/Project/Src/rt-thread/components/net/lwip-2.1.0/src/arch/include/arch/cc.h b/Project/Src/rt-thread/components/net/lwip-2.1.0/src/arch/include/arch/cc.h index 77a5892..17736ed 100644 --- a/Project/Src/rt-thread/components/net/lwip-2.1.0/src/arch/include/arch/cc.h +++ b/Project/Src/rt-thread/components/net/lwip-2.1.0/src/arch/include/arch/cc.h @@ -40,10 +40,10 @@ #define U16_F "hu" #define S16_F "hd" -#define X16_F "hx" +// #define X16_F "hx" #define U32_F "lu" #define S32_F "ld" -#define X32_F "lx" +#define X32_F "08x" #ifdef RT_USING_LIBC #if defined(__CC_ARM) || defined(__CLANG_ARM) || defined(__IAR_SYSTEMS_ICC__) @@ -97,7 +97,7 @@ void sys_arch_assert(const char* file, int line); #include "string.h" -#define SYS_ARCH_DECL_PROTECT(level) +#define SYS_ARCH_DECL_PROTECT(level) #define SYS_ARCH_PROTECT(level) rt_enter_critical() #define SYS_ARCH_UNPROTECT(level) rt_exit_critical() diff --git a/Project/Src/rt-thread/components/net/lwip-2.1.0/src/core/ipv4/etharp.c b/Project/Src/rt-thread/components/net/lwip-2.1.0/src/core/ipv4/etharp.c index 442aac0..a5480c8 100644 --- a/Project/Src/rt-thread/components/net/lwip-2.1.0/src/core/ipv4/etharp.c +++ b/Project/Src/rt-thread/components/net/lwip-2.1.0/src/core/ipv4/etharp.c @@ -423,7 +423,7 @@ etharp_update_arp_entry(struct netif *netif, const ip4_addr_t *ipaddr, struct et { s16_t i; LWIP_ASSERT("netif->hwaddr_len == ETH_HWADDR_LEN", netif->hwaddr_len == ETH_HWADDR_LEN); - LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_update_arp_entry: %"U16_F".%"U16_F".%"U16_F".%"U16_F" - %02"X16_F":%02"X16_F":%02"X16_F":%02"X16_F":%02"X16_F":%02"X16_F"\n", + LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_update_arp_entry: %"U16_F".%"U16_F".%"U16_F".%"U16_F" - %"X8_F":%"X8_F":%"X8_F":%"X8_F":%"X8_F":%"X8_F"\n", ip4_addr1_16(ipaddr), ip4_addr2_16(ipaddr), ip4_addr3_16(ipaddr), ip4_addr4_16(ipaddr), (u16_t)ethaddr->addr[0], (u16_t)ethaddr->addr[1], (u16_t)ethaddr->addr[2], (u16_t)ethaddr->addr[3], (u16_t)ethaddr->addr[4], (u16_t)ethaddr->addr[5])); diff --git a/Project/Src/rt-thread/components/net/lwip-2.1.0/src/core/ipv4/ip4.c b/Project/Src/rt-thread/components/net/lwip-2.1.0/src/core/ipv4/ip4.c index ed8ebe3..9248f4f 100644 --- a/Project/Src/rt-thread/components/net/lwip-2.1.0/src/core/ipv4/ip4.c +++ b/Project/Src/rt-thread/components/net/lwip-2.1.0/src/core/ipv4/ip4.c @@ -1096,7 +1096,7 @@ ip4_debug_print(struct pbuf *p) LWIP_DEBUGF(IP_DEBUG, ("IP header:\n")); LWIP_DEBUGF(IP_DEBUG, ("+-------------------------------+\n")); - LWIP_DEBUGF(IP_DEBUG, ("|%2"S16_F" |%2"S16_F" | 0x%02"X16_F" | %5"U16_F" | (v, hl, tos, len)\n", + LWIP_DEBUGF(IP_DEBUG, ("|%2"S16_F" |%2"S16_F" | 0x%"X16_F" | %5"U16_F" | (v, hl, tos, len)\n", (u16_t)IPH_V(iphdr), (u16_t)IPH_HL(iphdr), (u16_t)IPH_TOS(iphdr), @@ -1109,7 +1109,7 @@ ip4_debug_print(struct pbuf *p) (u16_t)(lwip_ntohs(IPH_OFFSET(iphdr)) >> 13 & 1), (u16_t)(lwip_ntohs(IPH_OFFSET(iphdr)) & IP_OFFMASK))); LWIP_DEBUGF(IP_DEBUG, ("+-------------------------------+\n")); - LWIP_DEBUGF(IP_DEBUG, ("| %3"U16_F" | %3"U16_F" | 0x%04"X16_F" | (ttl, proto, chksum)\n", + LWIP_DEBUGF(IP_DEBUG, ("| %3"U16_F" | %3"U16_F" | 0x%"X16_F" | (ttl, proto, chksum)\n", (u16_t)IPH_TTL(iphdr), (u16_t)IPH_PROTO(iphdr), lwip_ntohs(IPH_CHKSUM(iphdr)))); diff --git a/Project/Src/rt-thread/components/net/lwip-2.1.0/src/core/udp.c b/Project/Src/rt-thread/components/net/lwip-2.1.0/src/core/udp.c index 9d2cb4a..5feb52b 100644 --- a/Project/Src/rt-thread/components/net/lwip-2.1.0/src/core/udp.c +++ b/Project/Src/rt-thread/components/net/lwip-2.1.0/src/core/udp.c @@ -911,7 +911,7 @@ udp_sendto_if_src_chksum(struct udp_pcb *pcb, struct pbuf *p, const ip_addr_t *d /** * @ingroup udp_raw * Bind an UDP PCB. - * + * * @param pcb UDP PCB to be bound with a local address ipaddr and port. * @param ipaddr local IP address to bind with. Use IP_ANY_TYPE to * bind to all local interfaces. @@ -1168,8 +1168,8 @@ udp_recv(struct udp_pcb *pcb, udp_recv_fn recv, void *recv_arg) /** * @ingroup udp_raw - * Removes and deallocates the pcb. - * + * Removes and deallocates the pcb. + * * @param pcb UDP PCB to be removed. The PCB is removed from the list of * UDP PCB's and the data structure is freed from memory. * @@ -1242,7 +1242,7 @@ udp_new(void) * Create a UDP PCB for specific IP type. * The pcb is not active until it has either been bound to a local address * or connected to a remote address. - * + * * @param type IP address type, see @ref lwip_ip_addr_type definitions. * If you want to listen to IPv4 and IPv6 (dual-stack) packets, * supply @ref IPADDR_TYPE_ANY as argument and bind to @ref IP_ANY_TYPE. @@ -1305,7 +1305,7 @@ udp_debug_print(struct udp_hdr *udphdr) LWIP_DEBUGF(UDP_DEBUG, ("| %5"U16_F" | %5"U16_F" | (src port, dest port)\n", lwip_ntohs(udphdr->src), lwip_ntohs(udphdr->dest))); LWIP_DEBUGF(UDP_DEBUG, ("+-------------------------------+\n")); - LWIP_DEBUGF(UDP_DEBUG, ("| %5"U16_F" | 0x%04"X16_F" | (len, chksum)\n", + LWIP_DEBUGF(UDP_DEBUG, ("| %5"U16_F" | 0x%"X16_F" | (len, chksum)\n", lwip_ntohs(udphdr->len), lwip_ntohs(udphdr->chksum))); LWIP_DEBUGF(UDP_DEBUG, ("+-------------------------------+\n")); } diff --git a/Project/Src/rt-thread/components/net/lwip-2.1.0/src/include/lwip/arch.h b/Project/Src/rt-thread/components/net/lwip-2.1.0/src/include/lwip/arch.h index 58dae33..fb5cab7 100644 --- a/Project/Src/rt-thread/components/net/lwip-2.1.0/src/include/lwip/arch.h +++ b/Project/Src/rt-thread/components/net/lwip-2.1.0/src/include/lwip/arch.h @@ -74,7 +74,7 @@ /** Platform specific diagnostic output.\n * Note the default implementation pulls in printf, which may - * in turn pull in a lot of standard libary code. In resource-constrained + * in turn pull in a lot of standard libary code. In resource-constrained * systems, this should be defined to something less resource-consuming. */ #ifndef LWIP_PLATFORM_DIAG @@ -85,7 +85,7 @@ /** Platform specific assertion handling.\n * Note the default implementation pulls in printf, fflush and abort, which may - * in turn pull in a lot of standard libary code. In resource-constrained + * in turn pull in a lot of standard libary code. In resource-constrained * systems, this should be defined to something less resource-consuming. */ #ifndef LWIP_PLATFORM_ASSERT @@ -147,7 +147,7 @@ typedef uintptr_t mem_ptr_t; #if !LWIP_NO_INTTYPES_H #include #ifndef X8_F -#define X8_F "02" PRIx8 +#define X8_F "02x" #endif #ifndef U16_F #define U16_F PRIu16 @@ -156,7 +156,7 @@ typedef uintptr_t mem_ptr_t; #define S16_F PRId16 #endif #ifndef X16_F -#define X16_F PRIx16 +#define X16_F "04x" #endif #ifndef U32_F #define U32_F PRIu32 diff --git a/Project/Src/rt-thread/components/net/lwip-2.1.0/src/netif/ethernet.c b/Project/Src/rt-thread/components/net/lwip-2.1.0/src/netif/ethernet.c index dd171e2..8d093b9 100644 --- a/Project/Src/rt-thread/components/net/lwip-2.1.0/src/netif/ethernet.c +++ b/Project/Src/rt-thread/components/net/lwip-2.1.0/src/netif/ethernet.c @@ -85,6 +85,7 @@ ethernet_input(struct pbuf *p, struct netif *netif) #if LWIP_ARP || ETHARP_SUPPORT_VLAN || LWIP_IPV6 u16_t next_hdr_offset = SIZEOF_ETH_HDR; #endif /* LWIP_ARP || ETHARP_SUPPORT_VLAN */ + LWIP_DEBUGF(ETHARP_DEBUG, ("recv %d bytes\n", p->len)); LWIP_ASSERT_CORE_LOCKED(); diff --git a/Project/Src/rt-thread/rtconfig.h b/Project/Src/rt-thread/rtconfig.h index 07a2c30..b28235f 100644 --- a/Project/Src/rt-thread/rtconfig.h +++ b/Project/Src/rt-thread/rtconfig.h @@ -217,7 +217,16 @@ #define RT_USING_LIBC #define RT_LWIP_TCP #define RT_LWIP_UDP +#define RT_LWIP_ICMP #define RT_LWIP_DEBUG +#define RT_LWIP_TCPIP_DEBUG +#define RT_LWIP_NETIF_DEBUG +#define RT_LWIP_ETHARP_DEBUG +#define RT_LWIP_IP_DEBUG +#define RT_LWIP_UDP_DEBUG +#define RT_LWIP_DHCP +#define RT_LWIP_IGMP +#define RT_LWIP_RAW // <<< end of configuration section >>>