rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
shutdown_controller.h
Go to the documentation of this file.
1/*
2 * @file shutdown_controller.h
3 *
4 */
5
6#pragma once
7
8#include <rusefi/timer.h>
9
10enum 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
24
26public:
28
29 bool isEngineStop(efitick_t nowNt) const {
30 float timeSinceStopRequested = m_engineStopTimer.getElapsedSeconds(nowNt);
31
32 // If there was stop requested in the past 5 seconds, we're in stop mode
33 return timeSinceStopRequested < 5;
34 }
35
36private:
38};
bool isEngineStop(efitick_t nowNt) const
void stopEngine(StopRequestedReason reason)
StopRequestedReason
void doScheduleStopEngine(StopRequestedReason reason)