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
MCHPFSUSB Device Library > Function Drivers > Mass Storage Device (MSD) > Public API Members > Functions and Macros > MSDTasks Function