From c0d738c809f429909dd0733cee5922cd82bc610e Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 30 Nov 2023 15:46:27 +0100 Subject: [PATCH] supv tweak --- eive_tmtc/tmtc/payload/ploc_supervisor.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/eive_tmtc/tmtc/payload/ploc_supervisor.py b/eive_tmtc/tmtc/payload/ploc_supervisor.py index cffd273..0e7db91 100644 --- a/eive_tmtc/tmtc/payload/ploc_supervisor.py +++ b/eive_tmtc/tmtc/payload/ploc_supervisor.py @@ -146,6 +146,8 @@ class OpCode: FACTORY_RESET = "factory_reset" MEM_CHECK = "mem_check" RESET_MPSOC = "reset_mpsoc" + SET_GPIO = "set_gpio" + READ_GPIO = "read_gpio" class Info(str, enum.Enum): @@ -165,6 +167,8 @@ class Info(str, enum.Enum): MEM_CHECK = "Memory Check" SEL_NVM = "Select NVM" RESET_MPSOC = "Reset MPSoC" + SET_GPIO = "Set GPIO" + READ_GPIO = "Read GPIO" @tmtc_definitions_provider @@ -182,6 +186,8 @@ def add_ploc_supv_cmds(defs: TmtcDefinitionWrapper): oce.add(OpCode.SET_TIME_REF, Info.SET_TIME_REF) oce.add(OpCode.FACTORY_RESET, Info.FACTORY_RESET) oce.add(OpCode.RESET_MPSOC, Info.RESET_MPSOC) + oce.add(OpCode.SET_GPIO, Info.SET_GPIO) + oce.add(OpCode.READ_GPIO, Info.READ_GPIO) oce.add("8", "PLOC Supervisor: Set max restart tries") oce.add("11", "PLOC Supervisor: Set boot timeout") oce.add("12", "PLOC Supervisor: Disable Hk") @@ -196,8 +202,6 @@ def add_ploc_supv_cmds(defs: TmtcDefinitionWrapper): oce.add("27", "PLOC Supervisor: Copy ADC data to MRAM") oce.add("30", "PLOC Supervisor: Run auto EM tests") oce.add("31", "PLOC Supervisor: MRAM Wipe") - oce.add("35", "PLOC Supervisor: Set GPIO") - oce.add("36", "PLOC Supervisor: Read GPIO") oce.add("37", "PLOC Supervisor: Restart supervisor") oce.add(OpCode.PERFORM_UPDATE, Info.PERFORM_UPDATE) oce.add(OpCode.START_UPDATE, Info.START_UPDATE) @@ -382,11 +386,11 @@ def pack_ploc_supv_commands(p: ServiceProviderParams): # noqa C901 q.add_log_cmd("PLOC Supervisor: Wipe MRAM") command = pack_mram_wipe_cmd(object_id.as_bytes) q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command)) - if op_code == "35": + if op_code == OpCode.SET_GPIO: q.add_log_cmd("PLOC Supervisor: Set GPIO command") command = pack_set_gpio_cmd(object_id.as_bytes) q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command)) - if op_code == "36": + if op_code == OpCode.READ_GPIO: q.add_log_cmd("PLOC Supervisor: Read GPIO command") command = pack_read_gpio_cmd(object_id.as_bytes) q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command)) -- 2.43.0