Native SENT TPS input #5079

only:mre_f4
This commit is contained in:
Andrey 2023-03-01 09:19:22 -05:00
parent 6bce0e319a
commit 1a8af17307
4 changed files with 14 additions and 1 deletions

View File

@ -22,6 +22,8 @@ DDEFS += -DFLEXIBLE_CRITICAL_LED=1
DDEFS += -DHW_FRANKENSO=1
DDEFS += $(DEFAULT_ENGINE_TYPE)
DDEFS += -DEFI_SENT_SUPPORT=TRUE
# TS_SECONDARY_UxART_PORT
DDEFS += -DSTM32_SERIAL_USE_USART3=TRUE
DDEFS += -DTS_SECONDARY_UxART_PORT=SD3

View File

@ -2,6 +2,7 @@
* @author Andrey Belomutskiy, (c) 2012-2020
*/
#include "pch.h"
#include "sent.h"
void grabTPSIsClosed() {
#if EFI_PROD_CODE
@ -46,5 +47,14 @@ bool isPedalError() {
return !Sensor::get(SensorType::AcceleratorPedal).Valid && Sensor::hasSensor(SensorType::AcceleratorPedalPrimary);
}
extern SentTps sentTps;
void sentTpsDecode() {
#if EFI_SENT_SUPPORT
if (!isDigitalTps1()) {
return;
}
float value = getSentValue(0);
sentTps.setValidValue(value, getTimeNowNt());
#endif // EFI_SENT_SUPPORT
}

View File

@ -30,6 +30,7 @@ void grabPedalIsUp();
void grabPedalIsWideOpen();
void sentTpsDecode();
bool isDigitalTps1();
bool isTps1Error();
bool isTps2Error();

View File

@ -165,7 +165,7 @@ 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;
SentTps sentTps;
// Used only in case of weird Ford-style ETB TPS
static RedundantFordTps fordTps1(SensorType::Tps1, SensorType::Tps1Primary, SensorType::Tps1Secondary);