Skip to content

Commit a96b548

Browse files
committed
feedback from deign review
1 parent 488b01c commit a96b548

File tree

5 files changed

+42
-41
lines changed

5 files changed

+42
-41
lines changed

FprimeZephyrReference/Components/Burnwire/Burnwire.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ void Burnwire ::schedIn_handler(FwIndexType portNum, U32 context) {
2828
if (this->m_state == Fw::On::ON) {
2929
this->m_safetyCounter++;
3030
if (this->m_safetyCounter == 1) {
31+
this->gpioSet_out(0, Fw::Logic::HIGH);
32+
this->gpioSet_out(1, Fw::Logic::HIGH);
3133
this->log_ACTIVITY_HI_SafetyTimerStatus(Fw::On::ON);
3234
}
3335

@@ -48,18 +50,14 @@ void Burnwire ::schedIn_handler(FwIndexType portNum, U32 context) {
4850
// ----------------------------------------------------------------------
4951

5052
void Burnwire ::START_BURNWIRE_cmdHandler(FwOpcodeType opCode, U32 cmdSeq) {
53+
// reset count to 0
54+
this->m_safetyCounter = 0;
5155
// update private member variable
5256
this->m_state = Fw::On::ON;
5357
// send event
5458
this->log_ACTIVITY_HI_SetBurnwireState(Fw::On::ON);
5559
// confirm response
5660
this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::OK);
57-
58-
// reset count to 0
59-
this->m_safetyCounter = 0;
60-
61-
this->gpioSet_out(0, Fw::Logic::HIGH);
62-
this->gpioSet_out(1, Fw::Logic::HIGH);
6361
}
6462

6563
void Burnwire ::STOP_BURNWIRE_cmdHandler(FwOpcodeType opCode, U32 cmdSeq) {

FprimeZephyrReference/Components/Burnwire/Burnwire.hpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,10 @@ class Burnwire final : public BurnwireComponentBase {
4949
void STOP_BURNWIRE_cmdHandler(FwOpcodeType opCode, U32 cmdSeq) override;
5050

5151
Fw::On m_state = Fw::On::OFF; // keeps track if burnwire is on or off
52-
U32 m_safetyCounter = 0; // keeps track of the safety number of seconds
53-
U32 m_safetyMaxCount = 5;
52+
std::atomic<U32>
53+
m_safetyCounter; // makes this an atomic variable (so its set only in one comnmdn), so you won't have smth so
54+
// you read and write half the value bc a corrupted read could be dangerouts
55+
U32 m_safetyMaxCount = 5; // make this a aparamater
5456
};
5557

5658
} // namespace Components
Lines changed: 27 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,36 @@
11
# Components::Burnwire
22

3-
Turns Burnwire on and off
3+
Driving the Burnwire on and off. The deployment will be handled by the Antenna Deployment component TODO ADD details
4+
5+
## Sequence Diagrams
6+
Add sequence diagrams here
47

58
## Requirements
69
Add requirements in the chart below
710
| Name | Description | Validation |
8-
|BW-001|The burnwire component shall turn on when commanded to |Hardware Test|
9-
|BW-002|The burnwire component shall turn off when commanded to |Hardware Test|
11+
| ---- | ----------- | ------ |
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|
1014
|BW-003|The burnwire component shall provide an Event when it is turned on and off |Integration Test|
1115
|BW-004|The burnwire component shall activate by turning the GPIO pins on one at a time |Integration Test|
12-
|BW-005|The burnwire component shall be controlled by a safety timeout that can be changed within the code |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+
19+
20+
Use the Zephyr GPIO driver --> so that the GPIO driver can be changed instead of being hardcoded
21+
checking is it calling that set port, break the two layers out
22+
Write, read get interrupt from GPIO
23+
single port of type driver.gPIO write that is a port on your FPP
1324

1425

1526
## Port Descriptions
16-
| Name | Description |
17-
|---|---|
18-
|Fw::Signal|Receive stop signal to stop and start burnwire|
19-
|Drv::GpioWrite|Control GPIO state to driver|
27+
Name | Type | Description |
28+
|----|---|---|
29+
|----|`Fw::Signal`|Receive stop signal to stop the burnwire|
30+
|----|`Fw::Signal`|Receive start signal to start burnwire|
31+
|----|`Drv::GpioWrite`|Control GPIO state to driver|
32+
|schedIn|[`Svc::Sched`]| run | Input | Synchronous | Receive periodic calls from rate group
33+
2034

2135
## Commands
2236
| Name | Description |
@@ -37,31 +51,15 @@ Add component states in the chart below
3751
|----|---|
3852
|m_state|Keeps track if the burnwire is on or off|
3953

40-
## Sequence Diagrams
41-
Add sequence diagrams here
42-
43-
## Parameters
44-
| Name | Description |
45-
|---|---|
46-
|---|---|
47-
48-
49-
50-
51-
52-
## Telemetry
53-
| Name | Description |
54-
|---|---|
55-
|---|---|
5654

5755
## Unit Tests
5856
Add unit test descriptions in the chart below
5957
| Name | Description | Output | Coverage |
6058
|TestSafety|Tests Burnwire turns off after X seconds|---|---|
6159
|TestOn|Tests right GPIO pins turn on |---|---|
62-
|TestOn|Tests right GPIO pins turn off, same as on |---|---|
60+
|TestOn|Tests right GPIO pins turn off, same as |---|---|
6361

64-
## Change Log
65-
| Date | Description |
66-
|---|---|
67-
|---| Initial Draft |
62+
63+
## Parameter
64+
| Name | Description |
65+
| ---- | ----------- |

FprimeZephyrReference/ReferenceDeployment/Top/ReferenceDeploymentTopology.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
#include <zephyr/drivers/gpio.h>
1515

1616
static const struct gpio_dt_spec ledGpio = GPIO_DT_SPEC_GET(DT_ALIAS(led0), gpios);
17+
// static const struct gpio_dt_spec ledGpio = GPIO_DT_SPEC_GET(DT_ALIAS(burnwire0), gpios);
18+
1719
static const struct gpio_dt_spec burnwire0Gpio = {
1820
.port = DEVICE_DT_GET(DT_NODELABEL(gpio0)),
1921
.pin = 28, // 28

boards/rpi_pico2_rp2350a_m33.overlay

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@
99
zephyr,console = &cdc_acm_uart0;
1010
};
1111

12+
aliases {
13+
burnwire0 = &burnwire0;
14+
burnwire1 = &burnwire1;
15+
};
16+
1217
burnwire0: burnwire0 {
1318
gpios = <&gpio0 28 GPIO_ACTIVE_HIGH>;
1419
label = "Burnwire 0, 28";
@@ -19,10 +24,6 @@
1924
label = "Burnwire 1, 29";
2025
};
2126

22-
aliases {
23-
burnwire0 = &burnwire0;
24-
burnwire1 = &burnwire1;
25-
};
2627
};
2728

2829
/* Override the default LED definition to use GPIO 24 instead of GPIO 25 for PROVES FC board*/

0 commit comments

Comments
 (0)