diff options
Diffstat (limited to 'rtemsspec/content.py')
-rw-r--r-- | rtemsspec/content.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/rtemsspec/content.py b/rtemsspec/content.py index 5bccd325..9651664e 100644 --- a/rtemsspec/content.py +++ b/rtemsspec/content.py @@ -1208,8 +1208,10 @@ def get_integer_type(value: int) -> str: return f"uint{power}_t" -def duration(value: float) -> str: +def duration(value: Union[float, str]) -> str: """ Converts a duration in seconds into a value with unit string. """ + if isinstance(value, str): + return value assert value >= 0.0 if value == 0.0: return "0s" |