From e939f2b934b20f273a94a7c4d9665f7568cb9cee Mon Sep 17 00:00:00 2001 From: Cleanroom Laptop L15 Date: Fri, 29 Apr 2022 18:21:18 +0200 Subject: [PATCH 1/2] improved input request --- pus_tc/devs/ploc_supervisor.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pus_tc/devs/ploc_supervisor.py b/pus_tc/devs/ploc_supervisor.py index 9038928..c3d1d93 100644 --- a/pus_tc/devs/ploc_supervisor.py +++ b/pus_tc/devs/ploc_supervisor.py @@ -163,7 +163,7 @@ def pack_ploc_supv_commands( tc_queue.appendleft( (QueueCommands.PRINT, "PLOC Supervisor: Set max restart tries: ") ) - restart_tries = int(input("Set maximum restart tries:")) + restart_tries = int(input("Set maximum restart tries: ")) command = ( object_id + struct.pack("!I", SupvActionIds.SET_MAX_RESTART_TRIES) @@ -583,7 +583,7 @@ def get_latchup_id() -> int: key_string = key.ljust(key_column_width) description_string = latchup_id_dict[key].ljust(description_column_width) print(f"{key_string} | {description_string}") - return int(input("Specify latchup ID:")) + return int(input("Specify latchup ID: ")) def pack_set_alert_limit_cmd(object_id: bytearray) -> bytearray: From a0b398d214604ef8a8119beee70d3a87cda0d0e3 Mon Sep 17 00:00:00 2001 From: Cleanroom Laptop L15 Date: Fri, 29 Apr 2022 23:35:34 +0200 Subject: [PATCH 2/2] commands to tritstate mpsoc uart tx line --- pus_tc/cmd_definitions.py | 2 ++ pus_tc/devs/ploc_mpsoc.py | 12 ++++++++++++ pus_tc/devs/ploc_supervisor.py | 2 +- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/pus_tc/cmd_definitions.py b/pus_tc/cmd_definitions.py index 37e4a8e..785698a 100644 --- a/pus_tc/cmd_definitions.py +++ b/pus_tc/cmd_definitions.py @@ -541,6 +541,8 @@ def add_ploc_mpsoc_cmds(cmd_dict: ServiceOpCodeDictT): "14": ("Ploc MPSoC: Mode replay", {OpCodeDictKeys.TIMEOUT: 2.0}), "15": ("Ploc MPSoC: Mode idle", {OpCodeDictKeys.TIMEOUT: 2.0}), "16": ("Ploc MPSoC: Tc cam command send", {OpCodeDictKeys.TIMEOUT: 2.0}), + "17": ("Ploc MPSoC: Set UART TX tristate" , {OpCodeDictKeys.TIMEOUT: 2.0}), + "18": ("Ploc MPSoC: Relesase UART TX", {OpCodeDictKeys.TIMEOUT: 2.0}), } service_ploc_mpsoc_tuple = ("Ploc MPSoC", op_code_dict_srv_ploc_mpsoc) cmd_dict[CustomServiceList.PLOC_MPSOC.value] = service_ploc_mpsoc_tuple diff --git a/pus_tc/devs/ploc_mpsoc.py b/pus_tc/devs/ploc_mpsoc.py index 9a39acb..85d8a9c 100644 --- a/pus_tc/devs/ploc_mpsoc.py +++ b/pus_tc/devs/ploc_mpsoc.py @@ -53,6 +53,8 @@ class CommandIds(enum.IntEnum): TC_MODE_REPLAY = 16 TC_CAM_CMD_SEND = 17 TC_MODE_IDLE = 18 + SET_UART_TX_TRISTATE = 20 + RELEASE_UART_TX = 21 class MemAddresses(enum.IntEnum): @@ -175,6 +177,16 @@ def pack_ploc_mpsoc_commands( command = object_id + struct.pack("!I", CommandIds.TC_CAM_CMD_SEND) + bytearray(cam_cmd, 'utf-8') command = PusTelecommand(service=8, subservice=128, ssc=32, app_data=command) tc_queue.appendleft(command.pack_command_tuple()) + elif op_code == "17": + tc_queue.appendleft((QueueCommands.PRINT, "PLOC MPSoC: Set UART TX tristate")) + command = object_id + struct.pack("!I", CommandIds.SET_UART_TX_TRISTATE) + command = PusTelecommand(service=8, subservice=128, ssc=33, app_data=command) + tc_queue.appendleft(command.pack_command_tuple()) + elif op_code == "18": + tc_queue.appendleft((QueueCommands.PRINT, "PLOC MPSoC: Release UART TX")) + command = object_id + struct.pack("!I", CommandIds.RELEASE_UART_TX) + command = PusTelecommand(service=8, subservice=128, ssc=33, app_data=command) + tc_queue.appendleft(command.pack_command_tuple()) return tc_queue diff --git a/pus_tc/devs/ploc_supervisor.py b/pus_tc/devs/ploc_supervisor.py index c3d1d93..2113d4c 100644 --- a/pus_tc/devs/ploc_supervisor.py +++ b/pus_tc/devs/ploc_supervisor.py @@ -769,7 +769,7 @@ def get_debug_verbosity() -> int: def pack_set_gpio_cmd(object_id: bytearray) -> bytearray: - port = int(input("Specify port : 0x"), 16) + port = int(input("Specify port: 0x"), 16) pin = int(input("Specify pin: 0x"), 16) val = int(input("Specify val: 0x"), 16) command = object_id + struct.pack("!I", SupvActionIds.SET_GPIO)