USBCBSuspend Function

Microchip USB Device Library

USB Device Library Help
USBCBSuspend Function
C
void USBCBSuspend();
Description

Call back that is invoked when a USB suspend is detected. 

Example power saving code. Insert appropriate code here for the desired application behavior. If the microcontroller will be put to sleep, a process similar to that shown below may be used: 

Example Psuedo Code:

ConfigureIOPinsForLowPower();
SaveStateOfAllInterruptEnableBits();
DisableAllInterruptEnableBits();

//should enable at least USBActivityIF as a wake source
EnableOnlyTheInterruptsWhichWillBeUsedToWakeTheMicro();

Sleep();

//Preferrably, this should be done in the
//  USBCBWakeFromSuspend() function instead.
RestoreStateOfAllPreviouslySavedInterruptEnableBits();

//Preferrably, this should be done in the
//  USBCBWakeFromSuspend() function instead.
RestoreIOPinsToNormal();

 

IMPORTANT NOTE: Do not clear the USBActivityIF (ACTVIF) bit here. This bit is cleared inside the usb_device.c file. Clearing USBActivityIF here will cause things to not work as intended.

Preconditions

None 

Paramters: None

Side Effects

None 

Remark: None

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