diff --git a/.gitmodules b/.gitmodules index 0bec643f7d..a32e4f5042 100644 --- a/.gitmodules +++ b/.gitmodules @@ -57,3 +57,7 @@ path = Sming/third-party/lwip2 url = https://github.com/d-a-v/esp82xx-nonos-linklayer.git ignore = dirty +[submodule "Sming/third-party/ESP8266_NONOS_SDK"] + path = Sming/third-party/ESP8266_NONOS_SDK + url = https://github.com/espressif/ESP8266_NONOS_SDK.git + ignore = dirty diff --git a/.travis.yml b/.travis.yml index d9c3e9b868..1d017afebf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,6 +12,8 @@ matrix: env: SDK_VERSION=1.5.0 - os: linux env: SDK_VERSION=2.0.0 + - os: linux + env: SDK_VERSION=2.1.0 git: submodules: false @@ -29,12 +31,12 @@ addons: - graphviz install: - - if [ "$SDK_VERSION" != "2.0.0" ] && [ "$TRAVIS_OS_NAME" == "osx" ]; then export SDK_FILE_NAME="esp-alt-sdk-v${SDK_VERSION}.${SDK_BUILD}-macos-x86_64.zip"; fi - - if [ "$SDK_VERSION" != "2.0.0" ] && [ "$TRAVIS_OS_NAME" == "linux" ]; then export SDK_FILE_NAME="esp-alt-sdk-v${SDK_VERSION}.${SDK_BUILD}-linux-x86_64.tar.gz"; fi + - if [ "$SDK_VERSION" == "1.5.0" ] && [ "$TRAVIS_OS_NAME" == "osx" ]; then export SDK_FILE_NAME="esp-alt-sdk-v${SDK_VERSION}.${SDK_BUILD}-macos-x86_64.zip"; fi + - if [ "$SDK_VERSION" == "1.5.0" ] && [ "$TRAVIS_OS_NAME" == "linux" ]; then export SDK_FILE_NAME="esp-alt-sdk-v${SDK_VERSION}.${SDK_BUILD}-linux-x86_64.tar.gz"; fi - mkdir -p $TRAVIS_BUILD_DIR/opt/esp-alt-sdk - - if [ "$SDK_VERSION" != "2.0.0" ]; then wget https://bintray.com/artifact/download/kireevco/generic/${SDK_FILE_NAME}; fi - - if [ "$SDK_VERSION" != "2.0.0" ]; then bsdtar -xf ${SDK_FILE_NAME} -C $TRAVIS_BUILD_DIR/opt/esp-alt-sdk; fi - - if [ "$SDK_VERSION" == "2.0.0" ] && [ "$TRAVIS_OS_NAME" == "linux" ]; then wget https://github.com/nodemcu/nodemcu-firmware/raw/master/tools/esp-open-sdk.tar.xz; tar -Jxvf esp-open-sdk.tar.xz; ln -s `pwd`/esp-open-sdk/xtensa-lx106-elf $TRAVIS_BUILD_DIR/opt/esp-alt-sdk/. ; fi + - if [ "$SDK_VERSION" == "1.5.0" ]; then wget https://bintray.com/artifact/download/kireevco/generic/${SDK_FILE_NAME}; fi + - if [ "$SDK_VERSION" == "1.5.0" ]; then bsdtar -xf ${SDK_FILE_NAME} -C $TRAVIS_BUILD_DIR/opt/esp-alt-sdk; fi + - if [[ "$SDK_VERSION" != "1.5.0" && "$TRAVIS_OS_NAME" == "linux" ]]; then wget https://github.com/nodemcu/nodemcu-firmware/raw/master/tools/esp-open-sdk.tar.xz; tar -Jxvf esp-open-sdk.tar.xz; ln -s `pwd`/esp-open-sdk/xtensa-lx106-elf $TRAVIS_BUILD_DIR/opt/esp-alt-sdk/. ; fi - if [ "$SDK_VERSION" == "2.0.0" ] && [ "$TRAVIS_OS_NAME" == "linux" ]; then wget http://bbs.espressif.com/download/file.php?id=1690 -O sdk.zip; unzip sdk.zip; ln -s `pwd`/ESP8266_NONOS_SDK/ $TRAVIS_BUILD_DIR/opt/esp-alt-sdk/sdk; export DEPLOY='true'; fi script: @@ -42,6 +44,7 @@ script: - export CHANGED_PROJECTS=`for i in $CHANGED_FILES; do echo "$i" | grep '^samples/' | cut -d'/' -f2; done | uniq` - export SMING_HOME=$TRAVIS_BUILD_DIR/Sming - export ESP_HOME=$TRAVIS_BUILD_DIR/opt/esp-alt-sdk + - if [ "$SDK_VERSION" == "2.1.0" ]; then export SDK_BASE=$SMING_HOME/third-party/ESP8266_NONOS_SDK; fi - export PATH=$PATH:$ESP_HOME/xtensa-lx106-elf/bin:$ESP_HOME/utils/:$SMING_HOME/../.travis/tools - cd $SMING_HOME - make test diff --git a/Sming/Makefile b/Sming/Makefile index b70cd2594b..d47f0e8e75 100644 --- a/Sming/Makefile +++ b/Sming/Makefile @@ -173,11 +173,17 @@ THIRD_PARTY_DATA += third-party/http-parser/Makefile MODULES += third-party/http-parser/ EXTRA_INCDIR += third-party/http-parser/ -# => webscoket-parser +# => websocket-parser THIRD_PARTY_DATA += third-party/ws_parser/Makefile MODULES += third-party/ws_parser/ EXTRA_INCDIR += third-party/ws_parser/ +# => SDK +ifneq (,$(findstring third-party/ESP8266_NONOS_SDK, $(SDK_BASE))) + THIRD_PARTY_DATA += third-party/ESP8266_NONOS_SDK/Makefile + CFLAGS += -DSDK_INTERNAL +endif + # => esp-gdbstub ifeq ($(ENABLE_GDB), 1) THIRD_PARTY_DATA += third-party/esp-gdbstub/Makefile @@ -240,7 +246,7 @@ endif MFORCE32 := $(shell $(CC) --help=target | grep mforce-l32) # compiler flags using during compilation of source files. Add '-pg' for debugging -CFLAGS = -Wpointer-arith -Wundef -Werror -Wl,-EL -nostdlib -mlongcalls -mtext-section-literals -finline-functions -fdata-sections -ffunction-sections \ +CFLAGS += -Wpointer-arith -Wundef -Werror -Wl,-EL -nostdlib -mlongcalls -mtext-section-literals -finline-functions -fdata-sections -ffunction-sections \ -D__ets__ -DICACHE_FLASH -DARDUINO=106 -DCOM_SPEED_SERIAL=$(COM_SPEED_SERIAL) -DENABLE_CMD_EXECUTOR=$(ENABLE_CMD_EXECUTOR) -DESP8266=1 ifeq ($(SMING_RELEASE),1) # See: https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html diff --git a/Sming/Makefile-project.mk b/Sming/Makefile-project.mk index 7e52eea2c4..18e1ccd814 100644 --- a/Sming/Makefile-project.mk +++ b/Sming/Makefile-project.mk @@ -227,6 +227,10 @@ endif # compiler flags using during compilation of source files CFLAGS = -Wpointer-arith -Wundef -Werror -Wl,-EL -nostdlib -mlongcalls -mtext-section-literals -finline-functions -fdata-sections -ffunction-sections -D__ets__ -DICACHE_FLASH -DARDUINO=106 -DCOM_SPEED_SERIAL=$(COM_SPEED_SERIAL) $(USER_CFLAGS) -DENABLE_CMD_EXECUTOR=$(ENABLE_CMD_EXECUTOR) +# => SDK +ifneq (,$(findstring third-party/ESP8266_NONOS_SDK, $(SDK_BASE))) + CFLAGS += -DSDK_INTERNAL +endif ifeq ($(SMING_RELEASE),1) # See: https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html # for full list of optimization options diff --git a/Sming/Makefile-rboot.mk b/Sming/Makefile-rboot.mk index 9ac90dc0bb..c7d983aa3d 100644 --- a/Sming/Makefile-rboot.mk +++ b/Sming/Makefile-rboot.mk @@ -198,6 +198,10 @@ USER_LIBDIR = $(SMING_HOME)/compiler/lib/ # compiler flags using during compilation of source files CFLAGS = -Wpointer-arith -Wundef -Werror -Wl,-EL -nostdlib -mlongcalls -mtext-section-literals -finline-functions -fdata-sections -ffunction-sections -D__ets__ -DICACHE_FLASH -DARDUINO=106 -DCOM_SPEED_SERIAL=$(COM_SPEED_SERIAL) $(USER_CFLAGS) -DENABLE_CMD_EXECUTOR=$(ENABLE_CMD_EXECUTOR) +# => SDK +ifneq (,$(findstring third-party/ESP8266_NONOS_SDK, $(SDK_BASE))) + CFLAGS += -DSDK_INTERNAL +endif ifeq ($(SMING_RELEASE),1) # See: https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html # for full list of optimization options diff --git a/Sming/SmingCore/HardwareTimer.cpp b/Sming/SmingCore/HardwareTimer.cpp index 4ee271f53e..2026293f22 100644 --- a/Sming/SmingCore/HardwareTimer.cpp +++ b/Sming/SmingCore/HardwareTimer.cpp @@ -48,12 +48,12 @@ static void IRAM_ATTR hw_timer_isr_cb(void *arg) Hardware_Timer::Hardware_Timer() { - ETS_FRC_TIMER1_INTR_ATTACH((void*)hw_timer_isr_cb, (void *)this); + ETS_FRC_TIMER1_INTR_ATTACH((ets_isr_t)hw_timer_isr_cb, (void *)this); } Hardware_Timer::~Hardware_Timer() { - ETS_FRC_TIMER1_INTR_ATTACH((void*)hw_timer_isr_cb, null); + ETS_FRC_TIMER1_INTR_ATTACH((ets_isr_t)hw_timer_isr_cb, null); stop(); } diff --git a/Sming/SmingCore/Interrupts.cpp b/Sming/SmingCore/Interrupts.cpp index 7f775e8a2c..d00df45e63 100644 --- a/Sming/SmingCore/Interrupts.cpp +++ b/Sming/SmingCore/Interrupts.cpp @@ -47,7 +47,7 @@ void attachInterruptHandler(uint8_t pin, GPIO_INT_TYPE mode) if (!_gpioInterruptsInitialied) { - ETS_GPIO_INTR_ATTACH((void*)interruptHandler, NULL); // Register interrupt handler + ETS_GPIO_INTR_ATTACH((ets_isr_t)interruptHandler, NULL); // Register interrupt handler _gpioInterruptsInitialied = true; } diff --git a/Sming/SmingCore/SPI.cpp b/Sming/SmingCore/SPI.cpp index 117afad5e4..b3f1787485 100644 --- a/Sming/SmingCore/SPI.cpp +++ b/Sming/SmingCore/SPI.cpp @@ -20,8 +20,7 @@ #include #include "eagle_soc.h" #include "espinc/spi_register.h" -#include "espinc/c_types_compatible.h" - +#include "c_types.h" // define the static singleton SPIClass SPI; diff --git a/Sming/compiler/ld/common.ld b/Sming/compiler/ld/common.ld index 461fff9c50..a76fd0ea2e 100644 --- a/Sming/compiler/ld/common.ld +++ b/Sming/compiler/ld/common.ld @@ -152,11 +152,36 @@ SECTIONS .irom0.text : ALIGN(4) { _irom0_text_start = ABSOLUTE(.); + + *libsmartconfig.a:(.literal .text .literal.* .text.*) + *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.*) + *libespnow.a:(.literal.* .text.*) + *libjson.a:(.literal.* .text.*) + *liblwip.a:(.literal.* .text.*) + *libmesh.a:(.literal.* .text.*) + *libnet80211.a:(.literal.* .text.*) + *libsmartconfig.a:(.literal.* .text.*) + *libssl.a:(.literal.* .text.*) + *libupgrade.a:(.literal.* .text.*) + *libwpa.a:(.literal.* .text.*) + *libwpa2.a:(.literal.* .text.*) + *libwps.a:(.literal.* .text.*) + + *libmbedtls.a:(.literal.* .text.*) + + *libm.a:(.literal .text .literal.* .text.*) + *(.irom0.literal .irom.literal .irom.text.literal .irom0.text .irom.text .irom.debug.*) 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/include/user_config.h b/Sming/include/user_config.h index d498e0d580..ea24da560e 100644 --- a/Sming/include/user_config.h +++ b/Sming/include/user_config.h @@ -17,13 +17,17 @@ extern "C" { #include #include - // Override c_types.h include and remove buggy espconn - #define _C_TYPES_H_ + // Remove buggy espconn #define _NO_ESPCON_ - // Updated, compatible version of c_types.h - // Just removed types declared in +#ifdef SDK_INTERNAL + // ESP SDK 2.1 or later provide proper c_types.h + #include "c_types.h" +#else + // Older SDKs, have wrong or incompatible c_types type definitions + #define _C_TYPES_H_ #include +#endif /* SDK_INTERNAL */ // System API declarations #include diff --git a/Sming/system/include/esp_systemapi.h b/Sming/system/include/esp_systemapi.h index 19e303742e..4c964a2a54 100644 --- a/Sming/system/include/esp_systemapi.h +++ b/Sming/system/include/esp_systemapi.h @@ -44,6 +44,7 @@ #define assert(condition) if (!(condition)) SYSTEM_ERROR("ASSERT: %s %d", __FUNCTION__, __LINE__) #define SYSTEM_ERROR(fmt, ...) m_printf("ERROR: " fmt "\r\n", ##__VA_ARGS__) +#ifndef SDK_INTERNAL extern void ets_timer_arm_new(ETSTimer *ptimer, uint32_t milliseconds, bool repeat_flag, int isMstimer); extern void ets_timer_disarm(ETSTimer *a); extern void ets_timer_setfn(ETSTimer *t, ETSTimerFunc *pfunction, void *parg); @@ -57,13 +58,18 @@ extern void ets_delay_us(uint32_t us); extern void ets_isr_mask(unsigned intr); extern void ets_isr_unmask(unsigned intr); -extern void ets_isr_attach(int intr, void *handler, void *arg); + +typedef void (* ets_isr_t)(void *); + +//extern void ets_isr_attach(int intr, void *handler, void *arg); +extern void ets_isr_attach(int i, ets_isr_t func, void *arg); extern int ets_memcmp(const void *s1, const void *s2, size_t n); extern void *ets_memcpy(void *dest, const void *src, size_t n); extern void *ets_memset(void *s, int c, size_t n); -extern void ets_install_putc1(void *routine); +//extern void ets_install_putc1(void *routine); +extern void ets_install_putc1(void (*p)(char c)); extern int ets_sprintf(char *str, const char *format, ...) __attribute__ ((format (printf, 2, 3))); extern int ets_str2macaddr(void *, void *); extern int ets_strcmp(const char *s1, const char *s2); @@ -71,8 +77,8 @@ extern char *ets_strcpy(char *dest, const char *src); //extern int os_random(); //extern char *ets_strdup(const char *str); // :( const char * ets_strrchr(const char *str, int character); -extern size_t ets_strlen(const char *s); -extern int ets_strncmp(const char *s1, const char *s2, int len); +extern int ets_strlen(const char *s); +extern int ets_strncmp(const char *s1, const char *s2, unsigned int len); extern char *ets_strncpy(char *dest, const char *src, size_t n); extern char *ets_strstr(const char *haystack, const char *needle); extern int os_printf_plus(const char *format, ...) __attribute__ ((format (printf, 1, 2))); @@ -85,13 +91,15 @@ extern void pvPortFree(void *ptr); extern void vPortFree(void *ptr, const char *file, uint32 line); extern void *vPortMalloc(size_t xWantedSize); -extern void uart_div_modify(int no, unsigned int freq); +extern void uart_div_modify(uint8 uart_no, uint32 DivLatchValue); extern int ets_uart_printf(const char *fmt, ...); extern void uart_tx_one_char(char ch); extern void ets_intr_lock(); extern void ets_intr_unlock(); +#endif /* SDK_INTERNAL */ + // CPU Frequency extern void ets_update_cpu_frequency(uint32_t frq); extern uint32_t ets_get_cpu_frequency(); @@ -99,6 +107,10 @@ extern uint32_t ets_get_cpu_frequency(); extern void xt_disable_interrupts(); extern void xt_enable_interrupts(); +extern void uart_tx_one_char(char ch); +extern void ets_isr_mask(unsigned intr); +extern void ets_isr_unmask(unsigned intr); + typedef signed short file_t; #endif diff --git a/Sming/system/uart.cpp b/Sming/system/uart.cpp index 87e95f0903..e2bc99ca00 100644 --- a/Sming/system/uart.cpp +++ b/Sming/system/uart.cpp @@ -139,8 +139,7 @@ void uart_start_isr(uart_t* uart) USC1(uart->uart_nr) = (127 << UCFFT) | (0x02 << UCTOT) | (1 <uart_nr) = 0xffff; USIE(uart->uart_nr) = (1 << UIFF) | (1 << UIFR) | (1 << UITO); -// ETS_UART_INTR_ATTACH(uart_isr, (void *)uart); - ETS_UART_INTR_ATTACH((void *)uart_isr, (void *)uart); + ETS_UART_INTR_ATTACH(uart_isr, (void *)uart); ETS_UART_INTR_ENABLE(); } @@ -492,16 +491,16 @@ 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/ESP8266_NONOS_SDK.patch b/Sming/third-party/.patches/ESP8266_NONOS_SDK.patch new file mode 100644 index 0000000000..1b0e3351ed --- /dev/null +++ b/Sming/third-party/.patches/ESP8266_NONOS_SDK.patch @@ -0,0 +1,13 @@ +diff --git a/include/osapi.h b/include/osapi.h +index 0462a9c..52ad21f 100644 +--- a/include/osapi.h ++++ b/include/osapi.h +@@ -30,7 +30,7 @@ + #include "user_config.h" + + void ets_bzero(void *s, size_t n); +-void ets_delay_us(uint16_t us); ++void ets_delay_us(uint32_t us); + void ets_install_putc1(void (*p)(char c)); + + #define os_bzero ets_bzero diff --git a/Sming/third-party/.patches/esp-gdbstub.patch b/Sming/third-party/.patches/esp-gdbstub.patch index c6ec250659..0bb2a20791 100644 --- a/Sming/third-party/.patches/esp-gdbstub.patch +++ b/Sming/third-party/.patches/esp-gdbstub.patch @@ -1,5 +1,5 @@ diff --git a/gdbstub.c b/gdbstub.c -index 5fc6633..03f6d49 100644 +index 5fc6633..fe655b8 100644 --- a/gdbstub.c +++ b/gdbstub.c @@ -8,6 +8,7 @@ @@ -42,3 +42,12 @@ index 5fc6633..03f6d49 100644 while(gdbReadCommand()!=ST_CONT); ets_wdt_enable(); //Copy any changed registers back to the frame the Xtensa HAL uses. +@@ -714,7 +719,7 @@ static void ATTR_GDBFN uart_hdlr(void *arg, void *frame) { + } + + static void ATTR_GDBINIT install_uart_hdlr() { +- ets_isr_attach(ETS_UART_INUM, uart_hdlr, NULL); ++ ets_isr_attach(ETS_UART_INUM, (ets_isr_t)uart_hdlr, NULL); + SET_PERI_REG_MASK(UART_INT_ENA(0), UART_RXFIFO_FULL_INT_ENA|UART_RXFIFO_TOUT_INT_ENA); + ets_isr_unmask((1< + #define EFAULT 14 @@ -90,7 +92,7 @@ index ff03b30..6664d59 100644 +extern void *ets_memset(void *s, int c, size_t n); +extern void *ets_memcpy(void *dest, const void *src, size_t n); + -+extern size_t ets_strlen(const char *s); ++extern int ets_strlen(const char *s); +extern int os_printf_plus(const char *format, ...) __attribute__ ((format (printf, 1, 2))); +extern int ets_sprintf(char *str, const char *format, ...) __attribute__ ((format (printf, 2, 3))); +//extern void ets_timer_arm_new(ETSTimer *ptimer, uint32_t milliseconds, bool repeat_flag, int isMstimer); @@ -104,7 +106,7 @@ index ff03b30..6664d59 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..6664d59 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 @@ -247,7 +249,7 @@ index af6e360..6d8cabd 100644 #endif #else #ifndef mem_free - diff --git a/lwip/app/dhcpserver.c b/lwip/app/dhcpserver.c +diff --git a/lwip/app/dhcpserver.c b/lwip/app/dhcpserver.c index ddb5984..fb677c6 100644 --- a/lwip/app/dhcpserver.c +++ b/lwip/app/dhcpserver.c 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*); diff --git a/Sming/third-party/.patches/pwm.patch b/Sming/third-party/.patches/pwm.patch index 7f59825408..bd2b382c65 100644 --- a/Sming/third-party/.patches/pwm.patch +++ b/Sming/third-party/.patches/pwm.patch @@ -1,25 +1,22 @@ diff --git a/pwm.c b/pwm.c -index 5e7f218..51bdf35 100644 +index 5e7f218..0386a06 100644 --- a/pwm.c +++ b/pwm.c -@@ -18,6 +18,8 @@ +@@ -16,6 +16,8 @@ + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ ++#include ++ /* Set the following three defines to your needs */ -+#include -+ #ifndef SDK_PWM_PERIOD_COMPAT_MODE - #define SDK_PWM_PERIOD_COMPAT_MODE 0 - #endif -@@ -42,6 +44,11 @@ - #define PWM_MAX_PERIOD PWM_MAX_TICKS - #endif +@@ -109,7 +111,7 @@ struct timer_regs { + }; + static struct timer_regs* timer = (void*)(0x60000600); -+/* ISR related definitions that are missing in some SDKs */ -+extern void ets_isr_attach(int intr, void *handler, void *arg); -+extern void ets_isr_mask(unsigned intr); -+extern void ets_isr_unmask(unsigned intr); -+ - #include - #include - #include +-static void pwm_intr_handler(void) ++static void pwm_intr_handler(void* param) + { + if ((pwm_state.current_set[pwm_state.current_phase].off_mask == 0) && + (pwm_state.current_set[pwm_state.current_phase].on_mask == 0)) { diff --git a/Sming/third-party/ESP8266_NONOS_SDK b/Sming/third-party/ESP8266_NONOS_SDK new file mode 160000 index 0000000000..61248df5f6 --- /dev/null +++ b/Sming/third-party/ESP8266_NONOS_SDK @@ -0,0 +1 @@ +Subproject commit 61248df5f6d45d130313b412f7492f581fd4cadf