From ded3b6f2c3420064094973a471cefea80979f640 Mon Sep 17 00:00:00 2001 From: Ken Van Hoeylandt Date: Sun, 8 Feb 2026 23:13:22 +0100 Subject: [PATCH] PR feedback --- Buildscripts/DevicetreeCompiler/source/exception.py | 3 +-- Buildscripts/DevicetreeCompiler/source/generator.py | 4 +--- Buildscripts/DevicetreeCompiler/source/main.py | 7 ++++--- Platforms/PlatformEsp32/Bindings/espressif,esp32-i2s.yaml | 3 ++- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/Buildscripts/DevicetreeCompiler/source/exception.py b/Buildscripts/DevicetreeCompiler/source/exception.py index de70efd1..2e6e3ae1 100644 --- a/Buildscripts/DevicetreeCompiler/source/exception.py +++ b/Buildscripts/DevicetreeCompiler/source/exception.py @@ -1,3 +1,2 @@ class DevicetreeException(Exception): - def __init__(self, message): - super().__init__(message) + pass diff --git a/Buildscripts/DevicetreeCompiler/source/generator.py b/Buildscripts/DevicetreeCompiler/source/generator.py index c6d7685f..1946b415 100644 --- a/Buildscripts/DevicetreeCompiler/source/generator.py +++ b/Buildscripts/DevicetreeCompiler/source/generator.py @@ -61,9 +61,7 @@ def find_phandle(devices: list[Device], phandle: str): def property_to_string(property: DeviceProperty, devices: list[Device]) -> str: type = property.type - if type == "value": - return property.value - elif type == "int": + if type == "value" or type == "int": return property.value elif type == "boolean": return "true" diff --git a/Buildscripts/DevicetreeCompiler/source/main.py b/Buildscripts/DevicetreeCompiler/source/main.py index cca88576..b26deba7 100644 --- a/Buildscripts/DevicetreeCompiler/source/main.py +++ b/Buildscripts/DevicetreeCompiler/source/main.py @@ -14,7 +14,8 @@ from source.exception import DevicetreeException def main(config_path: str, output_path: str, verbose: bool) -> int: print(f"Generating devicetree code\n config: {config_path}\n output: {output_path}") if not os.path.isdir(config_path): - raise DevicetreeException(f"Directory not found: {config_path}") + print(f"Directory not found: {config_path}") + return 1 config = parse_config(config_path, os.getcwd()) if verbose: @@ -34,11 +35,11 @@ def main(config_path: str, output_path: str, verbose: bool) -> int: pprint(transformed) binding_files = find_all_bindings(config.bindings) if verbose: - print(f"Bindings found:") + print("Bindings found:") for binding_file in binding_files: print(f" {binding_file}") if verbose: - print(f"Parsing bindings") + print("Parsing bindings") bindings = [] for binding_file in binding_files: bindings.append(parse_binding(binding_file, config.bindings)) diff --git a/Platforms/PlatformEsp32/Bindings/espressif,esp32-i2s.yaml b/Platforms/PlatformEsp32/Bindings/espressif,esp32-i2s.yaml index dec9e63f..c3d3732a 100644 --- a/Platforms/PlatformEsp32/Bindings/espressif,esp32-i2s.yaml +++ b/Platforms/PlatformEsp32/Bindings/espressif,esp32-i2s.yaml @@ -21,10 +21,11 @@ properties: description: WS pin pin-data-out: type: int + default: GPIO_PIN_NONE description: DATA OUT pin pin-data-in: type: int - required: false + default: GPIO_PIN_NONE description: DATA IN pin pin-mclk: type: int