Skip to content

Commit

Permalink
ETB: TpsState getter helper
Browse files Browse the repository at this point in the history
  • Loading branch information
dron0gus committed Feb 28, 2025
1 parent cb69a22 commit 0f49cb0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
9 changes: 9 additions & 0 deletions firmware/controllers/actuators/electronic_throttle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -831,6 +831,15 @@ void etbAutocal(size_t throttleIndex, bool reportToTs) {
}
}

TpsState etbGetState(size_t throttleIndex)
{
if (throttleIndex >= ETB_COUNT) {
return TpsState::NotConfigured;
}

return (TpsState)etbControllers[throttleIndex]->etbErrorCode;
}

/**
* This specific throttle has default position of about 7% open
*/
Expand Down
1 change: 1 addition & 0 deletions firmware/controllers/actuators/electronic_throttle.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ void unregisterEtbPins();
void setProteusHitachiEtbDefaults();

void etbAutocal(size_t throttleIndex, bool reportToTs = true);
TpsState etbGetState(size_t throttleIndex);

float getSanitizedPedal();

Expand Down

0 comments on commit 0f49cb0

Please sign in to comment.