Disable platformio LDF (#352)

* Disable platformio LDF

* Use required build flags
This commit is contained in:
Otto Winter 2019-01-19 22:14:46 +01:00 committed by GitHub
parent eb39add6fc
commit 3437e23c8e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 30 additions and 4 deletions

View file

@ -102,7 +102,7 @@ def to_code(config):
setup_component(fast_led, config) setup_component(fast_led, config)
BUILD_FLAGS = '-DUSE_FAST_LED_LIGHT' REQUIRED_BUILD_FLAGS = '-DUSE_FAST_LED_LIGHT'
LIB_DEPS = 'FastLED@3.2.0' LIB_DEPS = 'FastLED@3.2.0'

View file

@ -82,7 +82,7 @@ def to_code(config):
setup_component(fast_led, config) setup_component(fast_led, config)
BUILD_FLAGS = '-DUSE_FAST_LED_LIGHT' REQUIRED_BUILD_FLAGS = '-DUSE_FAST_LED_LIGHT'
LIB_DEPS = 'FastLED@3.2.0' LIB_DEPS = 'FastLED@3.2.0'

View file

@ -160,7 +160,7 @@ def to_code(config):
setup_component(output, config) setup_component(output, config)
BUILD_FLAGS = '-DUSE_NEO_PIXEL_BUS_LIGHT' REQUIRED_BUILD_FLAGS = '-DUSE_NEO_PIXEL_BUS_LIGHT'
LIB_DEPS = 'NeoPixelBus@2.4.1' LIB_DEPS = 'NeoPixelBus@2.4.1'

View file

@ -28,7 +28,7 @@ def to_code(config):
setup_component(web_server, config) setup_component(web_server, config)
BUILD_FLAGS = '-DUSE_WEB_SERVER' REQUIRED_BUILD_FLAGS = '-DUSE_WEB_SERVER'
def lib_deps(config): def lib_deps(config):

View file

@ -343,6 +343,32 @@ def get_ini_content():
flash_mode = CORE.config[CONF_ESPHOMEYAML][CONF_BOARD_FLASH_MODE] flash_mode = CORE.config[CONF_ESPHOMEYAML][CONF_BOARD_FLASH_MODE]
data['board_build.flash_mode'] = flash_mode data['board_build.flash_mode'] = flash_mode
if CORE.is_esp8266:
# On ESP8266, we can disable LDF
data['lib_ldf_mode'] = 'off'
elif CORE.is_esp32:
# On ESP32, we need to enable LDF
# and can manually remove all libraries we don't need
data['lib_ldf_mode'] = 'chain'
REMOVABLE_LIBRARIES = [
'ArduinoOTA',
'ESPmDNS',
'Update',
'Wire',
'FastLED',
'NeoPixelBus',
'ESP Async WebServer',
]
ignore = []
for x in REMOVABLE_LIBRARIES:
for o in lib_deps:
if x in o:
break
else:
ignore.append(x)
if ignore:
data['lib_ignore'] = ignore
data.update(CORE.config[CONF_ESPHOMEYAML].get(CONF_PLATFORMIO_OPTIONS, {})) data.update(CORE.config[CONF_ESPHOMEYAML].get(CONF_PLATFORMIO_OPTIONS, {}))
content = u'[env:{}]\n'.format(CORE.name) content = u'[env:{}]\n'.format(CORE.name)