USBIsDeviceSuspended Macro

Microchip USB Device Library

USB Device Library Help
USBIsDeviceSuspended Macro
C
#define USBIsDeviceSuspended USBSuspendControl
Description

This function indicates if this device is currently suspended. When a device is suspended it will not be able to transfer data over the bus. This function can be used by the application to skip over section of code that do not need to exectute if the device is unable to send data over the bus. 

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
           {
               //Otherwise we are free to run user application code.
               UserApplication();
           }
       }
   }
Preconditions

None

Return Values
Return Values 
Description 
TRUE 
this device is suspended. 
FALSE 
this device is not suspended. 
Remarks

None

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