Line |
Branch |
Decision |
Exec |
Source |
1 |
|
|
|
// file ignition_controller.h |
2 |
|
|
|
|
3 |
|
|
|
#pragma once |
4 |
|
|
|
|
5 |
|
|
|
#include "engine_module.h" |
6 |
|
|
|
|
7 |
|
|
|
#include <rusefi/timer.h> |
8 |
|
|
|
|
9 |
|
|
|
class IgnitionController : public EngineModule { |
10 |
|
|
|
public: |
11 |
|
|
|
using interface_t = IgnitionController; |
12 |
|
|
|
|
13 |
|
|
|
void onSlowCallback() override; |
14 |
|
|
|
|
15 |
|
|
✗ |
virtual bool getIgnState() const { |
16 |
|
|
✗ |
return m_lastState; |
17 |
|
|
|
} |
18 |
|
|
|
|
19 |
|
|
✗ |
float secondsSinceIgnVoltage() { |
20 |
|
|
✗ |
return m_timeSinceIgnVoltage.getElapsedSeconds(); |
21 |
|
|
|
} |
22 |
|
|
|
|
23 |
|
|
|
private: |
24 |
|
|
|
Timer m_timeSinceIgnVoltage; |
25 |
|
|
|
bool m_lastState = false; |
26 |
|
|
|
}; |
27 |
|
|
|
|
28 |
|
|
|
// USB power or vehicle power? |
29 |
|
|
|
bool isIgnVoltage(); |
30 |
|
|
|
|