Skip to content

Commit e94920f

Browse files
committed
don't segfault lol #489
1 parent abad53b commit e94920f

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

firmware/controllers/actuators/electronic_throttle.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -494,9 +494,11 @@ void EtbController::setOutput(expected<percent_t> outputValue) {
494494
return;
495495
}
496496

497+
bool limpAllowThrottle = getLimpManager()->allowElectronicThrottle() || engine->etbIgnoreJamProtection;
498+
497499
// If not ETB, or ETB is allowed, output is valid, and we aren't paused, output to motor.
498500
if (!isEtbMode() ||
499-
(getLimpManager()->allowElectronicThrottle()
501+
(limpAllowThrottle
500502
&& outputValue
501503
&& !engineConfiguration->pauseEtbControl)) {
502504
m_motor->enable();

firmware/controllers/limp_manager.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ void LimpManager::setFaultRevLimit(int limit) {
248248
}
249249

250250
bool LimpManager::allowElectronicThrottle() const {
251-
return m_allowEtb || engine->etbIgnoreJamProtection;
251+
return m_allowEtb;
252252
}
253253

254254
bool LimpManager::allowTriggerInput() const {

0 commit comments

Comments
 (0)