From 40c640d15bbb62fd4de6a12ba5d7c70e90d4caad Mon Sep 17 00:00:00 2001 From: Slavey Karadzhov Date: Wed, 22 Nov 2017 21:34:12 +0100 Subject: [PATCH] Fixes after syncing with latest Sming from develop. --- Sming/compiler/ld/common.ld | 3 +- Sming/system/uart.cpp | 3 -- .../third-party/.patches/esp-open-lwip.patch | 14 ++--- Sming/third-party/.patches/lwip2.patch | 51 +++++++++++++++++++ 4 files changed, 61 insertions(+), 10 deletions(-) diff --git a/Sming/compiler/ld/common.ld b/Sming/compiler/ld/common.ld index 388b9bf1d2..a76fd0ea2e 100644 --- a/Sming/compiler/ld/common.ld +++ b/Sming/compiler/ld/common.ld @@ -157,6 +157,7 @@ SECTIONS *libstdc++.a:(.literal .text .literal.* .text.*) *liblwip_open.a:(.literal .text .literal.* .text.*) *liblwip_full.a:(.literal .text .literal.* .text.*) + *liblwip2.a:(.literal .text .literal.* .text.*) *libaxtls.a:(.literal .text .literal.* .text.*) *libat.a:(.literal.* .text.*) *libcrypto.a:(.literal.* .text.*) @@ -180,7 +181,7 @@ SECTIONS out/build/app_app.a:*(.literal .text .literal.* .text.* .stub .gnu.warning .gnu.linkonce.literal.* .gnu.linkonce.t.*.literal .gnu.linkonce.t.* .irom.debug.*) *libsming.a:*(.literal .text .literal.* .text.* .stub .gnu.warning .gnu.linkonce.literal.* .gnu.linkonce.t.*.literal .gnu.linkonce.t.* .irom.debug.*) *libsmingssl.a:*(.literal .text .literal.* .text.* .stub .gnu.warning .gnu.linkonce.literal.* .gnu.linkonce.t.*.literal .gnu.linkonce.t.* .irom.debug.*) - *liblwip2.a:(.literal .text .literal.* .text.*) + _irom0_text_end = ABSOLUTE(.); _flash_code_end = ABSOLUTE(.); } >irom0_0_seg :irom0_0_phdr diff --git a/Sming/system/uart.cpp b/Sming/system/uart.cpp index f91fd0a73a..e2bc99ca00 100644 --- a/Sming/system/uart.cpp +++ b/Sming/system/uart.cpp @@ -491,18 +491,15 @@ void uart_set_debug(int uart_nr) switch(s_uart_debug_nr) { case UART0: system_set_os_print(1); - ets_install_putc1((void *) &uart0_write_char); ets_install_putc1(uart0_write_char); break; case UART1: system_set_os_print(1); - ets_install_putc1((void *) &uart1_write_char); ets_install_putc1(uart1_write_char); break; case UART_NO: default: system_set_os_print(0); - ets_install_putc1((void *) &uart_ignore_char); ets_install_putc1(uart_ignore_char); break; } diff --git a/Sming/third-party/.patches/esp-open-lwip.patch b/Sming/third-party/.patches/esp-open-lwip.patch index 5e4ae13282..b06d82dd7a 100644 --- a/Sming/third-party/.patches/esp-open-lwip.patch +++ b/Sming/third-party/.patches/esp-open-lwip.patch @@ -1,8 +1,8 @@ diff --git a/include/user_config.h b/include/user_config.h -index e69de29..235ceff 100644 +index e69de29..d608ddf 100644 --- a/include/user_config.h +++ b/include/user_config.h -@@ -0,0 +1,20 @@ +@@ -0,0 +1,21 @@ +#ifndef _USER_CONFIG_LWIP_ +#define _USER_CONFIG_LWIP_ + @@ -10,6 +10,7 @@ index e69de29..235ceff 100644 +extern "C" { +#endif + ++#include "c_types.h" +typedef signed short sint16_t; + +void ets_bzero(void *block, size_t size); @@ -75,13 +76,14 @@ index 1bc584f..e4af916 100644 $(LIB): $(OBJS) $(AR) rcs $@ $^ diff --git a/include/arch/cc.h b/include/arch/cc.h -index ff03b30..0da8ed3 100644 +index ff03b30..348ee12 100644 --- a/include/arch/cc.h +++ b/include/arch/cc.h -@@ -38,8 +38,25 @@ +@@ -38,8 +38,26 @@ #include "c_types.h" #include "ets_sys.h" #include "osapi.h" ++#include "mem.h" +#include + #define EFAULT 14 @@ -104,7 +106,7 @@ index ff03b30..0da8ed3 100644 //#define LWIP_PROVIDE_ERRNO #if (1) -@@ -56,6 +73,7 @@ typedef signed short s16_t; +@@ -56,6 +74,7 @@ typedef signed short s16_t; typedef unsigned long u32_t; typedef signed long s32_t; typedef unsigned long mem_ptr_t; @@ -112,7 +114,7 @@ index ff03b30..0da8ed3 100644 #define S16_F "d" #define U16_F "d" -@@ -73,11 +91,12 @@ typedef unsigned long mem_ptr_t; +@@ -73,11 +92,12 @@ typedef unsigned long mem_ptr_t; #define PACK_STRUCT_BEGIN #define PACK_STRUCT_END diff --git a/Sming/third-party/.patches/lwip2.patch b/Sming/third-party/.patches/lwip2.patch index 5c772b6ef5..c752f3eef3 100644 --- a/Sming/third-party/.patches/lwip2.patch +++ b/Sming/third-party/.patches/lwip2.patch @@ -23,3 +23,54 @@ index 63cd72d..5f100eb 100644 #ifdef LWIP_BUILD // define LWIP_BUILD only when building LWIP +diff --git a/Makefile.sming b/Makefile.sming +index 842f4fe..7550a72 100644 +--- a/Makefile.sming ++++ b/Makefile.sming +@@ -4,12 +4,13 @@ + USER_LIBDIR ?= tweaked- + LWIP_LIB_RELEASE=$(USER_LIBDIR)liblwip2.a + LWIP_INCLUDES_RELEASE=include ++SDK_BASE ?= $(ESP_HOME)/sdk + + all: install + + %: + @make -f makefiles/Makefile.build-lwip2 \ +- SDK=$(ESP_HOME)/sdk \ ++ SDK=$(SDK_BASE) \ + LWIP_LIB=liblwip2.a \ + LWIP_LIB_RELEASE=$(LWIP_LIB_RELEASE) \ + LWIP_INCLUDES_RELEASE=$(LWIP_INCLUDES_RELEASE) \ +diff --git a/glue/esp-missing.h b/glue/esp-missing.h +index 0e42073..4cb5d6c 100644 +--- a/glue/esp-missing.h ++++ b/glue/esp-missing.h +@@ -9,9 +9,9 @@ + + uint32_t r_rand (void); + +-void* pvPortZalloc (size_t, const char*, int); +-void* pvPortMalloc (size_t xWantedSize, const char* file, int line) __attribute__((malloc, alloc_size(1))); +-void vPortFree (void *ptr, const char* file, int line); ++void* pvPortZalloc (size_t, const char*, unsigned line); ++void* pvPortMalloc (size_t xWantedSize, const char* file, unsigned line) __attribute__((malloc, alloc_size(1))); ++void vPortFree (void *ptr, const char* file, unsigned line); + + struct netif* eagle_lwip_getif (int netif_index); + +@@ -27,10 +27,10 @@ int ets_memcmp (const void*, const void*, size_t n); + void *ets_memset (void *s, int c, size_t n); + void *ets_memcpy (void *dest, const void *src, size_t n); + +-typedef void ETSTimerFunc(void *timer_arg); +-void ets_timer_disarm (ETSTimer *a); +-void ets_timer_arm_new (ETSTimer *a, int b, int c, int isMstimer); +-void ets_timer_setfn (ETSTimer *t, ETSTimerFunc *fn, void *parg); ++//typedef void ETSTimerFunc(void *timer_arg); ++//void ets_timer_disarm (ETSTimer *a); ++//void ets_timer_arm_new (ETSTimer *a, int b, int c, int isMstimer); ++//void ets_timer_setfn (ETSTimer *t, ETSTimerFunc *fn, void *parg); + + struct ip_addr; + void wifi_softap_set_station_info (uint8_t* mac, struct ip_addr*);