| Line | Branch | Decision | Exec | Source |
|---|---|---|---|---|
| 1 | // file lua_hooks.h | |||
| 2 | ||||
| 3 | #pragma once | |||
| 4 | ||||
| 5 | struct lua_State; | |||
| 6 | void configureRusefiLuaHooks(lua_State*); | |||
| 7 | void configureRusefiLuaHooksExt(lua_State*); | |||
| 8 | void luaDeInitPins(); | |||
| 9 | ||||
| 10 | struct AirmassModelBase; | |||
| 11 | AirmassModelBase& getLuaAirmassModel(); | |||
| 12 | bool getAuxDigital(int index); | |||
| 13 | uint32_t getLuaArray(lua_State* l, int paramIndex, uint8_t *data, uint32_t size); | |||
| 14 | ||||
| 15 | struct LuaOverrideSensor final : public Sensor { | |||
| 16 | 4 | LuaOverrideSensor(SensorType type, SensorType underlyingType) : Sensor(type) { | ||
| 17 | 4 | m_underlyingType = underlyingType; | ||
| 18 | 4 | reset(); | ||
| 19 | 4 | } | ||
| 20 | ||||
| 21 | 5 | void reset() { | ||
| 22 | 5 | overrideValue = -1; | ||
| 23 | 5 | } | ||
| 24 | ||||
| 25 | 1 | void setOverrideValue(float value) { | ||
| 26 | 1 | overrideValue = value; | ||
| 27 | 1 | } | ||
| 28 | ||||
| 29 | 4 | SensorResult get() const final override { | ||
| 30 |
2/2✓ Branch 0 taken 3 times.
✓ Branch 1 taken 1 time.
|
2/2✓ Decision 'true' taken 3 times.
✓ Decision 'false' taken 1 time.
|
4 | if (overrideValue < 0) |
| 31 | 3 | return Sensor::get(m_underlyingType); | ||
| 32 | 1 | return overrideValue; | ||
| 33 | } | |||
| 34 | ||||
| 35 | ✗ | void showInfo(const char* sensorName) const override { | ||
| 36 | ✗ | efiPrintf("LuaOverrideSensor \"%s\": override value %.2f", sensorName, overrideValue); | ||
| 37 | ✗ | } | ||
| 38 | ||||
| 39 | float overrideValue = -1; | |||
| 40 | SensorType m_underlyingType; | |||
| 41 | }; | |||
| 42 | ||||
| 43 | void startPwm(int index, float freq, float duty); | |||
| 44 | void setPwmDuty(int index, float duty); | |||
| 45 |