rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
Functions | Variables
tps.cpp File Reference

Functions

static void onGrabPedal ()
 
void grabPedalIsUp ()
 
void grabPedalIsWideOpen ()
 
void grapTps1PrimaryIsClosed ()
 
void grapTps1PrimaryIsOpen ()
 
float decodeTpsSentValue (float sentValue)
 
void sentTpsDecode (SentInput sentCh)
 
bool isDigitalTps1 ()
 

Variables

SentTps sentTps
 

Function Documentation

◆ decodeTpsSentValue()

float decodeTpsSentValue ( float  sentValue)

Definition at line 59 of file tps.cpp.

59 {
62 return interpolateMsg("tps", /*x1*/0xE48, /*y1*/0, /*x2*/0x1A0, /*y2*/POSITION_FULLY_OPEN, /*x*/sentValue);
64 return interpolateMsg("tps", /*x1*/ 250, /*y1*/0, /*x2*/ 3560, /*y2*/POSITION_FULLY_OPEN, /*x*/sentValue);
65 default:
66 return interpolateMsg("tps", /*x1*/engineConfiguration->customSentTpsMin, /*y1*/0, /*x2*/engineConfiguration->customSentTpsMax, /*y2*/POSITION_FULLY_OPEN, /*x*/sentValue);
67 }
68}
float interpolateMsg(const char *msg, float x1, float y1, float x2, float y2, float x)
Linear interpolation by two points.
static constexpr engine_configuration_s * engineConfiguration

Referenced by sentTpsDecode().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ grabPedalIsUp()

void grabPedalIsUp ( )

search for 'maintainConstantValue' to find how this TS magic works

Definition at line 31 of file tps.cpp.

31 {
32 /**
33 * search for 'maintainConstantValue' to find how this TS magic works
34 */
37}
virtual float getRaw() const
Definition sensor.h:148
@ AcceleratorPedalPrimary
@ AcceleratorPedalSecondary
static void onGrabPedal()
Definition tps.cpp:23
void tsCalibrationSetData(TsCalMode mode, float value, float value2, float timeoutMs)

Referenced by handleCommandX14().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ grabPedalIsWideOpen()

void grabPedalIsWideOpen ( )

Definition at line 39 of file tps.cpp.

Referenced by handleCommandX14().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ grapTps1PrimaryIsClosed()

void grapTps1PrimaryIsClosed ( )

Definition at line 45 of file tps.cpp.

Referenced by handleCommandX14().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ grapTps1PrimaryIsOpen()

void grapTps1PrimaryIsOpen ( )

Definition at line 50 of file tps.cpp.

Referenced by handleCommandX14().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isDigitalTps1()

bool isDigitalTps1 ( )

Definition at line 83 of file tps.cpp.

Referenced by initTps(), and sentTpsDecode().

Here is the caller graph for this function:

◆ onGrabPedal()

static void onGrabPedal ( )
static
Author
Andrey Belomutskiy, (c) 2012-2020

Definition at line 23 of file tps.cpp.

23 {
24 static uint8_t grabPedalCounter = 0;
25 grabPedalCounter++;
26 if (grabPedalCounter % 2 == 0) {
27 // todo fix root cause! work-around: make sure not to write bad tune since that would brick requestBurn();
28 }
29}

Referenced by grabPedalIsUp(), and grabPedalIsWideOpen().

Here is the caller graph for this function:

◆ sentTpsDecode()

void sentTpsDecode ( SentInput  sentCh)

Definition at line 71 of file tps.cpp.

71 {
72 if ((!isDigitalTps1()) || (engineConfiguration->EtbSentInput != sentCh)) {
73 return;
74 }
75 // todo: move away from weird float API
76 float sentValue = getSentValue(sentCh);
77 float tpsValue = decodeTpsSentValue(sentValue);
78
80}
void setValidValue(float value, efitick_t timestamp)
efitick_t getTimeNowNt()
Definition efitime.cpp:19
float getSentValue(SentInput input)
Definition sent.cpp:135
bool isDigitalTps1()
Definition tps.cpp:83
SentTps sentTps
Definition init_tps.cpp:181
float decodeTpsSentValue(float sentValue)
Definition tps.cpp:59

Referenced by SentDecoderThread().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ sentTps

SentTps sentTps
extern

Definition at line 181 of file init_tps.cpp.

Referenced by deinitTps(), initTps(), and sentTpsDecode().

Go to the source code of this file.