Skip to content

Commit

Permalink
Fix merge conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
zjwhitehead committed Oct 2, 2024
1 parent 6d4f9bf commit a78e3d2
Showing 1 changed file with 9 additions and 22 deletions.
31 changes: 9 additions & 22 deletions src/sp140/sp140.ino
Original file line number Diff line number Diff line change
Expand Up @@ -617,35 +617,22 @@ bool throttleEngaged() {
return false;
}


void setCruise() {
// IDEA: fill a "cruise indicator" as long press activate happens
// or gradually change color from blue to yellow with time
if (!throttleSafe()) { // using pot/throttle
cruisedPotVal = pot->getValue(); // save current throttle val
cruisedAtMillis = millis(); // start timer
// throttle handle runs fast and a lot. need to set the timer before
// setting cruise so its updated in time
// TODO since these values are accessed in another task make sure memory safe
cruising = true;
pulseVibeMotor();

if (ENABLE_BUZ) {
uint16_t notify_melody[] = { 900, 900 };
playMelody(notify_melody, 2);
}

}
}

void afterCruiseStart() {
cruisedPotVal = pot->getValue();
cruisedAtMillis = millis();
playCruiseSound();
pulseVibeMotor();
}

void afterCruiseEnd() {
cruisedPotVal = 0;
playCruiseSound();
pulseVibeMotor();
}

void playCruiseSound() {
if (ENABLE_BUZ) {
uint16_t notify_melody[] = { 500, 500 };
uint16_t notify_melody[] = { 900, 900 };
playMelody(notify_melody, 2);
}
}
Expand Down

0 comments on commit a78e3d2

Please sign in to comment.