Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions src/sp140/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1120,13 +1120,9 @@ bool shouldDisengageCruise(int potVal) {

/**
* Handles throttle control when in ARMED_CRUISING state
* @param currentCruiseThrottlePWM Reference to the cruise PWM value
* @param potVal Current raw potentiometer value
*/
void handleCruisingThrottle(uint16_t &currentCruiseThrottlePWM, int potVal) {
// Set the ESC throttle to the determined (and potentially capped) cruise PWM
setESCThrottle(currentCruiseThrottlePWM);

void handleCruisingThrottle(int potVal) {
// Check for cruise disengagement via potentiometer override
if (shouldDisengageCruise(potVal)) {
changeDeviceState(ARMED); // Transition back to normal ARMED state
Expand Down Expand Up @@ -1170,7 +1166,7 @@ void handleThrottle() {
break;

case ARMED_CRUISING:
handleCruisingThrottle(currentCruiseThrottlePWM, readThrottleRaw());
handleCruisingThrottle(readThrottleRaw());
finalPwm = currentCruiseThrottlePWM; // Use cruise PWM
break;

Expand Down
Loading