GCC Code Coverage Report


Directory: ./
File: firmware/controllers/max_limit_with_hysteresis.h
Date: 2025-10-03 00:57:22
Coverage Exec Excl Total
Lines: 100.0% 4 0 4
Functions: 100.0% 2 0 2
Branches: -% 0 0 0
Decisions: -% 0 - 0

Line Branch Decision Exec Source
1 //
2 // Created by kifir on 8/20/24.
3 //
4
5 #pragma once
6
7 #include "hysteresis.h"
8
9 template <typename RisingChecker = StrictChecker, typename FallingChecker = StrictChecker>
10 class MaxLimitWithHysteresis {
11 public:
12 bool checkIfLimitIsExceeded(const float value, const float maxLimit, const float hysteresis);
13 private:
14 Hysteresis m_hysteresis;
15 };
16
17 template <typename RisingChecker, typename FallingChecker>
18 1447 bool MaxLimitWithHysteresis<RisingChecker, FallingChecker>::checkIfLimitIsExceeded(
19 const float value,
20 const float maxLimit,
21 const float hysteresis
22 ) {
23 1447 return m_hysteresis.test<RisingChecker, FallingChecker>(value, maxLimit, maxLimit - hysteresis);
24 }
25