Skip to content

Commit 60ee531

Browse files
authored
implement function has_valid_sdkconfig() for "clean" checking of config settings
1 parent 46ac6a7 commit 60ee531

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

platform.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,11 @@ def safe_copy_file(src: str, dst: str) -> bool:
117117
return True
118118

119119

120+
def has_valid_sdkconfig(config_value: str) -> bool:
121+
"""Check if sdkconfig value is valid and non-empty."""
122+
return bool(config_value and config_value.strip())
123+
124+
120125
class Espressif32Platform(PlatformBase):
121126
"""ESP32 platform implementation for PlatformIO with optimized toolchain management."""
122127

@@ -323,8 +328,7 @@ def _configure_espidf_framework(
323328
board_config.get("espidf.custom_sdkconfig", "")
324329
)
325330

326-
if (custom_sdkconfig and custom_sdkconfig.strip()) or \
327-
(board_sdkconfig and board_sdkconfig.strip()):
331+
if has_valid_sdkconfig(custom_sdkconfig) or has_valid_sdkconfig(board_sdkconfig):
328332
frameworks.append("espidf")
329333
self.packages["framework-espidf"]["optional"] = False
330334
if mcu == "esp32c2":

0 commit comments

Comments
 (0)