LCOV - code coverage report
Current view: top level - safety/board - faults.h (source / functions) Coverage Total Hit
Test: coverage.info Lines: 100.0 % 9 9
Test Date: 2025-03-01 06:35:52 Functions: 100.0 % 2 2

            Line data    Source code
       1              : #include "faults_declarations.h"
       2              : 
       3              : uint8_t fault_status = FAULT_STATUS_NONE;
       4              : uint32_t faults = 0U;
       5              : 
       6          120 : void fault_occurred(uint32_t fault) {
       7          120 :   if ((faults & fault) == 0U) {
       8              :     if ((PERMANENT_FAULTS & fault) != 0U) {
       9              :       print("Permanent fault occurred: 0x"); puth(fault); print("\n");
      10              :       fault_status = FAULT_STATUS_PERMANENT;
      11              :     } else {
      12           80 :       print("Temporary fault occurred: 0x"); puth(fault); print("\n");
      13           80 :       fault_status = FAULT_STATUS_TEMPORARY;
      14              :     }
      15              :   }
      16          120 :   faults |= fault;
      17          120 : }
      18              : 
      19        10344 : void fault_recovered(uint32_t fault) {
      20              :   if ((PERMANENT_FAULTS & fault) == 0U) {
      21        10344 :     faults &= ~fault;
      22              :   } else {
      23              :     print("Cannot recover from a permanent fault!\n");
      24              :   }
      25        10344 : }
        

Generated by: LCOV version 2.0-1