Skip to content

Commit

Permalink
Native SENT TPS input #5079
Browse files Browse the repository at this point in the history
only:mre_f4
  • Loading branch information
rusefillc committed Mar 1, 2023
1 parent 8cbad5e commit 976b3c0
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
4 changes: 4 additions & 0 deletions firmware/controllers/sensors/tps.h
Expand Up @@ -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();
Expand Down
15 changes: 15 additions & 0 deletions unit_tests/tests/actuators/test_etb_integrated.cpp
Expand Up @@ -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();
}

0 comments on commit 976b3c0

Please sign in to comment.