Skip to content

Commit

Permalink
Add enum24 since chip-types defines it
Browse files Browse the repository at this point in the history
  • Loading branch information
andy31415 committed Nov 29, 2023
1 parent 6020778 commit d8257db
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ def is_struct(self) -> bool:
"bitmap64": BasicInteger(idl_name="bitmap64", byte_count=8, is_signed=False),
"bitmap8": BasicInteger(idl_name="bitmap8", byte_count=1, is_signed=False),
"enum16": BasicInteger(idl_name="enum16", byte_count=2, is_signed=False),
"enum24": BasicInteger(idl_name="enum24", byte_count=3, is_signed=False),
"enum32": BasicInteger(idl_name="enum32", byte_count=4, is_signed=False),
"enum8": BasicInteger(idl_name="enum8", byte_count=1, is_signed=False),
"int16s": BasicInteger(idl_name="int16s", byte_count=2, is_signed=True),
Expand Down Expand Up @@ -335,7 +336,7 @@ def is_enum_type(self, name: str):
Handles both standard names (like enum8) as well as enumerations defined
within the current lookup context.
"""
if name.lower() in ["enum8", "enum16", "enum32"]:
if name.lower() in ["enum8", "enum16", "enum24", "enum32"]:
return True
return any(map(lambda e: e.name == name, self.all_enums))

Expand Down Expand Up @@ -385,7 +386,7 @@ def ParseDataType(data_type: DataType, lookup: TypeLookupContext) -> Union[Basic
return BasicString(idl_name=lowercase_name, is_binary=False, max_length=data_type.max_length)
elif lowercase_name in ['octet_string', 'long_octet_string']:
return BasicString(idl_name=lowercase_name, is_binary=True, max_length=data_type.max_length)
elif lowercase_name in ['enum8', 'enum16', 'enum32']:
elif lowercase_name in ['enum8', 'enum16', 'enum24', 'enum32']:
return IdlEnumType(idl_name=lowercase_name, base_type=__CHIP_SIZED_TYPES__[lowercase_name])
elif lowercase_name in ['bitmap8', 'bitmap16', 'bitmap24', 'bitmap32', 'bitmap64']:
return IdlBitmapType(idl_name=lowercase_name, base_type=__CHIP_SIZED_TYPES__[lowercase_name])
Expand Down

0 comments on commit d8257db

Please sign in to comment.