mirror of
https://github.com/ByteWelder/Tactility.git
synced 2026-02-18 19:03:16 +00:00
PR feedback
This commit is contained in:
parent
daf35b53ab
commit
ded3b6f2c3
@ -1,3 +1,2 @@
|
|||||||
class DevicetreeException(Exception):
|
class DevicetreeException(Exception):
|
||||||
def __init__(self, message):
|
pass
|
||||||
super().__init__(message)
|
|
||||||
|
|||||||
@ -61,9 +61,7 @@ def find_phandle(devices: list[Device], phandle: str):
|
|||||||
|
|
||||||
def property_to_string(property: DeviceProperty, devices: list[Device]) -> str:
|
def property_to_string(property: DeviceProperty, devices: list[Device]) -> str:
|
||||||
type = property.type
|
type = property.type
|
||||||
if type == "value":
|
if type == "value" or type == "int":
|
||||||
return property.value
|
|
||||||
elif type == "int":
|
|
||||||
return property.value
|
return property.value
|
||||||
elif type == "boolean":
|
elif type == "boolean":
|
||||||
return "true"
|
return "true"
|
||||||
|
|||||||
@ -14,7 +14,8 @@ from source.exception import DevicetreeException
|
|||||||
def main(config_path: str, output_path: str, verbose: bool) -> int:
|
def main(config_path: str, output_path: str, verbose: bool) -> int:
|
||||||
print(f"Generating devicetree code\n config: {config_path}\n output: {output_path}")
|
print(f"Generating devicetree code\n config: {config_path}\n output: {output_path}")
|
||||||
if not os.path.isdir(config_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())
|
config = parse_config(config_path, os.getcwd())
|
||||||
if verbose:
|
if verbose:
|
||||||
@ -34,11 +35,11 @@ def main(config_path: str, output_path: str, verbose: bool) -> int:
|
|||||||
pprint(transformed)
|
pprint(transformed)
|
||||||
binding_files = find_all_bindings(config.bindings)
|
binding_files = find_all_bindings(config.bindings)
|
||||||
if verbose:
|
if verbose:
|
||||||
print(f"Bindings found:")
|
print("Bindings found:")
|
||||||
for binding_file in binding_files:
|
for binding_file in binding_files:
|
||||||
print(f" {binding_file}")
|
print(f" {binding_file}")
|
||||||
if verbose:
|
if verbose:
|
||||||
print(f"Parsing bindings")
|
print("Parsing bindings")
|
||||||
bindings = []
|
bindings = []
|
||||||
for binding_file in binding_files:
|
for binding_file in binding_files:
|
||||||
bindings.append(parse_binding(binding_file, config.bindings))
|
bindings.append(parse_binding(binding_file, config.bindings))
|
||||||
|
|||||||
@ -21,10 +21,11 @@ properties:
|
|||||||
description: WS pin
|
description: WS pin
|
||||||
pin-data-out:
|
pin-data-out:
|
||||||
type: int
|
type: int
|
||||||
|
default: GPIO_PIN_NONE
|
||||||
description: DATA OUT pin
|
description: DATA OUT pin
|
||||||
pin-data-in:
|
pin-data-in:
|
||||||
type: int
|
type: int
|
||||||
required: false
|
default: GPIO_PIN_NONE
|
||||||
description: DATA IN pin
|
description: DATA IN pin
|
||||||
pin-mclk:
|
pin-mclk:
|
||||||
type: int
|
type: int
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user