Skip to content

Commit

Permalink
don't segfault lol #489
Browse files Browse the repository at this point in the history
  • Loading branch information
mck1117 committed Sep 18, 2024
1 parent abad53b commit e94920f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion firmware/controllers/actuators/electronic_throttle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -494,9 +494,11 @@ void EtbController::setOutput(expected<percent_t> outputValue) {
return;
}

bool limpAllowThrottle = getLimpManager()->allowElectronicThrottle() || engine->etbIgnoreJamProtection;

// If not ETB, or ETB is allowed, output is valid, and we aren't paused, output to motor.
if (!isEtbMode() ||
(getLimpManager()->allowElectronicThrottle()
(limpAllowThrottle
&& outputValue
&& !engineConfiguration->pauseEtbControl)) {
m_motor->enable();
Expand Down
2 changes: 1 addition & 1 deletion firmware/controllers/limp_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ void LimpManager::setFaultRevLimit(int limit) {
}

bool LimpManager::allowElectronicThrottle() const {
return m_allowEtb || engine->etbIgnoreJamProtection;
return m_allowEtb;
}

bool LimpManager::allowTriggerInput() const {
Expand Down

0 comments on commit e94920f

Please sign in to comment.