User manual

USB interrupt results in a
USBHID_handleSendCompleted () event,
indicating the HID report has now been sent
bUsbSendCompleted flag is set to TRUE
USB event handlers
From within the USB API
USB interrupt results in new
MSC SCSI command received
Wake from LPM
The handler returns TRUE, waking the
device from LPM0 (if it was sleeping)
Port I/O ISR
Pushbutton is pressed
bButton1Pressed or
bButton1Pressed
flag is set to TRUE
www.ti.com
User Experience Software
Similarly, code checks for these other interrupt-driven events that may have occurred after the main loop
checked their flags. If execution enters sleep while these flags are set, they are not handled until yet
another interrupt occurs. This could cause the device to be unresponsive.
For similar reasons, interrupts are disabled prior to evaluating any of these flags. It takes several cycles to
evaluate these conditions, and because these events can occur at any time, the status of the early flags
could potentially change before LPM0 is actually entered. If LPM0 were then entered, they would get
missed. Disabling interrupts prevents that from happening; the events are simply queued up. When
interrupts are re-enabled, any interrupts that came in take effect immediately.
Therefore, the code simultaneously enters LPM0 and re-enables interrupts by setting the GIE bit:
_bis_SR_register(LPM0_bits + GIE);
If an interrupt had come in while interrupts were disabled, the CPU will wake again in the very next cycle
after entry.
3.5.6 LPM0 Exit
When emulating the code, if the device is sleeping, main() execution is seen resting at the LPM0 entry.
The demo application can then exit LPM0 and resume execution in response to three different events:
A SCSI READ/WRITE command has been received. (This happens from a USB interrupt, which can
happen at any time.)
A USB event has occurred. (This happens from the USB event handlers, which are triggered by USB
interrupts, which again can happen at any time.)
One of the LaunchPad pushbuttons has been pressed.
Figure 30. Waking From LPM0
37
SLAU533ASeptember 2013Revised January 2014 MSP430F5529 LaunchPad™ Development Tool (MSP
EXP430F5529LP)
Submit Documentation Feedback
Copyright © 2013–2014, Texas Instruments Incorporated