USB Libraries Help > USB Device Libraries > USB Device Layer Library > Library Interface > a) System Interaction Functions > USB_DEVICE_Tasks Function
MPLAB Harmony USB Stack
USB_DEVICE_Tasks Function

This function must be periodically called by the user application. The USB Device layer calls all other function driver tasks in this function. It also generates and forwards events to its clients.

C
void USB_DEVICE_Tasks(
    SYS_MODULE_OBJ object
);
Preconditions

Device layer must have been initialized by calling USB_DEVICE_Initialize.

Parameters
Parameters 
Description 
devLayerObj 
Pointer to the Device Layer Object that is returned from USB_DEVICE_Initialize 
Returns

None.

Remarks

None.

Example
// The USB_DEVICE_Tasks() function should be placed in the 
// SYS_Tasks() function of a MPLAB Harmony application.

SYS_MODULE_OBJ usbDeviceLayerObj; // Returned by USB_DEVICE_Initialize().

void SYS_Tasks(void)
{
    USB_DEVICE_Tasks(usbDeviceLayerObj);
}