-
Notifications
You must be signed in to change notification settings - Fork 4
Burnwire #12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Burnwire #12
Changes from all commits
Commits
Show all changes
66 commits
Select commit
Hold shift + click to select a range
3b44eb0
added burnwire component (2)
ineskhou 112d6b4
impl from sdd
ineskhou f5fbe3d
appease linter
ineskhou 7c11e85
Readme with notes to the connecty stuff to be refined and edited and …
ineskhou 488b01c
added rate group
ineskhou a96b548
feedback from deign review
ineskhou afefe1d
added input ports
ineskhou f83271a
appease linter, remove test files
ineskhou 27b172f
finished the writeup and appeased the linter
ineskhou aefa120
cleared writeer
ineskhou 29e3fe5
added open back in bc make was being sad
ineskhou 35ea0db
tests folder gone fix
ineskhou 2e45917
Merge branch 'main' of github.com:Open-Source-Space-Foundation/proves…
ineskhou 6bce30c
appease linter
ineskhou 24f2f7c
merge
ineskhou 04267f1
appease linters
ineskhou 9612639
port and command call same functions
ineskhou 0f536f7
properlly parameters for REAL
ineskhou adbfd7c
ypdated dosc and edflt value
ineskhou 094792b
appease linters
ineskhou 9b36eab
Merge branch 'main' of github.com:Open-Source-Space-Foundation/proves…
ineskhou 8a6c4ad
got the param propertlu, added tests
ineskhou 38a228b
removed the old example guide
ineskhou cc87a1a
Update sdd.md
ineskhou 48d4a55
Incorperated Feedback (1)
ineskhou ff93cc6
make clearnere
ineskhou 8e11715
trying to pass int tests
ineskhou 9d2b20c
change where we clear commit histroy:
ineskhou 4396e59
remove 2 check
ineskhou b5604eb
checking which test
ineskhou c5d8396
added how long was it event
ineskhou 63beefa
correct clean=r histroies order, stop in a function
ineskhou cb074c9
added sleep in case issue with events happening too late
ineskhou 2318eeb
assert seperate line than event
ineskhou 5429e54
correct burnwire command
ineskhou 1b9c971
no reset
ineskhou 0edf20e
coorect OIMPORTS
ineskhou bc05006
remove sleeps
ineskhou e3e7257
remove command box
ineskhou edbce4f
added back the reset start
ineskhou 70f4265
making the command response happen first
ineskhou 4a82847
actually the burnwire this time
ineskhou 12f4a21
remove other []
ineskhou aedaed7
changed ordering, added checks for every event that should hapen
ineskhou c400d30
longer wait for more events after startup
ineskhou 1812ab9
no stop
ineskhou 493f729
event numbers
ineskhou 0bba563
trying to gap stop event adn clean
ineskhou 3dd9aa5
clear histories first
ineskhou be62bcb
send no asser command
ineskhou 3ea2381
remove all params
ineskhou 76df28f
see reacieved events
ineskhou b885ae7
linkt
ineskhou 531c4b5
rename run last
ineskhou bef77a5
put parameter back
ineskhou c9d69ac
send and assert command
ineskhou 55ebb06
made second
ineskhou 4237bbc
imu at the end
ineskhou 8593802
put it back
ineskhou d2a7c41
Merge branch 'main' of github.com:Open-Source-Space-Foundation/proves…
ineskhou 3dadcf0
added start gds
ineskhou a717117
remover reset
ineskhou 32848f2
reset gds
ineskhou ee7e868
resert burnwire
ineskhou 0a2973c
burnwerie
ineskhou 9a0e869
formatting
hrfarmer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,84 @@ | ||
| // ====================================================================== | ||
| // \title Burnwire.cpp | ||
| // \brief cpp file for Burnwire component implementation class | ||
| // ====================================================================== | ||
|
|
||
| #include "FprimeZephyrReference/Components/Burnwire/Burnwire.hpp" | ||
|
|
||
| namespace Components { | ||
|
|
||
| // ---------------------------------------------------------------------- | ||
| // Component construction and destruction | ||
| // ---------------------------------------------------------------------- | ||
|
|
||
| Burnwire ::Burnwire(const char* const compName) : BurnwireComponentBase(compName) { | ||
| this->m_safetyCounter = 0; | ||
| this->m_state = Fw::On::OFF; | ||
| } | ||
|
|
||
| Burnwire ::~Burnwire() {} | ||
|
|
||
| // ---------------------------------------------------------------------- | ||
| // Handler implementations for typed input ports | ||
| // ---------------------------------------------------------------------- | ||
| void Burnwire ::burnStart_handler(FwIndexType portNum) { | ||
| this->startBurn(); | ||
| } | ||
|
|
||
| void Burnwire ::burnStop_handler(FwIndexType portNum) { | ||
| this->stopBurn(); | ||
| } | ||
|
|
||
| void Burnwire::startBurn() { | ||
| this->log_ACTIVITY_HI_SetBurnwireState(Fw::On::ON); | ||
| this->m_safetyCounter = 0; | ||
| this->m_state = Fw::On::ON; | ||
|
|
||
| Fw::ParamValid valid; | ||
| U32 timeout = this->paramGet_SAFETY_TIMER(valid); | ||
| this->log_ACTIVITY_HI_SafetyTimerState(timeout); | ||
| } | ||
|
|
||
| void Burnwire::stopBurn() { | ||
| this->log_ACTIVITY_HI_SetBurnwireState(Fw::On::OFF); | ||
| this->gpioSet_out(0, Fw::Logic::LOW); | ||
| this->gpioSet_out(1, Fw::Logic::LOW); | ||
|
|
||
| this->m_state = Fw::On::OFF; | ||
| this->log_ACTIVITY_LO_BurnwireEndCount(m_safetyCounter); | ||
| } | ||
|
|
||
| void Burnwire ::schedIn_handler(FwIndexType portNum, U32 context) { | ||
| Fw::ParamValid valid; | ||
| U32 timeout = this->paramGet_SAFETY_TIMER(valid); | ||
|
|
||
| if (this->m_state == Fw::On::ON) { | ||
| this->m_safetyCounter++; | ||
| if (this->m_safetyCounter == 1) { | ||
| this->gpioSet_out(0, Fw::Logic::HIGH); | ||
| this->gpioSet_out(1, Fw::Logic::HIGH); | ||
| this->log_ACTIVITY_HI_SafetyTimerStatus(Fw::On::ON); | ||
| } | ||
|
|
||
| if (this->m_safetyCounter >= timeout) { | ||
| stopBurn(); | ||
| this->log_ACTIVITY_HI_SafetyTimerStatus(Fw::On::OFF); | ||
| } | ||
| } | ||
| } | ||
|
|
||
| // ---------------------------------------------------------------------- | ||
| // Handler implementations for commands | ||
| // ---------------------------------------------------------------------- | ||
|
|
||
| void Burnwire ::START_BURNWIRE_cmdHandler(FwOpcodeType opCode, U32 cmdSeq) { | ||
| this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::OK); | ||
| this->startBurn(); | ||
| } | ||
|
|
||
| void Burnwire ::STOP_BURNWIRE_cmdHandler(FwOpcodeType opCode, U32 cmdSeq) { | ||
| this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::OK); | ||
| this->stopBurn(); | ||
| } | ||
|
|
||
| } // namespace Components |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,75 @@ | ||
| module Components { | ||
| @ Turns Burnwire on and off | ||
| passive component Burnwire { | ||
|
|
||
| @ START_BURNWIRE turns on the burnwire | ||
| sync command START_BURNWIRE( | ||
| ) | ||
|
|
||
| @ STOP_BURNWIRE turns on the burnwire | ||
| sync command STOP_BURNWIRE( | ||
| ) | ||
|
|
||
| event SetBurnwireState(burnwire_state: Fw.On) \ | ||
| severity activity high \ | ||
| format "Burnwire State: {}" | ||
|
|
||
| event SafetyTimerStatus(burnwire_state: Fw.On) \ | ||
| severity activity high\ | ||
| format "Safety Timer State: {} " | ||
|
|
||
| event SafetyTimerState(burnwire_status: U32) \ | ||
| severity activity high\ | ||
| format "Safety Timer Will Burn For: {} Seconds" | ||
|
|
||
| event BurnwireEndCount(end_count: U32) \ | ||
| severity activity low \ | ||
| format "Burnwire Burned for {} Seconds" | ||
|
|
||
| @ Port getting start signal | ||
| sync input port burnStart: Fw.Signal | ||
|
|
||
| @ Port getting stop signal | ||
| sync input port burnStop: Fw.Signal | ||
|
|
||
| @ Input Port to get the rate group | ||
| sync input port schedIn: Svc.Sched | ||
|
|
||
| @ Port sending calls to the GPIO driver to stop and start the burnwire | ||
| output port gpioSet: [2] Drv.GpioWrite | ||
|
|
||
| # @ SAFETY_TIMER parameter is the maximum time that the burn component will run | ||
| param SAFETY_TIMER: U32 default 10 | ||
|
|
||
| ############################################################################### | ||
| # Standard AC Ports: Required for Channels, Events, Commands, and Parameters # | ||
| ############################################################################### | ||
| @ Port for requesting the current time | ||
| time get port timeCaller | ||
|
|
||
| @ Port for sending command registrations | ||
| command reg port cmdRegOut | ||
|
|
||
| @ Port for receiving commands | ||
| command recv port cmdIn | ||
|
|
||
| @ Port for sending command responses | ||
| command resp port cmdResponseOut | ||
|
|
||
| @ Port for sending textual representation of events | ||
| text event port logTextOut | ||
|
|
||
| @ Port for sending events to downlink | ||
| event port logOut | ||
|
|
||
| @ Port for sending telemetry channels to downlink | ||
| telemetry port tlmOut | ||
|
|
||
| @ Port to return the value of a parameter | ||
| param get port prmGetOut | ||
|
|
||
| @Port to set the value of a parameter | ||
| param set port prmSetOut | ||
|
|
||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| // ====================================================================== | ||
| // \title Burnwire.hpp | ||
| // \brief hpp file for Burnwire component implementation class | ||
| // ====================================================================== | ||
|
|
||
| #ifndef Components_Burnwire_HPP | ||
| #define Components_Burnwire_HPP | ||
|
|
||
| #include <atomic> | ||
| #include "FprimeZephyrReference/Components/Burnwire/BurnwireComponentAc.hpp" | ||
|
|
||
| namespace Components { | ||
|
|
||
| class Burnwire final : public BurnwireComponentBase { | ||
| public: | ||
| // ---------------------------------------------------------------------- | ||
| // Component construction and destruction | ||
| // ---------------------------------------------------------------------- | ||
|
|
||
| //! Construct Burnwire object | ||
| Burnwire(const char* const compName //!< The component name | ||
| ); | ||
|
|
||
| //! Destroy Burnwire object | ||
| ~Burnwire(); | ||
|
|
||
| private: | ||
| // ---------------------------------------------------------------------- | ||
| // Handler implementations for typed input ports | ||
| // ---------------------------------------------------------------------- | ||
|
|
||
| //! Handler implementation for burnStart | ||
| //! | ||
| //! Port getting start signal | ||
| void burnStart_handler(FwIndexType portNum //!< The port number | ||
| ) override; | ||
|
|
||
| //! Handler implementation for burnStop | ||
| //! | ||
| //! Port getting stop signal | ||
| void burnStop_handler(FwIndexType portNum //!< The port number | ||
| ) override; | ||
|
|
||
| void schedIn_handler(FwIndexType portNum, //!< The port number | ||
| U32 context //!< The call order | ||
| ) override; | ||
|
|
||
| void startBurn(); | ||
|
|
||
| void stopBurn(); | ||
|
|
||
| private: | ||
| // ---------------------------------------------------------------------- | ||
| // Handler implementations for commands | ||
| // ---------------------------------------------------------------------- | ||
|
|
||
| //! Handler implementation for command START_BURNWIRE | ||
| void START_BURNWIRE_cmdHandler(FwOpcodeType opCode, U32 cmdSeq) override; | ||
|
|
||
| //! Handler implementation for command STOP_BURNWIRE | ||
| void STOP_BURNWIRE_cmdHandler(FwOpcodeType opCode, U32 cmdSeq) override; | ||
|
|
||
| Fw::On m_state = Fw::On::OFF; // keeps track if burnwire is on or off | ||
| std::atomic<U32> m_safetyCounter; // makes this an atomic variable (so its set only in one command), | ||
| // you read and write half the value bc a corrupted read could be dangerouts | ||
| }; | ||
|
|
||
| } // namespace Components | ||
|
|
||
| #endif | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| #### | ||
| # F Prime CMakeLists.txt: | ||
| # | ||
| # SOURCES: list of source files (to be compiled) | ||
| # AUTOCODER_INPUTS: list of files to be passed to the autocoders | ||
| # DEPENDS: list of libraries that this module depends on | ||
| # | ||
| # More information in the F´ CMake API documentation: | ||
| # https://fprime.jpl.nasa.gov/latest/docs/reference/api/cmake/API/ | ||
| # | ||
| #### | ||
|
|
||
| # Module names are derived from the path from the nearest project/library/framework | ||
| # root when not specifically overridden by the developer. i.e. The module defined by | ||
| # `Ref/SignalGen/CMakeLists.txt` will be named `Ref_SignalGen`. | ||
|
|
||
| register_fprime_library( | ||
| AUTOCODER_INPUTS | ||
| "${CMAKE_CURRENT_LIST_DIR}/Burnwire.fpp" | ||
| SOURCES | ||
| "${CMAKE_CURRENT_LIST_DIR}/Burnwire.cpp" | ||
| # DEPENDS | ||
| # MyPackage_MyOtherModule | ||
| ) | ||
|
|
||
| ### Unit Tests ### | ||
| # register_fprime_ut( | ||
| # AUTOCODER_INPUTS | ||
| # "${CMAKE_CURRENT_LIST_DIR}/Burnwire.fpp" | ||
| # SOURCES | ||
| # "${CMAKE_CURRENT_LIST_DIR}/test/ut/BurnwireTestMain.cpp" | ||
| # "${CMAKE_CURRENT_LIST_DIR}/test/ut/BurnwireTester.cpp" | ||
| # DEPENDS | ||
| # STest # For rules-based testing | ||
| # UT_AUTO_HELPERS | ||
| # ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| # Components::Burnwire | ||
|
|
||
| Driving the Burnwire on and off. This component activates the two pins that are required to heat the burnwire resisitor. The burnwire deployment will be handled by the Antenna Deployment, that will call the ports in the burnwire deployment. For testing, the commands to directly call the burnwire have been left in. | ||
|
|
||
| Burnwire is agnostic to the ideal safety count, it simply sets it to be whatever the port or command passes onto | ||
|
|
||
| ## Sequence Diagrams | ||
| Add sequence diagrams here | ||
|
|
||
| ## Requirements | ||
| Add requirements in the chart below | ||
| | Name | Description | Validation | | ||
| | ---- | ----------- | ------ | | ||
| |BW-001|The burnwire shall turn on and off in response to a port calls (TBR for antenna deployer component) |Hardware Test| | ||
| |BW-002|The burnwire shall turn on and off in response to commands (TBR for testing for now) |Hardware Test| | ||
| |BW-003|The burnwire component shall provide an event when it is turned on and off |Integration Test| | ||
| |BW-004|The burnwire component shall activate by turning both the GPIO pins that activate the burnwire | Hardware Test| | ||
| |BW-005|The burnwire component shall be controlled by a safety timeout attached to a 1Hz rate group |Integration Test| | ||
| |BW-006|The safety timeout shall emit an event when it is changes | Integration test| | ||
| |BW-007|The burnwire safety time shall emit an event when it starts and stops |Integration Test| | ||
|
|
||
| ## Port Descriptions | ||
| Name | Type | Description | | ||
| |----|---|---| | ||
| |burnStop|`Fw::Signal`|Receive stop signal to stop the burnwire| | ||
| |burnStart|`Fw::Signal`|Receive start signal to start burnwire| | ||
| |gpioSet|`Drv::GpioWrite`|Control GPIO state to driver| | ||
| |schedIn|[`Svc::Sched`]| run | Input | Synchronous | Receive periodic calls from rate group| | ||
|
|
||
|
|
||
| ## Commands | ||
| | Name | Description | | ||
| | ---- | ----------- | | ||
| |START_BURNWIRE|Starts the Burn| | ||
| |STOP_BURNWIRE|Stops the Burn| | ||
|
|
||
| ## Events | ||
| | Name | Description | | ||
| |---|---| | ||
| |SetBurnwireState| Emits burnwire state when the burnwire turns on or off| | ||
| |SafetyTimerStatus| Emits safety timer state when the Safety Time has stopped or started| | ||
| |SafetyTimerState| Emits the amount of time the safety time will run for when it starts| | ||
| | BurnwireEndCount| How long the burnwire actually burned for | | ||
|
|
||
| ## Component States | ||
| Add component states in the chart below | ||
| | Name | Description | | ||
| |----|---| | ||
| |m_state|Keeps track if the burnwire is on or off| | ||
|
|
||
| ## Tests | ||
| Add unit test descriptions in the chart below | ||
| | Name | Description | Output | Coverage | | ||
ineskhou marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| |------|-------------|--------|----------| | ||
| |TestSafety|Tests Burnwire turns off after SAFETY_TIMER seconds|Integration|---| | ||
| |TestSafety|Tests Burnwire emits correct events after start and stop|Integration|---| | ||
|
|
||
|
|
||
| ## Parameter | ||
| | Name | Description | | ||
ineskhou marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| | -----|-------------| | ||
| | SAFETY_TIMER | By Default set in fpp (currently 10) is the max time the burnwire should ever run| | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.