Skip to content

Commit 0f536f7

Browse files
committed
properlly parameters for REAL
1 parent 9612639 commit 0f536f7

File tree

4 files changed

+26
-33
lines changed

4 files changed

+26
-33
lines changed

FprimeZephyrReference/Components/Burnwire/Burnwire.cpp

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,6 @@ namespace Components {
1515
Burnwire ::Burnwire(const char* const compName) : BurnwireComponentBase(compName) {
1616
this->m_safetyCounter = 0;
1717
this->m_state = Fw::On::OFF;
18-
Fw::ParamValid valid;
19-
this->m_safetyMaxCount = this->paramGet_SAFETY_TIMER(valid);
20-
this->log_ACTIVITY_HI_SafetyTimerSet(this->m_safetyMaxCount);
21-
this->log_ACTIVITY_HI_SafetyTimerSet(m_safetyMaxCount);
2218
}
2319

2420
Burnwire ::~Burnwire() {}
@@ -42,7 +38,10 @@ void Burnwire::startBurn() {
4238
this->m_safetyCounter = 0;
4339
this->m_state = Fw::On::ON;
4440
this->log_ACTIVITY_HI_SetBurnwireState(Fw::On::ON);
45-
this->log_ACTIVITY_HI_SafetyTimerSet(this->m_safetyMaxCount);
41+
42+
Fw::ParamValid valid;
43+
U32 timeout = this->paramGet_SAFETY_TIMER(valid);
44+
this->log_ACTIVITY_HI_SafetyTimerState(timeout);
4645
}
4746

4847
void Burnwire::stopBurn() {
@@ -77,8 +76,7 @@ void Burnwire ::schedIn_handler(FwIndexType portNum, U32 context) {
7776
// Handler implementations for commands
7877
// ----------------------------------------------------------------------
7978

80-
void Burnwire ::START_BURNWIRE_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, U32 max_duration) {
81-
this->m_safetyMaxCount = max_duration;
79+
void Burnwire ::START_BURNWIRE_cmdHandler(FwOpcodeType opCode, U32 cmdSeq) {
8280
this->startBurn();
8381
this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::OK);
8482
}
@@ -88,13 +86,4 @@ void Burnwire ::STOP_BURNWIRE_cmdHandler(FwOpcodeType opCode, U32 cmdSeq) {
8886
this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::OK);
8987
}
9088

91-
void Burnwire ::parameterUpdated(FwPrmIdType id) {
92-
if (id == this->PARAMID_SAFETY_TIMER) {
93-
Fw::ParamValid valid;
94-
this->m_safetyMaxCount = this->paramGet_SAFETY_TIMER(valid);
95-
this->log_ACTIVITY_HI_SafetyTimerSet(this->m_safetyMaxCount);
96-
}
97-
this->log_ACTIVITY_HI_SafetyTimerSet(m_safetyMaxCount);
98-
}
99-
10089
} // namespace Components

