From 7c982da48f2535b8d6795ec2b59525fac9742267 Mon Sep 17 00:00:00 2001 From: Angus Gratton Date: Thu, 21 May 2015 12:59:23 +1000 Subject: [PATCH] Add function prototypes for LWIP SDK functions, allow compilng with -Werror again --- examples/http_get/main.c | 2 +- include/espressif/blob_prototypes.h | 20 ----------------- include/espressif/sdk_prototypes.h | 35 +++++++++++++++++++++++++++++ lwip/component.mk | 2 +- lwip/include/arch/cc.h | 3 +++ lwip/lwip | 2 +- 6 files changed, 41 insertions(+), 23 deletions(-) delete mode 100644 include/espressif/blob_prototypes.h create mode 100644 include/espressif/sdk_prototypes.h diff --git a/examples/http_get/main.c b/examples/http_get/main.c index e08d895..199f1a7 100644 --- a/examples/http_get/main.c +++ b/examples/http_get/main.c @@ -9,7 +9,7 @@ #include "lwip/netdb.h" #include "lwip/dns.h" -#include "espressif/blob_prototypes.h" +#include "espressif/sdk_prototypes.h" #define WEB_SERVER "chainxor.org" #define WEB_PORT 80 diff --git a/include/espressif/blob_prototypes.h b/include/espressif/blob_prototypes.h deleted file mode 100644 index c1d42e7..0000000 --- a/include/espressif/blob_prototypes.h +++ /dev/null @@ -1,20 +0,0 @@ -/* This source file contains function prototypes for public functions defined in the - "binary blob" ESP8266 libraries. Sorted by which library they appear in. -*/ -#ifndef BLOB_PROTOTYPES_H -#define BLOB_PROTOTYPES_H - -#include - -/********************************************* -* libmain.a */ - -/* Change UART divider without re-initialising UART. - - uart_no = 0 or 1 for which UART - new_divisor = Calculated in the form UART_CLK_FREQ / BAUD - */ -void uart_div_modify(uint32_t uart_no, uint32_t new_divisor); - - -#endif diff --git a/include/espressif/sdk_prototypes.h b/include/espressif/sdk_prototypes.h new file mode 100644 index 0000000..2817a72 --- /dev/null +++ b/include/espressif/sdk_prototypes.h @@ -0,0 +1,35 @@ +/* This source file contains function prototypes for functions defined + in the remaining "binary blob" ESP IoT RTOS SDK libraries. Sorted + by which library they appear in. +*/ +#ifndef SDK_PROTOTYPES_H +#define SDK_PROTOTYPES_H + +#include +struct ip_addr; + +/********************************************* +* Defined in libmain.a +********************************************* +*/ + +/* Change UART divider without re-initialising UART. + + uart_no = 0 or 1 for which UART + new_divisor = Calculated in the form UART_CLK_FREQ / BAUD + */ +void uart_div_modify(uint32_t uart_no, uint32_t new_divisor); + +/* Called when an IP gets set on the "station" (client) interface. + */ +void system_station_got_ip_set(struct ip_addr *ip_addr, struct ip_addr *sn_mask, struct ip_addr *gw_addr); + +/* This is a no-op wrapper around ppRecycleRxPkt, which is defined in libpp.a + + It's called when a pbuf is freed, and allows pp to reuse the 'eb' pointer to ESP-specific + pbuf data. (See esp-lwip pbuf.h) + */ +void system_pp_recycle_rx_pkt(void *eb); + + +#endif diff --git a/lwip/component.mk b/lwip/component.mk index a3ccb07..7f737a6 100644 --- a/lwip/component.mk +++ b/lwip/component.mk @@ -9,7 +9,7 @@ lwip_INC_DIR = # all in INC_DIRS, needed for normal operation lwip_SRC_DIR = $(ROOT)/lwip $(LWIP_DIR)api $(LWIP_DIR)core $(LWIP_DIR)core/ipv4 $(LWIP_DIR)netif # LWIP 1.4.1 generates a single warning so we need to disable -Werror when building it -lwip_CFLAGS = $(subst -Werror,,$(CFLAGS)) +lwip_CFLAGS = $(CFLAGS) -Wno-address $(eval $(call component_compile_rules,lwip)) diff --git a/lwip/include/arch/cc.h b/lwip/include/arch/cc.h index 67989f6..507409c 100644 --- a/lwip/include/arch/cc.h +++ b/lwip/include/arch/cc.h @@ -32,6 +32,9 @@ #ifndef __ARCH_CC_H__ #define __ARCH_CC_H__ +/* include ESP SDK prototypes as they're used in some LWIP routines */ +#include "espressif/sdk_prototypes.h" + /* Include some files for defining library routines */ #include /* printf, fflush, FILE */ #include /* abort */ diff --git a/lwip/lwip b/lwip/lwip index 808c242..f041c2e 160000 --- a/lwip/lwip +++ b/lwip/lwip @@ -1 +1 @@ -Subproject commit 808c24237c1e9a3862b2eb1e0a94fd34ede6ec79 +Subproject commit f041c2e4c4c57445cdd8ec7d674dede1be020f02