From 975b5127d65699494b7b1c4ec632df965a03ea14 Mon Sep 17 00:00:00 2001 From: Otto Winter Date: Tue, 5 Mar 2019 13:25:59 +0100 Subject: [PATCH] Allow Arduino Core 2.5.0 for ESP8266 (#469) --- esphome/core_config.py | 2 +- esphome/writer.py | 22 +++++++++++++--------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/esphome/core_config.py b/esphome/core_config.py index 579f8973fe..5088455fec 100644 --- a/esphome/core_config.py +++ b/esphome/core_config.py @@ -113,7 +113,7 @@ def validate_platform(value): PLATFORMIO_ESP8266_LUT = { - '2.5.0': 'espressif8266@2.0.0', + '2.5.0': 'espressif8266@2.0.1', '2.4.2': 'espressif8266@1.8.0', '2.4.1': 'espressif8266@1.7.3', '2.4.0': 'espressif8266@1.6.0', diff --git a/esphome/writer.py b/esphome/writer.py index 22206624dd..a6566146c5 100644 --- a/esphome/writer.py +++ b/esphome/writer.py @@ -342,14 +342,6 @@ def gather_build_flags(): '-DUSE_WIFI_SIGNAL_SENSOR', } - # avoid changing build flags order - return list(sorted(list(build_flags))) - - -def get_ini_content(): - lib_deps = gather_lib_deps() - build_flags = gather_build_flags() - if CORE.is_esp8266 and CORE.board in ESP8266_FLASH_SIZES: flash_size = ESP8266_FLASH_SIZES[CORE.board] ld_scripts = ESP8266_LD_SCRIPTS[flash_size] @@ -362,7 +354,19 @@ def get_ini_content(): ld_script = ld_scripts[1] if ld_script is not None: - build_flags.append('-Wl,-T{}'.format(ld_script)) + build_flags.add('-Wl,-T{}'.format(ld_script)) + + if CORE.is_esp8266 and CORE.arduino_version in (ARDUINO_VERSION_ESP8266_DEV, + ARDUINO_VERSION_ESP8266_2_5_0): + build_flags.add('-fno-exceptions') + + # avoid changing build flags order + return list(sorted(list(build_flags))) + + +def get_ini_content(): + lib_deps = gather_lib_deps() + build_flags = gather_build_flags() data = { 'platform': CORE.arduino_version,