diff --git a/include/Main.h b/include/Main.h index 54805573..1d8ce3b5 100644 --- a/include/Main.h +++ b/include/Main.h @@ -65,7 +65,6 @@ class SS2K { void updateStealthChop(); void updateStepperSpeed(int speed = 0); void checkDriverTemperature(); - void motorStop(bool releaseTension = false); void FTMSModeShiftModifier(); static void rxSerial(void); void txSerial(); diff --git a/src/ERG_Mode.cpp b/src/ERG_Mode.cpp index 51ea2ce9..7b7f3a34 100644 --- a/src/ERG_Mode.cpp +++ b/src/ERG_Mode.cpp @@ -1204,9 +1204,8 @@ void ErgMode::_updateValues(int newCadence, Measurement& newWatts, float newIncl bool ErgMode::_userIsSpinning(int cadence, float incline) { if (cadence <= MIN_ERG_CADENCE) { - if (!this->engineStopped) { // Test so motor stop command only happens once. - ss2k->motorStop(); // release tension - rtConfig->setTargetIncline(incline - WATTS_PER_SHIFT); // release incline + if (!this->engineStopped) { // Test so motor stop command only happens once. // release tension + rtConfig->setTargetIncline(0); // release incline this->engineStopped = true; } return false; // Cadence too low, nothing to do here diff --git a/src/Main.cpp b/src/Main.cpp index 4b5b9c30..c54344f2 100644 --- a/src/Main.cpp +++ b/src/Main.cpp @@ -713,23 +713,6 @@ void SS2K::checkDriverTemperature() { } } -/** - * @brief Stops the motor and optionally releases tension. - * - * This function stops the motor by calling the stopMove() method on the stepper object. - * It then sets the current position of the stepper to the target position stored in ss2k. - * If the releaseTension parameter is true, the function moves the stepper to a position - * that releases tension by subtracting a calculated shift step from the target position. - * - * @param releaseTension A boolean flag indicating whether to release tension after stopping the motor. - */ -void SS2K::motorStop(bool releaseTension) { - stepper->stopMove(); - if (releaseTension) { - rtConfig->setTargetIncline(ss2k->getCurrentPosition() - userConfig->getShiftStep()); - } -} - void SS2K::txSerial() { // Serial.printf(" Before TX "); if (PELOTON_TX && (txCheck >= 1)) { static int alternate = 0;