Index: firmware/App/Controllers/Ejector.c =================================================================== diff -u -rfe9b77e60850fe37da225d4348f0a6a8defc28db -r9a8e1fc597eb4f681527e691fb6cb24e550d8b92 --- firmware/App/Controllers/Ejector.c (.../Ejector.c) (revision fe9b77e60850fe37da225d4348f0a6a8defc28db) +++ firmware/App/Controllers/Ejector.c (.../Ejector.c) (revision 9a8e1fc597eb4f681527e691fb6cb24e550d8b92) @@ -199,15 +199,26 @@ /*********************************************************************//** * @brief * The abortEjectorOperation function requests an ejector abort operation. - * @details \b Inputs: none + * @details \b Inputs: currentEjectorState * @details \b Outputs: ejectorAbortRequested * @return none *************************************************************************/ void abortEjectorOperation( void ) { - setEjectorMotorSpeed( EJECTOR_OFF_MOTOR_SPEED_RPM ); - // Set the flag to TRUE regardless of where the ejector is at - ejectorAbortRequested = TRUE; + switch ( currentEjectorState ) + { + case EJECTOR_STATE_HOMING: + case EJECTOR_STATE_RETRACTING: + case EJECTOR_STATE_EXTENDING: + setEjectorMotorSpeed( EJECTOR_OFF_MOTOR_SPEED_RPM ); + // Set the flag to TRUE regardless of where the ejector is at + ejectorAbortRequested = TRUE; + break; + + default: + // Do nothing on the rest of the states. Only initiate the abort sequence if an operation is in progress. + break; + } } /*********************************************************************//**