MSDTasks Function

Microchip USB Device Library

USB Device Library Help
MSDTasks Function
C
BYTE MSDTasks();
Description

This function runs the MSD class state machines and all of its sub-systems. This function should be called periodically once the device is in the configured state in order to keep the MSD state machine going. 

Typical Usage:

void main(void)
{
    USBDeviceInit();
    while(1)
    {
        USBDeviceTasks();
        if((USBGetDeviceState() < CONFIGURED_STATE) ||
           (USBIsDeviceSuspended() == TRUE))
        {
            //Either the device is not configured or we are suspended
            //  so we don't want to do execute any application code
            continue;   //go back to the top of the while loop
        }
        else
        {
            //Keep the MSD state machine going
            MSDTasks();

            //Run application code.
            UserApplication();
        }
    }
}
Preconditions

None

Return Values
Return Values 
Description 
BYTE 
the current state of the MSD state machine the valid values are defined in MSD.h under the MSDTasks state machine declaration section. The possible values are the following:  
Remarks

None

Microchip MCHPFSUSB v2.3 - Sept 20, 2008
Copyright © 2008 Microchip Technology, Inc.  All rights reserved.