src/ESPStepperMotorServer.cpp
void ESPStepperMotorServer::performEmergencyStop(int stepperId)
{
    this->emergencySwitchIsActive = true;
    //only perform emergency stop for one stepper
    if (stepperId > -1 && stepperId != 255)
    {
        ESPStepperMotorServer_StepperConfiguration *stepper = this->serverConfiguration->getStepperConfiguration(stepperId);
        if (stepper)
        {
            stepper->getFlexyStepper()->emergencyStop();
        }
    }
    else
    {
        //perform complete stop on all steppers
        ESP_FlexyStepper **configuredFlexySteppers = this->serverConfiguration->getConfiguredFlexySteppers();
        for (byte i = 0; i < ESPServerMaxSteppers; i++)
        {
            if (configuredFlexySteppers[i])
            {
                configuredFlexySteppers[i]->emergencyStop();
            }
            else
            {
                break;
            }
        }
    }
}
/**
 * Trigger an emergency stop. Can be called with optional stepper ID to only trigger emergency stop for a specific stepper.
 * If called without the parameter, all configured steppers will be stopped
 **************************************************************************************************************************
 * IMPORTANT NOTE: This function can be called manually, but will also be called from the ISR of the Emegerncy switches,  *
 * so it should be kept as short as possible and not use the CoProcessor (E.g. for floating point arithmetic operations)  *
 **************************************************************************************************************************
 */
Trigger an emergency stop. Can be called with optional stepper ID to only trigger emergency stop for a specific stepper.
If called without the parameter, all configured steppers will be stopped

IMPORTANT NOTE: This function can be called manually, but will also be called from the ISR of the Emegerncy switches,
so it should be kept as short as possible and not use the CoProcessor
Trigger an emergency stop . Can be called with optional stepper ID to only trigger emergency stop for a specific stepper . If called without the parameter all configured steppers will be stopped IMPORTANT NOTE : This function can be called manually but will also be called from the ISR of the Emegerncy switches so it should be kept as short as possible and not use the CoProcessor
void ESPStepperMotorServer::performEmergencyStop(int stepperId)
{
    this->emergencySwitchIsActive = true;
    if (stepperId > -1 && stepperId != 255)
    {
        ESPStepperMotorServer_StepperConfiguration *stepper = this->serverConfiguration->getStepperConfiguration(stepperId);
        if (stepper)
        {
            stepper->getFlexyStepper()->emergencyStop();
        }
    }
    else
    {
        ESP_FlexyStepper **configuredFlexySteppers = this->serverConfiguration->getConfiguredFlexySteppers();
        for (byte i = 0; i < ESPServerMaxSteppers; i++)
        {
            if (configuredFlexySteppers[i])
            {
                configuredFlexySteppers[i]->emergencyStop();
            }
            else
            {
                break;
            }
        }
    }
}
void ESPStepperMotorServer :: performEmergencyStop ( int stepperId ) { this -> emergencySwitchIsActive = true ; if ( stepperId > -1 && stepperId != 255 ) { ESPStepperMotorServer_StepperConfiguration * stepper = this -> serverConfiguration -> getStepperConfiguration ( stepperId ) ; if ( stepper ) { stepper -> getFlexyStepper ( ) -> emergencyStop ( ) ; } } else { ESP_FlexyStepper * * configuredFlexySteppers = this -> serverConfiguration -> getConfiguredFlexySteppers ( ) ; for ( byte i = 0 ; i < ESPServerMaxSteppers ; i ++ ) { if ( configuredFlexySteppers [ i ] ) { configuredFlexySteppers [ i ] -> emergencyStop ( ) ; } else { break ; } } } }
Trigger an emergency stop.
Trigger an emergency stop .
//only perform emergency stop for one stepper //perform complete stop on all steppers