mirror of
https://github.com/AsahiLinux/m1n1
synced 2024-11-10 17:54:13 +00:00
m1n1.adt: Fixes for adding properties
Signed-off-by: Asahi Lina <lina@asahilina.net>
This commit is contained in:
parent
808baf22df
commit
d265abc90c
1 changed files with 7 additions and 2 deletions
|
@ -359,7 +359,12 @@ def build_prop(path, name, v, t=None):
|
|||
elif isinstance(v, str):
|
||||
t = CString("ascii")
|
||||
elif isinstance(v, int):
|
||||
t = Int32ul
|
||||
if v > 0xffffffff:
|
||||
t = Int64ul
|
||||
else:
|
||||
t = Int32ul
|
||||
elif isinstance(v, float):
|
||||
t = Float32l
|
||||
elif isinstance(v, tuple) and all(isinstance(i, int) for i in v):
|
||||
t = Array(len(v), Int32ul)
|
||||
|
||||
|
@ -500,7 +505,7 @@ class ADTNode:
|
|||
raise AttributeError("#interrupt-cells")
|
||||
|
||||
def _fmt_prop(self, k, v):
|
||||
t, is_template = self._types[k]
|
||||
t, is_template = self._types.get(k, (None, False))
|
||||
if is_template:
|
||||
return f"<< {v} >>"
|
||||
elif isinstance(v, ListContainer):
|
||||
|
|
Loading…
Reference in a new issue