This commit is contained in:
2025-11-19 12:15:46 +01:00
parent 00773612c3
commit d1ba8d4d0e

View File

@@ -249,7 +249,7 @@ class Com(ControllerConnection):
def __add_integer_as_hex(self, c: int): def __add_integer_as_hex(self, c: int):
"""Writes the hexadecimal representation of the high and low bytes of integer `c` (16-bit) to the simulated serial port.""" """Writes the hexadecimal representation of the high and low bytes of integer `c` (16-bit) to the simulated serial port."""
if not (0 <= c <= 0xFFFF): if not (0 <= c <= 0xFFFF):
raise ValueError("Input must be a 16-bit integer (065535)") raise ValueError("Input must be a 16-bit integer (0-65535)")
# Get high byte (most significant byte) # Get high byte (most significant byte)
hi_byte = (c >> 8) & 0xFF hi_byte = (c >> 8) & 0xFF