Skip to content

Commit 8e05491

Browse files
kevin-f-ortegathomas-bc
authored andcommitted
Update per feedback (#87)
* fixed testToDo typo * fixed filename * rewording * making note consitent with other notes * initializing variable and correctly calling assert
1 parent 0411f43 commit 8e05491

File tree

6 files changed

+13
-16
lines changed

6 files changed

+13
-16
lines changed

Components/Led/Led.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ Led ::Led(const char* const compName) : LedComponentBase(compName) {}
1818
Led ::~Led() {}
1919

2020
void Led ::parameterUpdated(FwPrmIdType id) {
21-
Fw::ParamValid isValid;
21+
Fw::ParamValid isValid = Fw::ParamValid::INVALID;
2222
switch (id) {
2323
case PARAMID_BLINK_INTERVAL: {
2424
// Read back the parameter value
2525
const U32 interval = this->paramGet_BLINK_INTERVAL(isValid);
2626
// NOTE: isValid is always VALID in parameterUpdated as it was just properly set
27-
FW_ASSERT(isValid == Fw::ParamValid::VALID, isValid);
27+
FW_ASSERT(isValid == Fw::ParamValid::VALID, static_cast<FwAssertArgType>(isValid));
2828

2929
// Emit the blink interval set event
3030
this->log_ACTIVITY_HI_BlinkIntervalSet(interval);
@@ -44,9 +44,8 @@ void Led ::run_handler(NATIVE_INT_TYPE portNum, NATIVE_UINT_TYPE context) {
4444
// Read back the parameter value
4545
Fw::ParamValid isValid = Fw::ParamValid::INVALID;
4646
U32 interval = this->paramGet_BLINK_INTERVAL(isValid);
47-
48-
// Force interval to be 0 when invalid or not set
49-
interval = ((isValid == Fw::ParamValid::INVALID) || (isValid == Fw::ParamValid::UNINIT)) ? 0 : interval;
47+
FW_ASSERT((isValid != Fw::ParamValid::INVALID) && (isValid != Fw::ParamValid::UNINIT),
48+
static_cast<FwAssertArgType>(isValid));
5049

5150
// Only perform actions when set to blinking
5251
if (this->m_blinking && (interval != 0)) {

docs/component-implementation-1.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ Verify your component is building correctly by running the following command in
157157
fprime-util build
158158
```
159159

160-
Fix any errors that occur before proceeding with the rest of the tutorial.
160+
> Fix any errors that occur before proceeding with the rest of the tutorial.
161161
162162
### Component State
163163

docs/component-implementation-2.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,8 @@ void Led ::run_handler(NATIVE_INT_TYPE portNum, NATIVE_UINT_TYPE context) {
106106
// Read back the parameter value
107107
Fw::ParamValid isValid = Fw::ParamValid::INVALID;
108108
U32 interval = this->paramGet_BLINK_INTERVAL(isValid);
109-
110-
// Force interval to be 0 when invalid or not set
111-
interval = ((isValid == Fw::ParamValid::INVALID) || (isValid == Fw::ParamValid::UNINIT)) ? 0 : interval;
109+
FW_ASSERT((isValid != Fw::ParamValid::INVALID) && (isValid != Fw::ParamValid::UNINIT),
110+
static_cast<FwAssertArgType>(isValid));
112111

113112
// Only perform actions when set to blinking
114113
if (this->m_blinking && (interval != 0)) {
@@ -195,13 +194,13 @@ Save file and in your `led-blinker/Components/Led` directory, open `Led.cpp` and
195194
196195
```cpp
197196
void Led ::parameterUpdated(FwPrmIdType id) {
198-
Fw::ParamValid isValid;
197+
Fw::ParamValid isValid = Fw::ParamValid::INVALID;
199198
switch (id) {
200199
case PARAMID_BLINK_INTERVAL: {
201200
// Read back the parameter value
202201
const U32 interval = this->paramGet_BLINK_INTERVAL(isValid);
203202
// NOTE: isValid is always VALID in parameterUpdated as it was just properly set
204-
FW_ASSERT(isValid == Fw::ParamValid::VALID, isValid);
203+
FW_ASSERT(isValid == Fw::ParamValid::VALID, static_cast<FwAssertArgType>(isValid));
205204
206205
// Emit the blink interval set event
207206
// TODO: Emit an event with, severity activity high, named BlinkIntervalSet that takes in an argument of

docs/full-integration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ This is done by adding the following at the end of the `configureTopology` funct
5151
}
5252
```
5353
54-
And since this code uses `Fw::Logger`, you will need to add the following line near the top of the `Led.cpp` file.
54+
And since this code uses `Fw::Logger`, you will need to add the following line near the top of the `led-blinker/LedBlinker/Top/LedBlinkerTopology.cpp` file.
5555
5656
```c++
5757
#include <Fw/Logger/Logger.hpp>

docs/requirements.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Specifying Requirements
22

3-
In this addendum to the tutorial, you will learn a bit about specifying requirements. Software requirements are derived from higher-level system requirements and represent the detail needed to implement the software.
3+
In this section to the tutorial, you will learn a bit about specifying requirements. Software requirements are derived from higher-level system requirements and represent the detail needed to implement the software.
44

55
## System Requirements
66

docs/unit-testing.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,13 @@ fprime-util check
6464
6565
## Add a New Test Case
6666

67-
Now that unit tests have been written, we can add our first unit test case. First, remove the default `ToDo` test and add a new test case called `testBlinking`.
68-
In `led-blinker/Components/Led/test/ut/LedTester.hpp` rename the declaration for `testToDo` to be `testBlinking` instead:
67+
Now that unit tests have been written, we can add our first unit test case. First, remove the default `toDo` test and add a new test case called `testBlinking`. In `led-blinker/Components/Led/test/ut/LedTester.hpp` rename the declaration for `toDo` to be `testBlinking` instead:
6968

7069
```c++
7170
void testBlinking();
7271
```
7372

74-
In `led-blinker/Components/Led/test/ut/LedTester.cpp` rename the definition for `testToDo` to be `testBlinking`:
73+
In `led-blinker/Components/Led/test/ut/LedTester.cpp` rename the definition for `toDo` to be `testBlinking`:
7574

7675
```c++
7776
void LedTester ::testBlinking() {

0 commit comments

Comments
 (0)