| File | 85 |Lines | 86 |Functions | 87 |Branches | 88 |||||
|---|---|---|---|---|---|---|---|
| 93 | Led.cpp 94 | | 95 |
96 | |
98 | 100.0% | 99 |44 / 44 | 100 |87.5% | 101 |7 / 8 | 102 |57.7% | 103 |45 / 78 | 104 |
108 |
├── lib └── README.md ├── LedBlinker ├── LedBlinkerDeployment │ ├── fprime-gds.yml │ ├── CMakeLists.txt │ ├── Top │ │ ├── CMakeLists.txt │ │ ├── instances.fpp │ │ ├── LedBlinkerDeploymentTopologyDefs.hpp │ │ ├── LedBlinkerDeploymentTopology.hpp │ │ ├── LedBlinkerDeploymentTopology.cpp │ │ ├── LedBlinkerDeploymentPackets.fppi │ │ └── topology.fpp │ ├── README.md │ └── Main.cpp ├── Components │ ├── CMakeLists.txt │ └── Led │ │ ├── docs │ │ ├── blink-cmd.png │ │ └── blink-cmd.uml │ │ ├── test │ │ ├── ut │ │ │ ├── LedTestMain.cpp │ │ │ ├── LedTester.hpp │ │ │ └── LedTester.cpp │ │ └── int │ │ │ └── led_integration_tests.py │ │ ├── coverage │ │ ├── summary.txt │ │ ├── coverage.html │ │ ├── coverage.functions.html │ │ ├── coverage.css │ │ └── coverage.Led.cpp.5ec3b97ffe17af934b96682795bb24f6.html │ │ ├── CMakeLists.txt │ │ ├── Led.fpp │ │ ├── Led.hpp │ │ └── Led.cpp └── CMakeLists.txt ├── .clang-format ├── .gitmodules ├── docs ├── img │ ├── component-design.png │ ├── rancher-config.png │ └── rancher-running.png ├── _config.yml ├── _includes │ └── toc.md ├── appendix-1.md └── led-blinker.md ├── settings.ini ├── .gitignore ├── bin └── macos-docker ├── CMakeLists.txt ├── README.md ├── CMakePresets.json └── LICENSE /lib/README.md: -------------------------------------------------------------------------------- 1 | # Libraries 2 | 3 | Libraries used by F Prime should live here. 4 | -------------------------------------------------------------------------------- /LedBlinker/LedBlinkerDeployment/fprime-gds.yml: -------------------------------------------------------------------------------- 1 | command-line-options: 2 | ip-client: 3 | -------------------------------------------------------------------------------- /LedBlinker/Components/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/Led/") 3 | -------------------------------------------------------------------------------- /.clang-format: -------------------------------------------------------------------------------- 1 | --- 2 | BasedOnStyle: Chromium 3 | IndentWidth: 4 4 | ColumnLimit: 120 5 | AccessModifierOffset: -2 -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "lib/fprime"] 2 | path = lib/fprime 3 | url = https://github.com/nasa/fprime.git 4 | -------------------------------------------------------------------------------- /docs/img/component-design.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fprime-community/fprime-workshop-led-blinker/HEAD/docs/img/component-design.png -------------------------------------------------------------------------------- /docs/img/rancher-config.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fprime-community/fprime-workshop-led-blinker/HEAD/docs/img/rancher-config.png -------------------------------------------------------------------------------- /docs/img/rancher-running.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fprime-community/fprime-workshop-led-blinker/HEAD/docs/img/rancher-running.png -------------------------------------------------------------------------------- /LedBlinker/Components/Led/docs/blink-cmd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fprime-community/fprime-workshop-led-blinker/HEAD/LedBlinker/Components/Led/docs/blink-cmd.png -------------------------------------------------------------------------------- /docs/_config.yml: -------------------------------------------------------------------------------- 1 | title: "F´" 2 | description: "Flight Software & Embedded Systems Framework" 3 | remote_theme: "fprime-community/fprime-theme@main" 4 | includes_dir: _includes 5 | -------------------------------------------------------------------------------- /settings.ini: -------------------------------------------------------------------------------- 1 | [fprime] 2 | project_root: . 3 | framework_path: ./lib/fprime 4 | 5 | default_cmake_options: FPRIME_ENABLE_FRAMEWORK_UTS=OFF 6 | FPRIME_ENABLE_AUTOCODER_UTS=OFF 7 | -------------------------------------------------------------------------------- /LedBlinker/Components/Led/docs/blink-cmd.uml: -------------------------------------------------------------------------------- 1 | ```plantuml 2 | @startuml 3 | ground -> cmdDispatcher: Turn On/Off blink 4 | cmdDispatcher -> led: Turn On/Off blink 5 | led -> led: Sets its blinking state to commanded state 6 | @enduml 7 | ``` 8 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # fprime items 2 | logs/ 3 | cmake-build-* 4 | build-artifacts/ 5 | build-fprime-* 6 | *-template 7 | *.template.cpp 8 | *.template.hpp 9 | 10 | # Misc 11 | /venv/ 12 | /fprime-venv/ 13 | /.idea/ 14 | /.vscode/ 15 | .DS_Store 16 | *.gcov 17 | -------------------------------------------------------------------------------- /LedBlinker/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # This CMake file is intended to register project-wide objects. 2 | # This allows for reuse between deployments, or other projects. 3 | 4 | add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/Components") 5 | add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/LedBlinkerDeployment/") 6 | -------------------------------------------------------------------------------- /bin/macos-docker: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Detect the project root directory 4 | export SOURCE_DIR=`dirname $0` 5 | export PROJECT_ROOT=`cd "${SOURCE_DIR}/.."; pwd` 6 | 7 | USER_ID=`id -u` 8 | GROUP_ID=`id -g` 9 | 10 | docker run --platform=linux/amd64 --net host -e USER=$USER -u "${USER_ID}:${GROUP_ID}" -v "${PROJECT_ROOT}:/project" -it \ 11 | nasafprime/fprime-arm:latest 12 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | #### 2 | # This sets up the build system for the 'led-blinker' project, including 3 | # components and deployments from project.cmake. In addition, it imports the core F Prime components. 4 | #### 5 | 6 | cmake_minimum_required(VERSION 3.13) 7 | project(led-blinker C CXX) 8 | 9 | ### 10 | # F' Core Setup 11 | # This includes all of the F prime core components, and imports the make-system. 12 | ### 13 | include("${CMAKE_CURRENT_LIST_DIR}/lib/fprime/cmake/FPrime.cmake") 14 | # NOTE: register custom targets between these two lines 15 | fprime_setup_included_code() 16 | 17 | 18 | # This includes project-wide objects 19 | add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/LedBlinker") 20 | -------------------------------------------------------------------------------- /LedBlinker/LedBlinkerDeployment/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ##### 2 | # 'LedBlinker' Deployment: 3 | # 4 | # This registers the 'LedBlinker' deployment to the build system. 5 | # Custom components that have not been added at the project-level should be added to 6 | # the list below. 7 | # 8 | ##### 9 | 10 | ### 11 | # Topology and Components 12 | ### 13 | 14 | add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/Top/") 15 | 16 | # Add custom components to this specific deployment here 17 | # add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/MyComponent/") 18 | 19 | register_fprime_deployment( 20 | SOURCES 21 | "${CMAKE_CURRENT_LIST_DIR}/Main.cpp" 22 | DEPENDS 23 | ${FPRIME_CURRENT_MODULE}_Top 24 | ) 25 | -------------------------------------------------------------------------------- /LedBlinker/Components/Led/test/ut/LedTestMain.cpp: -------------------------------------------------------------------------------- 1 | // ====================================================================== 2 | // \title LedTestMain.cpp 3 | // \author ortega 4 | // \brief cpp file for Led component test main function 5 | // ====================================================================== 6 | 7 | #include "LedTester.hpp" 8 | 9 | TEST(Nominal, TestBlinking) { 10 | LedBlinker::LedTester tester; 11 | tester.testBlinking(); 12 | } 13 | 14 | TEST(Nominal, TestBlinkInterval) { 15 | LedBlinker::LedTester tester; 16 | tester.testBlinkInterval(); 17 | } 18 | 19 | int main(int argc, char** argv) { 20 | ::testing::InitGoogleTest(&argc, argv); 21 | return RUN_ALL_TESTS(); 22 | } 23 | -------------------------------------------------------------------------------- /LedBlinker/LedBlinkerDeployment/Top/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | #### 2 | # F Prime CMakeLists.txt: 3 | # 4 | # SOURCES: list of source files (to be compiled) 5 | # AUTOCODER_INPUTS: list of files to be passed to the autocoders 6 | # DEPENDS: list of libraries that this module depends on 7 | # 8 | # More information in the F´ CMake API documentation: 9 | # https://fprime.jpl.nasa.gov/latest/docs/reference/api/cmake/API/ 10 | # 11 | #### 12 | 13 | register_fprime_module( 14 | AUTOCODER_INPUTS 15 | "${CMAKE_CURRENT_LIST_DIR}/instances.fpp" 16 | "${CMAKE_CURRENT_LIST_DIR}/topology.fpp" 17 | SOURCES 18 | "${CMAKE_CURRENT_LIST_DIR}/LedBlinkerDeploymentTopology.cpp" 19 | DEPENDS 20 | Fw_Logger 21 | ) 22 | -------------------------------------------------------------------------------- /LedBlinker/Components/Led/coverage/summary.txt: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------ 2 | GCC Code Coverage Report 3 | Directory: ../.. 4 | ------------------------------------------------------------------------------ 5 | File Lines Exec Cover Missing 6 | ------------------------------------------------------------------------------ 7 | Components/Led/Led.cpp 44 44 100% 8 | ------------------------------------------------------------------------------ 9 | TOTAL 44 44 100% 10 | ------------------------------------------------------------------------------ 11 | -------------------------------------------------------------------------------- /LedBlinker/Components/Led/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | #### 2 | # F Prime CMakeLists.txt: 3 | # 4 | # SOURCES: list of source files (to be compiled) 5 | # AUTOCODER_INPUTS: list of files to be passed to the autocoders 6 | # DEPENDS: list of libraries that this module depends on 7 | # 8 | # More information in the F´ CMake API documentation: 9 | # https://fprime.jpl.nasa.gov/latest/docs/reference/api/cmake/API/ 10 | # 11 | #### 12 | 13 | # Module names are derived from the path from the nearest project/library/framework 14 | # root when not specifically overridden by the developer. i.e. The module defined by 15 | # `Ref/SignalGen/CMakeLists.txt` will be named `Ref_SignalGen`. 16 | 17 | register_fprime_library( 18 | AUTOCODER_INPUTS 19 | "${CMAKE_CURRENT_LIST_DIR}/Led.fpp" 20 | SOURCES 21 | "${CMAKE_CURRENT_LIST_DIR}/Led.cpp" 22 | # DEPENDS 23 | # MyPackage_MyOtherModule 24 | ) 25 | 26 | # ### Unit Tests ### 27 | register_fprime_ut( 28 | AUTOCODER_INPUTS 29 | "${CMAKE_CURRENT_LIST_DIR}/Led.fpp" 30 | SOURCES 31 | "${CMAKE_CURRENT_LIST_DIR}/test/ut/LedTestMain.cpp" 32 | "${CMAKE_CURRENT_LIST_DIR}/test/ut/LedTester.cpp" 33 | DEPENDS 34 | STest # For rules-based testing 35 | UT_AUTO_HELPERS 36 | ) 37 | 38 | -------------------------------------------------------------------------------- /docs/_includes/toc.md: -------------------------------------------------------------------------------- 1 | 2 |
| Directory: | 22 |Components/Led/ | 23 |
|---|---|
| Date: | 26 |2023-04-17 15:08:37 | 27 |
| Coverage: | 30 |31 | low: ≥ 0% 32 | medium: ≥ 75.0% 33 | high: ≥ 90.0% 34 | | 35 |
| 43 | | Exec | 44 |Total | 45 |Coverage | 46 |
|---|---|---|---|
| Lines: | 49 |44 | 50 |44 | 51 |100.0% | 52 |
| Functions: | 55 |7 | 56 |8 | 57 |87.5% | 58 |
| Branches: | 61 |45 | 62 |78 | 63 |57.7% | 64 |
| File | 85 |Lines | 86 |Functions | 87 |Branches | 88 |||||
|---|---|---|---|---|---|---|---|
| 93 | Led.cpp 94 | | 95 |
96 | |
98 | 100.0% | 99 |44 / 44 | 100 |87.5% | 101 |7 / 8 | 102 |57.7% | 103 |45 / 78 | 104 |
| Directory: | 22 |Components/Led/ | 23 |
|---|---|
| Date: | 26 |2023-04-17 15:08:37 | 27 |
| 35 | | Exec | 36 |Total | 37 |Coverage | 38 |
|---|---|---|---|
| Lines: | 41 |44 | 42 |44 | 43 |100.0% | 44 |
| Functions: | 47 |7 | 48 |8 | 49 |87.5% | 50 |
| Branches: | 53 |45 | 54 |78 | 55 |57.7% | 56 |
| Function | 71 |File | 72 |Line | 73 |Call count | 74 |
|---|---|---|---|
| 77 | _ZN10Components3Led11run_handlerEij 78 | | 79 |80 | Components/Led/Led.cpp 81 | | 82 |83 | 42 84 | | 85 |86 | called 12 times 87 | | 88 |
| 91 | _ZN10Components3Led16parameterUpdatedEj 92 | | 93 |94 | Components/Led/Led.cpp 95 | | 96 |97 | 25 98 | | 99 |100 | called 1 time 101 | | 102 |
| 105 | _ZN10Components3Led26BLINKING_ON_OFF_cmdHandlerEjjN2Fw2OnE 106 | | 107 |108 | Components/Led/Led.cpp 109 | | 110 |111 | 83 112 | | 113 |114 | called 2 times 115 | | 116 |
| 119 | _ZN10Components3LedC1EPKc 120 | | 121 |122 | Components/Led/Led.cpp 123 | | 124 |125 | 16 126 | | 127 |128 | called 2 times 129 | | 130 |
| 133 | _ZN10Components3LedC2EPKc 134 | | 135 |136 | Components/Led/Led.cpp 137 | | 138 |139 | 16 140 | | 141 |142 | called 2 times 143 | | 144 |
| 147 | _ZN10Components3LedD0Ev 148 | | 149 |150 | Components/Led/Led.cpp 151 | | 152 |153 | 23 154 | | 155 |156 | not called 157 | | 158 |
| 161 | _ZN10Components3LedD1Ev 162 | | 163 |164 | Components/Led/Led.cpp 165 | | 166 |167 | 23 168 | | 169 |170 | called 2 times 171 | | 172 |
| 175 | _ZN10Components3LedD2Ev 176 | | 177 |178 | Components/Led/Led.cpp 179 | | 180 |181 | 23 182 | | 183 |184 | called 2 times 185 | | 186 |
| Directory: | 22 |Components/Led/ | 23 |
|---|---|
| File: | 26 |Components/Led/Led.cpp | 27 |
| Date: | 30 |2023-04-17 15:08:37 | 31 |
| 38 | | Exec | 39 |Total | 40 |Coverage | 41 |
|---|---|---|---|
| Lines: | 44 |44 | 45 |44 | 46 |100.0% | 47 |
| Functions: | 50 |7 | 51 |8 | 52 |87.5% | 53 |
| Branches: | 56 |45 | 57 |78 | 58 |57.7% | 59 |
| Line | 174 |Branch | 175 |Exec | 176 |Source | 177 |
|---|---|---|---|
| 1 | 180 |181 | | 182 |183 | | // ====================================================================== | 184 |
| 2 | 187 |188 | | 189 |190 | | // \title Led.cpp | 191 |
| 3 | 194 |195 | | 196 |197 | | // \author mstarch | 198 |
| 4 | 201 |202 | | 203 |204 | | // \brief cpp file for Led component implementation class | 205 |
| 5 | 208 |209 | | 210 |211 | | // ====================================================================== | 212 |
| 6 | 215 |216 | | 217 |218 | | 219 | |
| 7 | 222 |223 | | 224 |225 | | #include <config/FpConfig.hpp> | 226 |
| 8 | 229 |230 | | 231 |232 | | #include <Components/Led/Led.hpp> | 233 |
| 9 | 236 |237 | | 238 |239 | | 240 | |
| 10 | 243 |244 | | 245 |246 | | namespace Components { | 247 |
| 11 | 250 |251 | | 252 |253 | | 254 | |
| 12 | 257 |258 | | 259 |260 | | // ---------------------------------------------------------------------- | 261 |
| 13 | 264 |265 | | 266 |267 | | // Construction, initialization, and destruction | 268 |
| 14 | 271 |272 | | 273 |274 | | // ---------------------------------------------------------------------- | 275 |
| 15 | 278 |279 | | 280 |281 | | 282 | |
| 16 | 285 |286 | | 287 |4 | 288 |Led ::Led(const char* const compName) : LedComponentBase(compName), | 289 |
| 17 | 292 |
293 |
294 |
300 | 1/2295 |
296 |
299 | ✓ Branch 0 taken 2 times.
297 | ✗ Branch 1 not taken.
298 | |
301 | 2 | 302 |state(Fw::On::OFF), | 303 |
| 18 | 306 |307 | | 308 |2 | 309 |transitions(0), | 310 |
| 19 | 313 |314 | | 315 |2 | 316 |count(0), | 317 |
| 20 | 320 |321 | | 322 |2 | 323 |blinking(false) | 324 |
| 21 | 327 |328 | | 329 |6 | 330 |{} | 331 |
| 22 | 334 |335 | | 336 |337 | | 338 | |
| 23 | 341 |342 | | 343 |4 | 344 |Led ::~Led() {} | 345 |
| 24 | 348 |349 | | 350 |351 | | 352 | |
| 25 | 355 |356 | | 357 |1 | 358 |void Led ::parameterUpdated(FwPrmIdType id) { | 359 |
| 26 | 362 |363 | | 364 |365 | | // Read back the parameter value | 366 |
| 27 | 369 |370 | | 371 |1 | 372 |Fw::ParamValid isValid; | 373 |
| 28 | 376 |
377 |
378 |
384 | 1/2379 |
380 |
383 | ✓ Branch 0 taken 1 times.
381 | ✗ Branch 1 not taken.
382 | |
385 | 1 | 386 |U32 interval = this->paramGet_BLINK_INTERVAL(isValid); | 387 |
| 29 | 390 |391 | | 392 |393 | | 394 | |
| 30 | 397 |398 | | 399 |400 | | // Check the parameter ID is expected and the read was valid before sending the event | 401 |
| 31 | 404 |
405 |
406 |
412 | 1/2407 |
408 |
411 | ✓ Branch 0 taken 1 times.
409 | ✗ Branch 1 not taken.
410 | |
413 | 1 | 414 |U32 local_parameter_id = (id - this->getIdBase()); | 415 |
| 32 | 418 |
419 |
420 |
430 | 3/6421 |
422 |
429 | ✓ Branch 0 taken 1 times.
423 | ✗ Branch 1 not taken.
424 | ✓ Branch 2 taken 1 times.
425 | ✗ Branch 3 not taken.
426 | ✓ Branch 4 taken 1 times.
427 | ✗ Branch 5 not taken.
428 | |
431 | 1 | 432 |if ((PARAMID_BLINK_INTERVAL == local_parameter_id ) && (Fw::ParamValid::VALID == isValid)) { | 433 |
| 33 | 436 |437 | | 438 |439 | | // Emit the blink set event | 440 |
| 34 | 443 |
444 |
445 |
451 | 1/2446 |
447 |
450 | ✓ Branch 0 taken 1 times.
448 | ✗ Branch 1 not taken.
449 | |
452 | 1 | 453 |this->log_ACTIVITY_HI_BlinkIntervalSet(interval); | 454 |
| 35 | 457 |458 | | 459 |1 | 460 |} | 461 |
| 36 | 464 |465 | | 466 |1 | 467 |} | 468 |
| 37 | 471 |472 | | 473 |474 | | 475 | |
| 38 | 478 |479 | | 480 |481 | | // ---------------------------------------------------------------------- | 482 |
| 39 | 485 |486 | | 487 |488 | | // Handler implementations for user-defined typed input ports | 489 |
| 40 | 492 |493 | | 494 |495 | | // ---------------------------------------------------------------------- | 496 |
| 41 | 499 |500 | | 501 |502 | | 503 | |
| 42 | 506 |507 | | 508 |12 | 509 |void Led ::run_handler(const FwIndexType portNum, U32 context) { | 510 |
| 43 | 513 |514 | | 515 |516 | | // Read back the parameter value | 517 |
| 44 | 520 |521 | | 522 |12 | 523 |Fw::ParamValid isValid; | 524 |
| 45 | 527 |
528 |
529 |
535 | 1/2530 |
531 |
534 | ✓ Branch 0 taken 12 times.
532 | ✗ Branch 1 not taken.
533 | |
536 | 12 | 537 |U32 interval = this->paramGet_BLINK_INTERVAL(isValid); | 538 |
| 46 | 541 |542 | | 543 |544 | | 545 | |
| 47 | 548 |549 | | 550 |551 | | // Force interval to be 0 when invalid or not set | 552 |
| 48 | 555 |
556 |
557 |
569 | 5/8558 |
559 |
568 | ✓ Branch 0 taken 12 times.
560 | ✗ Branch 1 not taken.
561 | ✓ Branch 2 taken 12 times.
562 | ✗ Branch 3 not taken.
563 | ✓ Branch 4 taken 12 times.
564 | ✗ Branch 5 not taken.
565 | ✓ Branch 6 taken 4 times.
566 | ✓ Branch 7 taken 8 times.
567 | |
570 | 12 | 571 |interval = ((Fw::ParamValid::INVALID == isValid) || (Fw::ParamValid::UNINIT == isValid)) ? 0 : interval; | 572 |
| 49 | 575 |576 | | 577 |578 | | 579 | |
| 50 | 582 |583 | | 584 |585 | | // Only perform actions when counting | 586 |
| 51 | 589 |
590 |
591 |
597 | 2/2592 |
593 |
596 | ✓ Branch 0 taken 11 times.
594 | ✓ Branch 1 taken 1 times.
595 | |
598 | 12 | 599 |if (this->blinking) { | 600 |
| 52 | 603 |
604 |
605 |
611 | 1/2606 |
607 |
610 | ✓ Branch 0 taken 11 times.
608 | ✗ Branch 1 not taken.
609 | |
612 | 11 | 613 |Fw::On new_state = this->state; | 614 |
| 53 | 617 |618 | | 619 |620 | | // Check for transitions | 621 |
| 54 | 624 |
625 |
626 |
636 | 5/6627 |
628 |
635 | ✓ Branch 0 taken 5 times.
629 | ✓ Branch 1 taken 6 times.
630 | ✓ Branch 2 taken 5 times.
631 | ✗ Branch 3 not taken.
632 | ✓ Branch 4 taken 4 times.
633 | ✓ Branch 5 taken 1 times.
634 | |
637 | 11 | 638 |if ((0 == this->count) && (this->state == Fw::On::OFF)) { | 639 |
| 55 | 642 |
643 |
644 |
650 | 1/2645 |
646 |
649 | ✓ Branch 0 taken 4 times.
647 | ✗ Branch 1 not taken.
648 | |
651 | 4 | 652 |new_state = Fw::On::ON; | 653 |
| 56 | 656 |
657 |
658 |
668 | 4/6659 |
660 |
667 | ✓ Branch 0 taken 3 times.
661 | ✓ Branch 1 taken 4 times.
662 | ✗ Branch 2 not taken.
663 | ✓ Branch 3 taken 3 times.
664 | ✓ Branch 4 taken 3 times.
665 | ✗ Branch 5 not taken.
666 | |
669 | 11 | 670 |} else if (((interval/2) == this->count) && (this->state == Fw::On::ON)) { | 671 |
| 57 | 674 |
675 |
676 |
682 | 1/2677 |
678 |
681 | ✗ Branch 0 not taken.
679 | ✓ Branch 1 taken 3 times.
680 | |
683 | 3 | 684 |new_state = Fw::On::OFF; | 685 |
| 58 | 688 |689 | | 690 |3 | 691 |} | 692 |
| 59 | 695 |696 | | 697 |698 | | 699 | |
| 60 | 702 |703 | | 704 |705 | | // A transition has occurred | 706 |
| 61 | 709 |
710 |
711 |
721 | 4/6712 |
713 |
720 | ✗ Branch 0 not taken.
714 | ✓ Branch 1 taken 11 times.
715 | ✗ Branch 2 not taken.
716 | ✓ Branch 3 taken 11 times.
717 | ✓ Branch 4 taken 7 times.
718 | ✓ Branch 5 taken 4 times.
719 | |
722 | 11 | 723 |if (this->state != new_state) { | 724 |
| 62 | 727 |728 | | 729 |7 | 730 |this->transitions = this->transitions + 1; | 731 |
| 63 | 734 |
735 |
736 |
744 | 2/4737 |
738 |
743 | ✗ Branch 0 not taken.
739 | ✓ Branch 1 taken 7 times.
740 | ✓ Branch 2 taken 7 times.
741 | ✗ Branch 3 not taken.
742 | |
745 | 7 | 746 |this->tlmWrite_LedTransitions(this->transitions); | 747 |
| 64 | 750 |751 | | 752 |753 | | 754 | |
| 65 | 757 |758 | | 759 |760 | | // Port may not be connected, so check before sending output | 761 |
| 66 | 764 |
765 |
766 |
774 | 2/4767 |
768 |
773 | ✗ Branch 0 not taken.
769 | ✓ Branch 1 taken 7 times.
770 | ✓ Branch 2 taken 7 times.
771 | ✗ Branch 3 not taken.
772 | |
775 | 7 | 776 |if (this->isConnected_gpioSet_OutputPort(0)) { | 777 |
| 67 | 780 |
781 |
782 |
792 | 3/6783 |
784 |
791 | ✗ Branch 0 not taken.
785 | ✓ Branch 1 taken 7 times.
786 | ✗ Branch 2 not taken.
787 | ✓ Branch 3 taken 7 times.
788 | ✓ Branch 4 taken 7 times.
789 | ✗ Branch 5 not taken.
790 | |
793 | 7 | 794 |this->gpioSet_out(0, (Fw::On::ON == new_state) ? Fw::Logic::HIGH : Fw::Logic::LOW); | 795 |
| 68 | 798 |799 | | 800 |7 | 801 |} | 802 |
| 69 | 805 |
806 |
807 |
815 | 2/4808 |
809 |
814 | ✗ Branch 0 not taken.
810 | ✓ Branch 1 taken 7 times.
811 | ✓ Branch 2 taken 7 times.
812 | ✗ Branch 3 not taken.
813 | |
816 | 7 | 817 |this->log_ACTIVITY_LO_LedState(new_state); | 818 |
| 70 | 821 |
822 |
823 |
829 | 1/2824 |
825 |
828 | ✗ Branch 0 not taken.
826 | ✓ Branch 1 taken 7 times.
827 | |
830 | 7 | 831 |this->state = new_state; | 832 |
| 71 | 835 |836 | | 837 |7 | 838 |} | 839 |
| 72 | 842 |843 | | 844 |845 | | 846 | |
| 73 | 849 |850 | | 851 |852 | | 853 | |
| 74 | 856 |857 | | 858 |859 | | 860 | |
| 75 | 863 |
864 |
865 |
871 | 2/2866 |
867 |
870 | ✓ Branch 0 taken 5 times.
868 | ✓ Branch 1 taken 6 times.
869 | |
872 | 11 | 873 |this->count = ((this->count + 1) >= interval) ? 0 : (this->count + 1); | 874 |
| 76 | 877 |878 | | 879 |11 | 880 |} | 881 |
| 77 | 884 |885 | | 886 |12 | 887 |} | 888 |
| 78 | 891 |892 | | 893 |894 | | 895 | |
| 79 | 898 |899 | | 900 |901 | | // ---------------------------------------------------------------------- | 902 |
| 80 | 905 |906 | | 907 |908 | | // Command handler implementations | 909 |
| 81 | 912 |913 | | 914 |915 | | // ---------------------------------------------------------------------- | 916 |
| 82 | 919 |920 | | 921 |922 | | 923 | |
| 83 | 926 |927 | | 928 |2 | 929 |void Led ::BLINKING_ON_OFF_cmdHandler(const FwOpcodeType opCode, const U32 cmdSeq, Fw::On on_off) { | 930 |
| 84 | 933 |934 | | 935 |936 | | // Check the command input before processing | 937 |
| 85 | 940 |
941 |
942 |
950 | 1/4943 |
944 |
949 | ✗ Branch 0 not taken.
945 | ✓ Branch 1 taken 2 times.
946 | ✗ Branch 2 not taken.
947 | ✗ Branch 3 not taken.
948 | |
951 | 2 | 952 |FW_ASSERT(on_off == Fw::On::ON or on_off == Fw::On::OFF, on_off.e); | 953 |
| 86 | 956 |957 | | 958 |2 | 959 |this->count = 0; // Reset count on any command | 960 |
| 87 | 963 |964 | | 965 |2 | 966 |this->blinking = Fw::On::ON == on_off; // Update blinking state | 967 |
| 88 | 970 |
971 |
972 |
978 | 1/2973 |
974 |
977 | ✓ Branch 0 taken 2 times.
975 | ✗ Branch 1 not taken.
976 | |
979 | 2 | 980 |this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::OK); | 981 |
| 89 | 984 |985 | | 986 |2 | 987 |} | 988 |
| 90 | 991 |992 | | 993 |994 | | 995 | |
| 91 | 998 |999 | | 1000 |1001 | | } // end namespace LedBlinker | 1002 |
| 92 | 1005 |1006 | | 1007 |1008 | | 1009 | |