Skip to content

Commit e961503

Browse files
committed
Update sdd.md
1 parent ebed1a0 commit e961503

File tree

6 files changed

+72
-9
lines changed

6 files changed

+72
-9
lines changed

FprimeZephyrReference/Components/Watchdog/Watchdog.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,7 @@ void Watchdog ::run_handler(FwIndexType portNum, U32 context) {
2929
this->m_transitions++;
3030
this->tlmWrite_WatchdogTransitions(this->m_transitions);
3131

32-
// Port may not be connected, so check before sending output
33-
if (this->isConnected_gpioSet_OutputPort(0)) {
34-
this->gpioSet_out(0, (Fw::On::ON == this->m_state) ? Fw::Logic::HIGH : Fw::Logic::LOW);
35-
}
32+
this->gpioSet_out(0, (Fw::On::ON == this->m_state) ? Fw::Logic::HIGH : Fw::Logic::LOW);
3633

3734
this->log_ACTIVITY_LO_WatchdogState(this->m_state);
3835
}
@@ -47,10 +44,12 @@ void Watchdog ::stop_handler(FwIndexType portNum) {
4744
// Handler implementations for commands
4845
// ----------------------------------------------------------------------
4946

47+
//test
5048
void Watchdog ::STOP_WATCHDOG_cmdHandler(FwOpcodeType opCode, U32 cmdSeq) {
5149
// Set the stop flag to stop watchdog petting
5250
this->m_stopRequested = true;
5351

52+
//rather, call stop handler here and emit event`
5453
// Provide command response
5554
this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::OK);
5655
}

FprimeZephyrReference/Components/Watchdog/Watchdog.fpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,15 @@ module Components {
66
sync command STOP_WATCHDOG(
77
)
88

9+
# get rid
910
@ Telemetry channel to report watchdog petter state.
1011
telemetry WatchdogState: Fw.On
1112

13+
# keep but make it U32
1214
@ Telemetry channel counting watchdog petter transitions
1315
telemetry WatchdogTransitions: U64
1416

17+
# get rid of all events except the stop watchdog event
1518
@ Reports the state we set for the watchdog petter.
1619
event SetWatchdogState($state: Fw.On) \
1720
severity activity high \
@@ -22,11 +25,6 @@ module Components {
2225
severity activity low \
2326
format "Watchdog is {}"
2427

25-
@ Event logged when the watchdog petter blink interval is updated
26-
event WatchdogIntervalSet(interval: U32) \
27-
severity activity high \
28-
format "Watchdog blink interval set to {}"
29-
3028
@ Port receiving calls from the rate group
3129
sync input port run: Svc.Sched
3230

FprimeZephyrReference/Components/Watchdog/Watchdog.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,17 @@ class Watchdog : public WatchdogComponentBase {
5050
// Handler implementations for commands
5151
// ----------------------------------------------------------------------
5252

53+
// test prefix
5354
void STOP_WATCHDOG_cmdHandler(FwOpcodeType opCode, U32 cmdSeq) override;
5455

5556

5657

5758
Fw::On m_state = Fw::On::OFF; //! Keeps track if LED is on or off
59+
//U32
5860
U64 m_transitions = 0; //! The number of on/off transitions that have occurred
5961
//! from FSW boot up
62+
63+
// this should be an atomic (std::atomic)
6064
bool m_stopRequested = false; //! Flag to stop the watchdog petting
6165
};
6266

Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[ZoneTransfer]
2+
ZoneId=3
3+
HostUrl=vscode-webview://06sutmqocciejudt1q6dk9i4j0ftrdfegqfv7aiu1ujtv9um6nfr/
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Components::Watchdog Component
2+
3+
## 1. Introduction
4+
5+
The `Components::Watchdog` component provides the mechanism to "pet" the physical watchdog circuit on the PROVES FC Board and provides a visual indicator by blinking an LED at a fixed interval. The component is driven by a rate group and oscillates the watchdog GPIO every rategroup tick.
6+
7+
## 2. Requirements
8+
9+
The requirements for `Components::Watchdog` are as follows:
10+
11+
Requirement | Description | Verification Method
12+
----------- | ----------- | -------------------
13+
WD-001 | The `Components::Watchdog` component shall activate upon startup. | Unit Test
14+
WD-002 | The `Components::Watchdog` component shall oscillate the watchdog GPIO pin (24) on/off on each rategroup tick. | Unit Test
15+
WD-003 | The `Components::Watchdog` component shall provide telemetry for watchdog transition count. | Unit Test
16+
WD-004 | The `Components::Watchdog` component shall respond to stop signals to halt the watchdog petting. | Unit Test
17+
WD-005 | The `Components::Watchdog` component shall provide a test command to stop the watchdog petting. | Unit Test
18+
WD-006 | The `Components::Watchdog` component shall emit an event when the watchdog petting stops. | Unit Test
19+
20+
## 3. Design
21+
22+
### 3.1 Context
23+
24+
#### 3.1.1 Component Diagram
25+
26+
The `Components::Watchdog` component has the following component diagram:
27+
28+
![`Components::Watchdog` Diagram](img/diagram.svg)
29+
30+
#### 3.1.2 Ports
31+
32+
Port Data Type | Name | Direction | Kind | Usage
33+
-------------- | ---- | --------- | ---- | -----
34+
[`Svc::Sched`]| run | Input | Synchronous | Receive periodic calls from rate group
35+
[`Fw::Signal`]| stop | Input | Synchronous | Receive stop signal to stop watchdog petter
36+
[`Drv::GpioWrite`]| gpioSet | Output | n/a | Control GPIO state through driver
37+
38+
#### 3.1.3 Commands
39+
40+
Name | Kind | Description
41+
---- | ---- | -----
42+
TEST_STOP_WATCHDOG | Synchronous | calls the port `stop_runhandler` to stop the watchdog petter.
43+
44+
#### 3.1.4 Events
45+
46+
Name | Description
47+
---- | -----
48+
WatchdogStop | Emits once the watchdog petting has stopped. .
49+
50+
#### 3.1.5 Telemetry
51+
52+
Name | Type | Description
53+
---- | ---- | -----
54+
WatchdogTransitions | U32 | Number of times the GPIO has oscillated from on/off during watchdog petting
55+
56+
## 4. Unit Testing
57+
58+
TODO

0 commit comments

Comments
 (0)