dspic33_pwm_test.X/axis.c
/**
 * \brief   receives axis commands and delegates them to axis subroutines
 *
 * \param 	_axis_command cmd - command to handled
 *
 * \returns  
 */
\brief   receives axis commands and delegates them to axis subroutines
\param       _axis_command cmd - command to handled

\returns
\ brief receives axis commands and delegates them to axis subroutines \ param _axis_command cmd - command to handled \ returns
void axis_command_handler()
{
    if( axis_command == kAxisIdle )
        return;
    switch( axis_command )
    {
        case kAxisDecreaseSpeed:
            set_axis_velocity( ( axis.velocity - 0.001 ) );
            break;
        case kAxisIncreaseSpeed:
            set_axis_velocity( ( axis.velocity + 0.001 ) );
            break;
        case kAxisSetVelocity:
            break;
        case kAxisForward:
        case kAxisReverse:
        case kAxisStop:
            axis_motion_handler( axis_command );
            break;
        default:
            EnableUSBUARTTransmit;
            printf( "\n\rinvalid axis command" );
            break;
    }
    EnableUSBUARTReceive;
    axis_command = kAxisIdle;
}
void axis_command_handler ( ) { if ( axis_command == kAxisIdle ) return ; switch ( axis_command ) { case kAxisDecreaseSpeed : set_axis_velocity ( ( axis . velocity - 0.001 ) ) ; break ; case kAxisIncreaseSpeed : set_axis_velocity ( ( axis . velocity + 0.001 ) ) ; break ; case kAxisSetVelocity : break ; case kAxisForward : case kAxisReverse : case kAxisStop : axis_motion_handler ( axis_command ) ; break ; default : EnableUSBUARTTransmit ; printf ( " \n \r " ) ; break ; } EnableUSBUARTReceive ; axis_command = kAxisIdle ; }
\brief   receives axis commands and delegates them to axis subroutines
 \param       _axis_command cmd - command to handled
\ brief receives axis commands and delegates them to axis subroutines \ param _axis_command cmd - command to handled
//TODO: pass a parameter for velocity