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
MCHPFSUSB Device Library > Stack > Public API Members > Functions and Macros > USBCBSuspend Function