diff --git a/hardware/arduino/esp8266/cores/esp8266/main.cpp b/hardware/arduino/esp8266/cores/esp8266/main.cpp index 7a2c26273..4d69c2f48 100644 --- a/hardware/arduino/esp8266/cores/esp8266/main.cpp +++ b/hardware/arduino/esp8266/cores/esp8266/main.cpp @@ -46,6 +46,11 @@ extern void (*__init_array_end)(void); static cont_t g_cont; static os_event_t g_loop_queue[LOOP_QUEUE_SIZE]; +extern "C" void abort() +{ + while(1){} +} + extern "C" void esp_yield() { cont_yield(&g_cont); diff --git a/hardware/arduino/esp8266/cores/esp8266/new.cpp b/hardware/arduino/esp8266/cores/esp8266/new.cpp index cf6f89c17..b7d8f4d84 100644 --- a/hardware/arduino/esp8266/cores/esp8266/new.cpp +++ b/hardware/arduino/esp8266/cores/esp8266/new.cpp @@ -17,20 +17,27 @@ */ #include +extern "C" { +#include "ets_sys.h" +#include "os_type.h" +#include "osapi.h" +#include "mem.h" +#include "user_interface.h" +} void *operator new(size_t size) { - return malloc(size); + return os_malloc(size); } void *operator new[](size_t size) { - return malloc(size); + return os_malloc(size); } void operator delete(void * ptr) { - free(ptr); + os_free(ptr); } void operator delete[](void * ptr) { - free(ptr); + os_free(ptr); } diff --git a/hardware/arduino/esp8266/cores/esp8266/stdlib_noniso.c b/hardware/arduino/esp8266/cores/esp8266/stdlib_noniso.c index 6b623310e..5349d12c0 100644 --- a/hardware/arduino/esp8266/cores/esp8266/stdlib_noniso.c +++ b/hardware/arduino/esp8266/cores/esp8266/stdlib_noniso.c @@ -1,37 +1,47 @@ #include #include "stdlib_noniso.h" -char * itoa (int val, char *s, int radix) +long atol_internal(const char* s) +{ + return 0; +} + +float atof_internal(const char* s) +{ + return 0; +} + +char * itoa (int val, char *s, int radix) { *s = 0; return s; } -char * ltoa (long val, char *s, int radix) +char * ltoa (long val, char *s, int radix) { *s = 0; return s; } -char * utoa (unsigned int val, char *s, int radix) +char * utoa (unsigned int val, char *s, int radix) { *s = 0; return s; } -char * ultoa (unsigned long val, char *s, int radix) +char * ultoa (unsigned long val, char *s, int radix) { *s = 0; return s; } -char * dtostre (double __val, char *__s, unsigned char __prec, unsigned char __flags) +char * dtostre (double __val, char *__s, unsigned char __prec, unsigned char __flags) { *__s = 0; return __s; } -char * dtostrf (double __val, signed char __width, unsigned char __prec, char *__s) +char * dtostrf (double __val, signed char __width, unsigned char __prec, char *__s) { *__s = 0; return __s; diff --git a/hardware/arduino/esp8266/cores/esp8266/stdlib_noniso.h b/hardware/arduino/esp8266/cores/esp8266/stdlib_noniso.h index c2bd41bba..a61447816 100644 --- a/hardware/arduino/esp8266/cores/esp8266/stdlib_noniso.h +++ b/hardware/arduino/esp8266/cores/esp8266/stdlib_noniso.h @@ -5,6 +5,9 @@ extern "C"{ #endif +long atol_internal(const char*); + +float atof_internal(const char*); char* itoa (int val, char *s, int radix); diff --git a/hardware/arduino/esp8266/cores/esp8266/user_config.h b/hardware/arduino/esp8266/cores/esp8266/user_config.h old mode 100755 new mode 100644 diff --git a/hardware/tools/esp8266/sdk/include/ets_sys.h b/hardware/tools/esp8266/sdk/include/ets_sys.h old mode 100755 new mode 100644 index 124681a46..a1328388a --- a/hardware/tools/esp8266/sdk/include/ets_sys.h +++ b/hardware/tools/esp8266/sdk/include/ets_sys.h @@ -83,6 +83,7 @@ typedef struct _ETSTIMER_ { void ets_isr_attach(int routine, void* something, void *buff); void *pvPortMalloc(size_t xWantedSize); +void *pvPortRealloc(void* ptr, size_t xWantedSize); void pvPortFree(void *ptr); void *vPortMalloc(size_t xWantedSize); void vPortFree(void *ptr); diff --git a/hardware/tools/esp8266/sdk/include/mem.h b/hardware/tools/esp8266/sdk/include/mem.h old mode 100755 new mode 100644 index b3fb8f480..ac92e74d0 --- a/hardware/tools/esp8266/sdk/include/mem.h +++ b/hardware/tools/esp8266/sdk/include/mem.h @@ -8,5 +8,6 @@ #define os_malloc pvPortMalloc #define os_free vPortFree #define os_zalloc pvPortZalloc +#define os_realloc pvPortRealloc #endif