Native SENT TPS input #5079

only:alphax-4chan
This commit is contained in:
Andrey 2023-02-23 05:26:42 -05:00
parent 40b61375e3
commit 3247c15838
2 changed files with 9 additions and 0 deletions

View File

@ -19,6 +19,11 @@ constexpr inline int convertVoltageTo10bitADC(float voltage) {
return (int) (voltage * TPS_TS_CONVERSION);
}
struct SentTps : public StoredValueSensor {
SentTps() : StoredValueSensor(SensorType::Tps1, MS2NT(200)) {
}
};
void grabTPSIsClosed();
void grabTPSIsWideOpen();
void grabPedalIsUp();

View File

@ -165,6 +165,8 @@ static FuncSensPair tps2s(TPS_TS_CONVERSION, SensorType::Tps2Secondary);
static RedundantPair analogTps1(tps1p, tps1s, SensorType::Tps1);
static RedundantPair tps2(tps2p, tps2s, SensorType::Tps2);
static SentTps sentTps;
// Used only in case of weird Ford-style ETB TPS
static RedundantFordTps fordTps1(SensorType::Tps1, SensorType::Tps1Primary, SensorType::Tps1Secondary);
static RedundantFordTps fordTps2(SensorType::Tps2, SensorType::Tps2Primary, SensorType::Tps2Secondary);
@ -246,6 +248,8 @@ void deinitTps() {
tps2.deinit(isFordTps, &fordTps2);
pedal.deinit(isFordTps, &fordPps);
sentTps.unregister();
wastegate.deinit();
idlePos.deinit();
}