| Line | Branch | Decision | Exec | Source |
|---|---|---|---|---|
| 1 | /** | |||
| 2 | * @file engine_module.h | |||
| 3 | */ | |||
| 4 | ||||
| 5 | #pragma once | |||
| 6 | ||||
| 7 | #include "engine_configuration.h" | |||
| 8 | ||||
| 9 | class EngineModule { | |||
| 10 | public: | |||
| 11 | // Called exactly once during boot, before configuration is loaded | |||
| 12 | ✗ | virtual void initNoConfiguration() { } | ||
| 13 | ||||
| 14 | 16436 | virtual void setDefaultConfiguration() { } | ||
| 15 | ||||
| 16 | // Called when 'Burn' is invoked | |||
| 17 | 5525 | virtual void onConfigurationChange(engine_configuration_s const * /*previousConfig*/) { } | ||
| 18 | ||||
| 19 | // Called approx 20Hz | |||
| 20 | 16290 | virtual void onSlowCallback() { } | ||
| 21 | ||||
| 22 | // Called approx 200Hz | |||
| 23 | 24222 | virtual void onFastCallback() { } | ||
| 24 | ||||
| 25 | // Called when the engine stops. Reset your state, etc to prepare for the next start. | |||
| 26 | 3930 | virtual void onEngineStop() { } | ||
| 27 | ||||
| 28 | // Called whenever the ignition switch state changes | |||
| 29 | 26 | virtual void onIgnitionStateChanged(bool /*ignitionOn*/) { } | ||
| 30 | ||||
| 31 | // Queried to determine whether this module needs a delayed shutoff, defaults to false | |||
| 32 | 28056 | virtual bool needsDelayedShutoff() { return false; } | ||
| 33 | ||||
| 34 | // Called on every successfully decoded tooth of the primary trigger | |||
| 35 | 1005660 | virtual void onEnginePhase(float /*rpm*/, | ||
| 36 | efitick_t /*edgeTimestamp*/, | |||
| 37 | angle_t /*currentPhase*/, | |||
| 38 | angle_t /*nextPhase*/) | |||
| 39 | 1005660 | { } | ||
| 40 | }; | |||
| 41 |