GCC Code Coverage Report


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

Line Branch Decision Exec Source
1 /*
2 * @file shutdown_controller.h
3 *
4 */
5
6 #pragma once
7
8 #include <rusefi/timer.h>
9
10 enum class StopRequestedReason : uint8_t {
11 None, // 0
12 StartButton, // 1
13 Lua, // 2
14 Console, // 3
15 TsCommand, // 4
16
17 Board1,
18 Board2,
19 Board3,
20
21 };
22
23 void doScheduleStopEngine(StopRequestedReason reason);
24
25 class ShutdownController {
26 public:
27 void stopEngine(StopRequestedReason reason);
28
29 3500 bool isEngineStop(efitick_t nowNt) const {
30 3500 float timeSinceStopRequested = m_engineStopTimer.getElapsedSeconds(nowNt);
31
32 // If there was stop requested in the past 5 seconds, we're in stop mode
33 3500 return timeSinceStopRequested < 5;
34 }
35
36 private:
37 Timer m_engineStopTimer;
38 };
39