| Line | Branch | Decision | Exec | Source |
|---|---|---|---|---|
| 1 | /** | |||
| 2 | * @file tps.h | |||
| 3 | * @brief | |||
| 4 | * | |||
| 5 | * | |||
| 6 | * @date Nov 15, 2013 | |||
| 7 | * @author Andrey Belomutskiy, (c) 2012-2020 | |||
| 8 | */ | |||
| 9 | ||||
| 10 | #pragma once | |||
| 11 | ||||
| 12 | #include "global.h" | |||
| 13 | #include "engine_configuration.h" | |||
| 14 | ||||
| 15 | // Scaled to 1000 counts = 5.0 volts | |||
| 16 | #define TPS_TS_CONVERSION 200 | |||
| 17 | ||||
| 18 | // we have this '100' magic constant too often for two many other reasons todo: refactor further? | |||
| 19 | #define POSITION_FULLY_OPEN 100 | |||
| 20 | ||||
| 21 | 535774 | constexpr inline int convertVoltageTo10bitADC(float voltage) { | ||
| 22 | 535774 | return (int) (voltage * TPS_TS_CONVERSION); | ||
| 23 | } | |||
| 24 | ||||
| 25 | void grabTPSIsClosed(); | |||
| 26 | void grabTPSIsWideOpen(); | |||
| 27 | void grabPedalIsUp(); | |||
| 28 | void grapTps1PrimaryIsClosed(); | |||
| 29 | void grapTps1PrimaryIsOpen(); | |||
| 30 | void grabPedalIsWideOpen(); | |||
| 31 | ||||
| 32 | #if EFI_SENT_SUPPORT | |||
| 33 | ||||
| 34 | struct SentTps : public StoredValueSensor { | |||
| 35 | 1 | SentTps() : StoredValueSensor(SensorType::Tps1, MS2NT(200)) { | ||
| 36 | 1 | } | ||
| 37 | ||||
| 38 | 1 | bool isRedundant() const override { | ||
| 39 | 1 | return true; | ||
| 40 | } | |||
| 41 | }; | |||
| 42 | ||||
| 43 | void sentTpsDecode(SentInput sentCh); | |||
| 44 | float decodeTpsSentValue(float sentValue); | |||
| 45 | bool isDigitalTps1(); | |||
| 46 | ||||
| 47 | #endif | |||
| 48 |