FprimeZephyrReference/Components/Burnwire/Burnwire.fpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ module Components {
88

99
# @ Examplesync command
1010
sync command START_BURNWIRE(
11-
max_duration: U32
1211
)
1312

1413

1514

1615
sync command STOP_BURNWIRE(
1716
)
1817

18+
1919
# @ Example telemetry counter
2020
# telemetry ExampleCounter: U64
2121

@@ -29,9 +29,11 @@ module Components {
2929
severity activity high\
3030
format "Safety Timer State: {} "
3131

32-
event SafetyTimerSet(max_duration: U32) \
32+
33+
event SafetyTimerState(burnwire_status: U32) \
3334
severity activity high\
34-
format "Safety Timer Set to: {} seconds"
35+
format "Safety Timer State: {} "
36+
3537

3638
# @ Example port: receiving calls from the rate group
3739
# sync input port run: Svc.Sched
@@ -50,7 +52,7 @@ module Components {
5052

5153
# @ Example parameter
5254
# param PARAMETER_NAME: U32
53-
param SAFETY_TIMER: U32 default 5
55+
param SAFETY_TIMER: U32 default 10
5456

5557
###############################################################################
5658
# Standard AC Ports: Required for Channels, Events, Commands, and Parameters #

FprimeZephyrReference/Components/Burnwire/Burnwire.hpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,6 @@ class Burnwire final : public BurnwireComponentBase {
5050
U32 context //!< The call order
5151
) override;
5252

53-
void parameterUpdated(FwPrmIdType id) override;
54-
5553
// helper functions
5654
void startBurn();
5755

@@ -63,15 +61,15 @@ class Burnwire final : public BurnwireComponentBase {
6361
// ----------------------------------------------------------------------
6462

6563
//! Handler implementation for command START_BURNWIRE
66-
void START_BURNWIRE_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, U32 max_duration) override;
64+
void START_BURNWIRE_cmdHandler(FwOpcodeType opCode, U32 cmdSeq) override;
6765

6866
//! Handler implementation for command STOP_BURNWIRE
6967
void STOP_BURNWIRE_cmdHandler(FwOpcodeType opCode, U32 cmdSeq) override;
7068

7169
Fw::On m_state = Fw::On::OFF; // keeps track if burnwire is on or off
7270
std::atomic<U32> m_safetyCounter; // makes this an atomic variable (so its set only in one command),
7371
// you read and write half the value bc a corrupted read could be dangerouts
74-
U32 m_safetyMaxCount = 5; // max count for safety timer (default 10 seconds)
72+
U32 m_safetyMaxCount = 10; // max count for safety timer (default 10 seconds)
7573
};
7674

7775
} // namespace Components

FprimeZephyrReference/Components/Burnwire/docs/sdd.md

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Components::Burnwire
22

3-
Driving the Burnwire on and off. The deployment will be handled by the Antenna Deployment component TODO ADD details
3+
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.
4+
5+
Burnwire is agnostic to the ideal safety count, it simply sets it to be whatever the port or command passes onto
46

57
## Sequence Diagrams
68
Add sequence diagrams here
@@ -9,12 +11,13 @@ Add sequence diagrams here
911
Add requirements in the chart below
1012
| Name | Description | Validation |
1113
| ---- | ----------- | ------ |
12-
|BW-001|The burnwire shall turn on in response to a port call |Hardware Test|
13-
|BW-002|The burnwire shall turn off in response to a port call |Hardware Test|
14+
|BW-001|The burnwire shall turn on and off in response to a port calls |Hardware Test|
15+
|BW-002|The burnwire shall turn on and off in response to commands (TBR for testing for now) |Hardware Test|
1416
|BW-003|The burnwire component shall provide an Event when it is turned on and off |Integration Test|
1517
|BW-004|The burnwire component shall activate by turning the GPIO pins on one at a time |Integration Test|
16-
|BW-005|The burnwire component shall be controlled by a safety timeout attached to a 1Hz rate group that can be changed within the code |Integration Test|
17-
|BW-006|The burnwire safety time shall emit an event when it starts and stops |Integration Test|
18+
|BW-005|The burnwire component shall be controlled by a safety timeout attached to a 1Hz rate group |Integration Test|
19+
|BW-006|The safety timeout shall emit an event when it is changes | Integration test|
20+
|BW-007|The burnwire safety time shall emit an event when it starts and stops |Integration Test|
1821

1922
## Port Descriptions
2023
Name | Type | Description |
@@ -28,14 +31,15 @@ Name | Type | Description |
2831
## Commands
2932
| Name | Description |
3033
| ---- | ----------- |
31-
|START_BURNWIRE|Starts the Burn|
34+
|START_BURNWIRE|Starts the Burn. Takes a argument max_duration which sets the parameter safetyMaxCount to timeout the burnwire|
3235
|STOP_BURNWIRE|Stops the Burn|
3336

3437
## Events
3538
| Name | Description |
3639
|---|---|
37-
|Burnwire_Start|Emitted once the burnwire has started|
38-
|Burnwire_Stop|Emitted once the burnwire has ended|
40+
|SetBurnwireState|Emits whether the burnwire turns off or on when it changes state|
41+
|SafetyTimerStatus|Emits when the Safety Time has stopped or started|
42+
|SafetyTimerState|Emits the safety timer argument when it starts|
3943

4044

4145
## Component States
@@ -55,4 +59,4 @@ Add unit test descriptions in the chart below
5559

5660
## Parameter
5761
| Name | Description |
58-
| m_safetyMaxCount | The maximum amount that the burnwire will burn before stopping itself for safety |
62+
| SAFETY_TIMER | By Default set in fpp (currently 10) is the max time the burnwire should ever run|

0 commit comments

Comments
 (0)