From 9cd5d703c18e9d2fd99ce3782bb54b6d78b46024 Mon Sep 17 00:00:00 2001 From: Nate Gay Date: Sun, 30 Nov 2025 16:15:52 -0600 Subject: [PATCH 1/5] Add ability to get load switch state --- .../Components/LoadSwitch/LoadSwitch.cpp | 27 +++++++++++++- .../Components/LoadSwitch/LoadSwitch.fpp | 36 ++++++++----------- .../Components/LoadSwitch/LoadSwitch.hpp | 16 +++++++++ .../Components/LoadSwitch/docs/sdd.md | 35 +++++++++++++++--- .../ReferenceDeployment/Top/topology.fpp | 15 ++++++++ 5 files changed, 102 insertions(+), 27 deletions(-) diff --git a/FprimeZephyrReference/Components/LoadSwitch/LoadSwitch.cpp b/FprimeZephyrReference/Components/LoadSwitch/LoadSwitch.cpp index 002d8b6e..c65511a4 100644 --- a/FprimeZephyrReference/Components/LoadSwitch/LoadSwitch.cpp +++ b/FprimeZephyrReference/Components/LoadSwitch/LoadSwitch.cpp @@ -28,6 +28,10 @@ void LoadSwitch ::Reset_handler(FwIndexType portNum) { this->setLoadSwitchState(Fw::On::ON); } +Fw::On LoadSwitch ::loadSwitchStateGet_handler(FwIndexType portNum) { + return this->getLoadSwitchState() && this->getTime() > this->m_on_timeout ? Fw::On::ON : Fw::On::OFF; +} + void LoadSwitch ::turnOn_handler(FwIndexType portNum) { this->setLoadSwitchState(Fw::On::ON); } @@ -55,10 +59,31 @@ void LoadSwitch ::TURN_OFF_cmdHandler(FwOpcodeType opCode, U32 cmdSeq) { // ---------------------------------------------------------------------- void LoadSwitch ::setLoadSwitchState(Fw::On state) { - Fw::Logic gpioValue = (state == Fw::On::ON) ? Fw::Logic::HIGH : Fw::Logic::LOW; + if (this->getLoadSwitchState() == state) { + // No change, exit early + return; + } + + Fw::Logic gpioValue = Fw::Logic::LOW; + if (state == Fw::On::ON) { + gpioValue = Fw::Logic::HIGH; + this->m_on_timeout = this->getTime(); + // Start timeout timer for 1 second + // This delay is to allow power to stabilize after turning on the load switch + // TODO(nateinaction): Take delay duration as a parameter + // TODO(nateinaction): Is there a non-sleep way to determine if load switched board is ready? + this->m_on_timeout.add(1, 0); + } + this->gpioSet_out(0, gpioValue); this->log_ACTIVITY_HI_StatusChanged(state); this->tlmWrite_IsOn(state); } +Fw::On LoadSwitch ::getLoadSwitchState() { + Fw::Logic state; + this->gpioGet_out(0, state); + return state ? Fw::On::ON : Fw::On::OFF; +} + } // namespace Components diff --git a/FprimeZephyrReference/Components/LoadSwitch/LoadSwitch.fpp b/FprimeZephyrReference/Components/LoadSwitch/LoadSwitch.fpp index 33540ad0..5a488252 100644 --- a/FprimeZephyrReference/Components/LoadSwitch/LoadSwitch.fpp +++ b/FprimeZephyrReference/Components/LoadSwitch/LoadSwitch.fpp @@ -1,38 +1,30 @@ +module Components { + port loadSwitchStateGet -> Fw.On +} + module Components { @ A generic load switch for controlling power to components passive component LoadSwitch { - # One async command/port is required for active components - # This should be overridden by the developers with a useful command/port - - ############################################################################## - #### Uncomment the following examples to start customizing your component #### - ############################################################################## - - # @ Example async command - # async command COMMAND_NAME(param_name: U32) + @ Command to turn the load switch on sync command TURN_ON() + + @ Command to turn the load switch off sync command TURN_OFF() - # @ Example telemetry counter - # telemetry ExampleCounter: U64 + @ Telemetry channel for load switch state telemetry IsOn: Fw.On - # @ Example event - # event ExampleStateEvent(example_state: Fw.On) severity activity high id 0 format "State set to {}" + @ Event for reporting load switch state change event StatusChanged($state: Fw.On) severity activity high id 1 format "Load switch state changed to {}" - # @ Example port: receiving calls from the rate group - # sync input port run: Svc.Sched - #output port Status: Drv.GpioRead - #We will not be putting a Drv.GpioRead port here, we are using the Gpio Driver component which has this already! - @ Port sending calls to the GPIO driver output port gpioSet: Drv.GpioWrite + @ Port sending calls to the GPIO driver to read state + output port gpioGet: Drv.GpioRead - # Input that will be used by other components if they want to force a reset - # (off and on again) of the load switch + @ Input port to reset the load switch (called by other components) sync input port Reset: Fw.Signal @ Input port to turn on the load switch (called by other components) @@ -41,8 +33,8 @@ module Components { @ Input port to turn off the load switch (called by other components) sync input port turnOff: Fw.Signal - # @ Example parameter - # param PARAMETER_NAME: U32 + @ Input port to get the state of the load switch (called by other components) + sync input port loadSwitchStateGet: loadSwitchStateGet ############################################################################### # Standard AC Ports: Required for Channels, Events, Commands, and Parameters # diff --git a/FprimeZephyrReference/Components/LoadSwitch/LoadSwitch.hpp b/FprimeZephyrReference/Components/LoadSwitch/LoadSwitch.hpp index 7e2862e2..837d0cfa 100644 --- a/FprimeZephyrReference/Components/LoadSwitch/LoadSwitch.hpp +++ b/FprimeZephyrReference/Components/LoadSwitch/LoadSwitch.hpp @@ -51,6 +51,14 @@ class LoadSwitch final : public LoadSwitchComponentBase { void Reset_handler(FwIndexType portNum //!< The port number ) override; + //! Handler implementation for loadSwitchStateGet + //! + //! Input port to get the state of the load switch (called by other components) + //! We need to wait for power to normalize after turning on the load switch + //! so we check the current time against a timeout + Fw::On loadSwitchStateGet_handler(FwIndexType portNum //!< The port number + ) override; + //! Handler implementation for turnOn void turnOn_handler(FwIndexType portNum //!< The port number ) override; @@ -66,6 +74,14 @@ class LoadSwitch final : public LoadSwitchComponentBase { //! Set the load switch state (common implementation for commands and ports) void setLoadSwitchState(Fw::On state //!< The desired state (ON or OFF) ); + + //! Get current load switch state + Fw::On getLoadSwitchState(); //> + } + class LoadSwitch { + + LoadSwitch(const char* compName) + + ~LoadSwitch() + - TURN_ON_cmdHandler(FwOpcodeType opCode, U32 cmdSeq): void + - TURN_OFF_cmdHandler(FwOpcodeType opCode, U32 cmdSeq): void + - Reset_handler(FwIndexType portNum): void + - turnOn_handler(FwIndexType portNum): void + - turnOff_handler(FwIndexType portNum): void + - loadSwitchStateGet_handler(FwIndexType portNum): Fw::On + } + } + LoadSwitchComponentBase <|-- LoadSwitch : inherits +``` ## External interface @@ -42,7 +64,11 @@ The component logs the `StatusChanged` event whenever the switch transitions due | Port name | Direction | Port type | Notes | |---|---|---|---| | gpioSet | output | Drv.GpioWrite | Used to write the physical GPIO. Implementation always uses index 0 (`gpioSet_out(0, ...)`). | -| Reset | input (async) | Fw.Signal | Causes the component to perform a hardware reset sequence: LOW -> wait 100ms -> HIGH. | +| gpioGet | output | Drv.GpioRead | Used to read the physical GPIO state. | +| Reset | input (sync) | Fw.Signal | Causes the component to perform a hardware reset sequence: LOW -> wait 100ms -> HIGH. | +| turnOn | input (sync) | Fw.Signal | Turns on the load switch. | +| turnOff | input (sync) | Fw.Signal | Turns off the load switch. | +| loadSwitchStateGet | input (sync) | loadSwitchStateGet | Returns the current state of the load switch (Fw::On). | ## Change Log @@ -51,3 +77,4 @@ The component logs the `StatusChanged` event whenever the switch transitions due |---|---| | 10-22-2025 | Sarah, Kevin, and MoMata's first commit | | 11-07-2025 | Updated SDD to match implementation in `LoadSwitch.cpp/.hpp/.fpp` (commands, telemetry, event, ports, reset behavior). | +| 11-30-2025 | Added `loadSwitchStateGet` port and updated class diagram. | diff --git a/FprimeZephyrReference/ReferenceDeployment/Top/topology.fpp b/FprimeZephyrReference/ReferenceDeployment/Top/topology.fpp index 0390534e..20aa7dac 100644 --- a/FprimeZephyrReference/ReferenceDeployment/Top/topology.fpp +++ b/FprimeZephyrReference/ReferenceDeployment/Top/topology.fpp @@ -183,13 +183,28 @@ module ReferenceDeployment { connections LoadSwitches { face4LoadSwitch.gpioSet -> gpioface4LS.gpioWrite + face4LoadSwitch.gpioGet -> gpioface4LS.gpioRead + face0LoadSwitch.gpioSet -> gpioface0LS.gpioWrite + face0LoadSwitch.gpioGet -> gpioface0LS.gpioRead + face1LoadSwitch.gpioSet -> gpioface1LS.gpioWrite + face1LoadSwitch.gpioGet -> gpioface1LS.gpioRead + face2LoadSwitch.gpioSet -> gpioface2LS.gpioWrite + face2LoadSwitch.gpioGet -> gpioface2LS.gpioRead + face3LoadSwitch.gpioSet -> gpioface3LS.gpioWrite + face3LoadSwitch.gpioGet -> gpioface3LS.gpioRead + face5LoadSwitch.gpioSet -> gpioface5LS.gpioWrite + face5LoadSwitch.gpioGet -> gpioface5LS.gpioRead + payloadPowerLoadSwitch.gpioSet -> gpioPayloadPowerLS.gpioWrite + payloadPowerLoadSwitch.gpioGet -> gpioPayloadPowerLS.gpioRead + payloadBatteryLoadSwitch.gpioSet -> gpioPayloadBatteryLS.gpioWrite + payloadBatteryLoadSwitch.gpioGet -> gpioPayloadBatteryLS.gpioRead } connections BurnwireGpio { From 2dc9ed7274a7a068c728d676b3fe1a3ce947a591 Mon Sep 17 00:00:00 2001 From: Nate Gay Date: Sun, 30 Nov 2025 16:27:12 -0600 Subject: [PATCH 2/5] Remove reset from load switch --- .../Components/LoadSwitch/LoadSwitch.cpp | 6 ------ .../Components/LoadSwitch/LoadSwitch.fpp | 3 --- .../Components/LoadSwitch/LoadSwitch.hpp | 8 ------- .../Components/LoadSwitch/docs/sdd.md | 21 ++++++++++++------- 4 files changed, 14 insertions(+), 24 deletions(-) diff --git a/FprimeZephyrReference/Components/LoadSwitch/LoadSwitch.cpp b/FprimeZephyrReference/Components/LoadSwitch/LoadSwitch.cpp index c65511a4..dc1c806a 100644 --- a/FprimeZephyrReference/Components/LoadSwitch/LoadSwitch.cpp +++ b/FprimeZephyrReference/Components/LoadSwitch/LoadSwitch.cpp @@ -22,12 +22,6 @@ LoadSwitch ::~LoadSwitch() {} // Handler implementations for typed input ports // ---------------------------------------------------------------------- -void LoadSwitch ::Reset_handler(FwIndexType portNum) { - this->setLoadSwitchState(Fw::On::OFF); - k_sleep(K_MSEC(100)); - this->setLoadSwitchState(Fw::On::ON); -} - Fw::On LoadSwitch ::loadSwitchStateGet_handler(FwIndexType portNum) { return this->getLoadSwitchState() && this->getTime() > this->m_on_timeout ? Fw::On::ON : Fw::On::OFF; } diff --git a/FprimeZephyrReference/Components/LoadSwitch/LoadSwitch.fpp b/FprimeZephyrReference/Components/LoadSwitch/LoadSwitch.fpp index 5a488252..501f84b4 100644 --- a/FprimeZephyrReference/Components/LoadSwitch/LoadSwitch.fpp +++ b/FprimeZephyrReference/Components/LoadSwitch/LoadSwitch.fpp @@ -24,9 +24,6 @@ module Components { @ Port sending calls to the GPIO driver to read state output port gpioGet: Drv.GpioRead - @ Input port to reset the load switch (called by other components) - sync input port Reset: Fw.Signal - @ Input port to turn on the load switch (called by other components) sync input port turnOn: Fw.Signal diff --git a/FprimeZephyrReference/Components/LoadSwitch/LoadSwitch.hpp b/FprimeZephyrReference/Components/LoadSwitch/LoadSwitch.hpp index 837d0cfa..f19d09f1 100644 --- a/FprimeZephyrReference/Components/LoadSwitch/LoadSwitch.hpp +++ b/FprimeZephyrReference/Components/LoadSwitch/LoadSwitch.hpp @@ -43,14 +43,6 @@ class LoadSwitch final : public LoadSwitchComponentBase { U32 cmdSeq //!< The command sequence number ) override; - // ---------------------------------------------------------------------- - // Handler implementations for typed input ports - // ---------------------------------------------------------------------- - - //! Handler implementation for Reset - void Reset_handler(FwIndexType portNum //!< The port number - ) override; - //! Handler implementation for loadSwitchStateGet //! //! Input port to get the state of the load switch (called by other components) diff --git a/FprimeZephyrReference/Components/LoadSwitch/docs/sdd.md b/FprimeZephyrReference/Components/LoadSwitch/docs/sdd.md index b658a2dc..4bebf784 100644 --- a/FprimeZephyrReference/Components/LoadSwitch/docs/sdd.md +++ b/FprimeZephyrReference/Components/LoadSwitch/docs/sdd.md @@ -4,8 +4,7 @@ The `LoadSwitch` component is an active F' component that controls a single load switch output through the `gpioSet` output port (connected to the platform's GPIO driver). It exposes two -async commands to turn the switch on and off, telemetry reporting the current state, and an -async `Reset` input which toggles the switch (off, short delay, on). It also provides ports +async commands to turn the switch on and off, telemetry reporting the current state. It also provides ports to control the switch and query its state from other components. ## Responsibility @@ -27,7 +26,6 @@ classDiagram + ~LoadSwitch() - TURN_ON_cmdHandler(FwOpcodeType opCode, U32 cmdSeq): void - TURN_OFF_cmdHandler(FwOpcodeType opCode, U32 cmdSeq): void - - Reset_handler(FwIndexType portNum): void - turnOn_handler(FwIndexType portNum): void - turnOff_handler(FwIndexType portNum): void - loadSwitchStateGet_handler(FwIndexType portNum): Fw::On @@ -49,7 +47,7 @@ classDiagram | Name | Type | Description | |---|---:|---| -| IsOn | Fw.On | Current power state; written after commands and on Reset handling. | +| IsOn | Fw.On | Current power state; written after commands. | ### Events @@ -57,7 +55,7 @@ classDiagram |---|---|---:|---| | StatusChanged | activity high | 1 | "Load switch state changed to {}" | -The component logs the `StatusChanged` event whenever the switch transitions due to a command or a Reset. +The component logs the `StatusChanged` event whenever the switch transitions due to a command. ### Ports @@ -65,11 +63,20 @@ The component logs the `StatusChanged` event whenever the switch transitions due |---|---|---|---| | gpioSet | output | Drv.GpioWrite | Used to write the physical GPIO. Implementation always uses index 0 (`gpioSet_out(0, ...)`). | | gpioGet | output | Drv.GpioRead | Used to read the physical GPIO state. | -| Reset | input (sync) | Fw.Signal | Causes the component to perform a hardware reset sequence: LOW -> wait 100ms -> HIGH. | | turnOn | input (sync) | Fw.Signal | Turns on the load switch. | | turnOff | input (sync) | Fw.Signal | Turns off the load switch. | | loadSwitchStateGet | input (sync) | loadSwitchStateGet | Returns the current state of the load switch (Fw::On). | +## Requirements + +| Name | Description | Validation | +|---|---|---| +| Control via Command | The component shall allow turning the load switch on and off via ground commands `TURN_ON` and `TURN_OFF`. | Integration test | +| Control via Port | The component shall allow turning the load switch on and off via input ports `turnOn` and `turnOff`. | Verify `turnOn` and `turnOff` port calls change the GPIO state and telemetry. | +| State Telemetry | The component shall report the current state of the load switch via the `IsOn` telemetry channel. | Integration test | +| State Event | The component shall emit a `StatusChanged` event when the load switch state changes. | Verify `StatusChanged` event is emitted upon state transitions. | +| State Query | The component shall provide the current state of the load switch via the `loadSwitchStateGet` port. | Downstream component testing | +| GPIO Control | The component shall control the physical GPIO pin corresponding to the load switch using the `gpioSet` port. | Downstream component testing | ## Change Log @@ -77,4 +84,4 @@ The component logs the `StatusChanged` event whenever the switch transitions due |---|---| | 10-22-2025 | Sarah, Kevin, and MoMata's first commit | | 11-07-2025 | Updated SDD to match implementation in `LoadSwitch.cpp/.hpp/.fpp` (commands, telemetry, event, ports, reset behavior). | -| 11-30-2025 | Added `loadSwitchStateGet` port and updated class diagram. | +| 11-30-2025 | Added `loadSwitchStateGet` port and updated class diagram. Removed Reset capability. | From d2034ca5a1ec73176d6de955ff570e188ae1e523 Mon Sep 17 00:00:00 2001 From: Nate Gay Date: Sun, 30 Nov 2025 16:44:40 -0600 Subject: [PATCH 3/5] Add more detail to sdd --- FprimeZephyrReference/Components/LoadSwitch/docs/sdd.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/FprimeZephyrReference/Components/LoadSwitch/docs/sdd.md b/FprimeZephyrReference/Components/LoadSwitch/docs/sdd.md index 4bebf784..eed015ea 100644 --- a/FprimeZephyrReference/Components/LoadSwitch/docs/sdd.md +++ b/FprimeZephyrReference/Components/LoadSwitch/docs/sdd.md @@ -47,7 +47,7 @@ classDiagram | Name | Type | Description | |---|---:|---| -| IsOn | Fw.On | Current power state; written after commands. | +| IsOn | Fw.On | Current power state; written after commands. Note: Reports ON only after a stabilization delay (default 1s) following the turn-on command. | ### Events @@ -65,7 +65,7 @@ The component logs the `StatusChanged` event whenever the switch transitions due | gpioGet | output | Drv.GpioRead | Used to read the physical GPIO state. | | turnOn | input (sync) | Fw.Signal | Turns on the load switch. | | turnOff | input (sync) | Fw.Signal | Turns off the load switch. | -| loadSwitchStateGet | input (sync) | loadSwitchStateGet | Returns the current state of the load switch (Fw::On). | +| loadSwitchStateGet | input (sync) | loadSwitchStateGet | Returns the current state of the load switch (Fw::On). Note: Returns ON only after a stabilization delay (default 1s) following the turn-on command. | ## Requirements @@ -75,7 +75,7 @@ The component logs the `StatusChanged` event whenever the switch transitions due | Control via Port | The component shall allow turning the load switch on and off via input ports `turnOn` and `turnOff`. | Verify `turnOn` and `turnOff` port calls change the GPIO state and telemetry. | | State Telemetry | The component shall report the current state of the load switch via the `IsOn` telemetry channel. | Integration test | | State Event | The component shall emit a `StatusChanged` event when the load switch state changes. | Verify `StatusChanged` event is emitted upon state transitions. | -| State Query | The component shall provide the current state of the load switch via the `loadSwitchStateGet` port. | Downstream component testing | +| State Query | The component shall provide the current state of the load switch via the `loadSwitchStateGet` port. The state shall report ON only after a configured stabilization delay. | Downstream component testing | | GPIO Control | The component shall control the physical GPIO pin corresponding to the load switch using the `gpioSet` port. | Downstream component testing | ## Change Log @@ -84,4 +84,4 @@ The component logs the `StatusChanged` event whenever the switch transitions due |---|---| | 10-22-2025 | Sarah, Kevin, and MoMata's first commit | | 11-07-2025 | Updated SDD to match implementation in `LoadSwitch.cpp/.hpp/.fpp` (commands, telemetry, event, ports, reset behavior). | -| 11-30-2025 | Added `loadSwitchStateGet` port and updated class diagram. Removed Reset capability. | +| 11-30-2025 | Added `loadSwitchStateGet` port and updated class diagram. Removed Reset capability. Added note about stabilization delay for state reporting. | From 1839bea98500b0944f6303da9f9bbbead3e73a46 Mon Sep 17 00:00:00 2001 From: Nate Gay Date: Sun, 30 Nov 2025 23:43:22 -0600 Subject: [PATCH 4/5] Update loadswitch with loadswitchchanged output prot --- .../Components/LoadSwitch/LoadSwitch.cpp | 22 +++++-------------- .../Components/LoadSwitch/LoadSwitch.fpp | 7 +++--- .../Components/LoadSwitch/LoadSwitch.hpp | 13 ----------- .../Components/LoadSwitch/docs/sdd.md | 12 +++++----- 4 files changed, 15 insertions(+), 39 deletions(-) diff --git a/FprimeZephyrReference/Components/LoadSwitch/LoadSwitch.cpp b/FprimeZephyrReference/Components/LoadSwitch/LoadSwitch.cpp index dc1c806a..8224d0be 100644 --- a/FprimeZephyrReference/Components/LoadSwitch/LoadSwitch.cpp +++ b/FprimeZephyrReference/Components/LoadSwitch/LoadSwitch.cpp @@ -22,10 +22,6 @@ LoadSwitch ::~LoadSwitch() {} // Handler implementations for typed input ports // ---------------------------------------------------------------------- -Fw::On LoadSwitch ::loadSwitchStateGet_handler(FwIndexType portNum) { - return this->getLoadSwitchState() && this->getTime() > this->m_on_timeout ? Fw::On::ON : Fw::On::OFF; -} - void LoadSwitch ::turnOn_handler(FwIndexType portNum) { this->setLoadSwitchState(Fw::On::ON); } @@ -53,23 +49,17 @@ void LoadSwitch ::TURN_OFF_cmdHandler(FwOpcodeType opCode, U32 cmdSeq) { // ---------------------------------------------------------------------- void LoadSwitch ::setLoadSwitchState(Fw::On state) { + // Check if the state is changing if (this->getLoadSwitchState() == state) { - // No change, exit early return; } - Fw::Logic gpioValue = Fw::Logic::LOW; - if (state == Fw::On::ON) { - gpioValue = Fw::Logic::HIGH; - this->m_on_timeout = this->getTime(); - // Start timeout timer for 1 second - // This delay is to allow power to stabilize after turning on the load switch - // TODO(nateinaction): Take delay duration as a parameter - // TODO(nateinaction): Is there a non-sleep way to determine if load switched board is ready? - this->m_on_timeout.add(1, 0); - } - + // Set the load switch state + Fw::Logic gpioValue = state ? Fw::Logic::HIGH : Fw::Logic::LOW; this->gpioSet_out(0, gpioValue); + + // Inform downstream components of the state change + this->loadSwitchStateChanged_out(0, state); this->log_ACTIVITY_HI_StatusChanged(state); this->tlmWrite_IsOn(state); } diff --git a/FprimeZephyrReference/Components/LoadSwitch/LoadSwitch.fpp b/FprimeZephyrReference/Components/LoadSwitch/LoadSwitch.fpp index 501f84b4..27843f80 100644 --- a/FprimeZephyrReference/Components/LoadSwitch/LoadSwitch.fpp +++ b/FprimeZephyrReference/Components/LoadSwitch/LoadSwitch.fpp @@ -1,5 +1,6 @@ module Components { port loadSwitchStateGet -> Fw.On + port loadSwitchStateChanged($state: Fw.On) -> Fw.Success } module Components { @@ -24,15 +25,15 @@ module Components { @ Port sending calls to the GPIO driver to read state output port gpioGet: Drv.GpioRead + @ Port to indicate a change in load switch state + output port loadSwitchStateChanged: loadSwitchStateChanged + @ Input port to turn on the load switch (called by other components) sync input port turnOn: Fw.Signal @ Input port to turn off the load switch (called by other components) sync input port turnOff: Fw.Signal - @ Input port to get the state of the load switch (called by other components) - sync input port loadSwitchStateGet: loadSwitchStateGet - ############################################################################### # Standard AC Ports: Required for Channels, Events, Commands, and Parameters # ############################################################################### diff --git a/FprimeZephyrReference/Components/LoadSwitch/LoadSwitch.hpp b/FprimeZephyrReference/Components/LoadSwitch/LoadSwitch.hpp index f19d09f1..8d89265d 100644 --- a/FprimeZephyrReference/Components/LoadSwitch/LoadSwitch.hpp +++ b/FprimeZephyrReference/Components/LoadSwitch/LoadSwitch.hpp @@ -43,14 +43,6 @@ class LoadSwitch final : public LoadSwitchComponentBase { U32 cmdSeq //!< The command sequence number ) override; - //! Handler implementation for loadSwitchStateGet - //! - //! Input port to get the state of the load switch (called by other components) - //! We need to wait for power to normalize after turning on the load switch - //! so we check the current time against a timeout - Fw::On loadSwitchStateGet_handler(FwIndexType portNum //!< The port number - ) override; - //! Handler implementation for turnOn void turnOn_handler(FwIndexType portNum //!< The port number ) override; @@ -69,11 +61,6 @@ class LoadSwitch final : public LoadSwitchComponentBase { //! Get current load switch state Fw::On getLoadSwitchState(); // Date: Tue, 2 Dec 2025 22:41:09 -0600 Subject: [PATCH 5/5] Add a few spaces to the loadswitch output port --- FprimeZephyrReference/Components/LoadSwitch/LoadSwitch.cpp | 4 +++- FprimeZephyrReference/Components/LoadSwitch/LoadSwitch.fpp | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/FprimeZephyrReference/Components/LoadSwitch/LoadSwitch.cpp b/FprimeZephyrReference/Components/LoadSwitch/LoadSwitch.cpp index 8224d0be..094cd976 100644 --- a/FprimeZephyrReference/Components/LoadSwitch/LoadSwitch.cpp +++ b/FprimeZephyrReference/Components/LoadSwitch/LoadSwitch.cpp @@ -59,7 +59,9 @@ void LoadSwitch ::setLoadSwitchState(Fw::On state) { this->gpioSet_out(0, gpioValue); // Inform downstream components of the state change - this->loadSwitchStateChanged_out(0, state); + for (FwIndexType i = 0; i < this->getNum_loadSwitchStateChanged_OutputPorts(); i++) { + this->loadSwitchStateChanged_out(i, state); + } this->log_ACTIVITY_HI_StatusChanged(state); this->tlmWrite_IsOn(state); } diff --git a/FprimeZephyrReference/Components/LoadSwitch/LoadSwitch.fpp b/FprimeZephyrReference/Components/LoadSwitch/LoadSwitch.fpp index 27843f80..c2f7339d 100644 --- a/FprimeZephyrReference/Components/LoadSwitch/LoadSwitch.fpp +++ b/FprimeZephyrReference/Components/LoadSwitch/LoadSwitch.fpp @@ -26,7 +26,7 @@ module Components { output port gpioGet: Drv.GpioRead @ Port to indicate a change in load switch state - output port loadSwitchStateChanged: loadSwitchStateChanged + output port loadSwitchStateChanged: [2] loadSwitchStateChanged @ Input port to turn on the load switch (called by other components) sync input port turnOn: Fw.Signal