Native SENT TPS input #5079

only:mre_f4
This commit is contained in:
Andrey 2023-03-01 14:26:24 -05:00
parent 8cbad5e591
commit 976b3c0306
2 changed files with 19 additions and 0 deletions

View File

@ -22,6 +22,10 @@ constexpr inline int convertVoltageTo10bitADC(float voltage) {
struct SentTps : public StoredValueSensor {
SentTps() : StoredValueSensor(SensorType::Tps1, MS2NT(200)) {
}
bool isRedundant() const override {
return true;
}
};
void grabTPSIsClosed();

View File

@ -137,3 +137,18 @@ TEST(etb, intermittentPps) {
etb->update();
EXPECT_NE(0, etb->etbErrorCode);
}
TEST(etb, sentTpsIntegrated) {
EngineTestHelper eth(TEST_ENGINE); // we have a destructor so cannot move EngineTestHelper into utility method
engineConfiguration->sentInputPins[0] = Gpio::B3;
engineConfiguration->sentEtbType = SentEtbType::GM_TYPE_1;
engineConfiguration->throttlePedalPositionAdcChannel = EFI_ADC_3;
engineConfiguration->throttlePedalPositionSecondAdcChannel = EFI_ADC_3;
Sensor::setMockValue(SensorType::Tps1, 25.0f, true);
initTps();
doInitElectronicThrottle();
}