18
18
#include "mbed_interface.h"
19
19
20
20
void sleep (void ) {
21
- // ensure debug is disconnected
22
- mbed_interface_disconnect ();
23
-
24
21
// PCON[PD] set to sleep
25
22
LPC_PMU -> PCON = 0x0 ;
26
23
@@ -31,36 +28,7 @@ void sleep(void) {
31
28
__WFI ();
32
29
}
33
30
34
- /*
35
- * The mbed lpc1768 does not support the deepsleep mode
36
- * as a debugger is connected to it (the mbed interface).
37
- *
38
- * As mentionned in an application note from NXP:
39
- *
40
- * http://www.po-star.com/public/uploads/20120319123122_141.pdf
41
- *
42
- * {{{
43
- * The user should be aware of certain limitations during debugging.
44
- * The most important is that, due to limitations of the Cortex-M3
45
- * integration, the LPC17xx cannot wake up in the usual manner from
46
- * Deep Sleep and Power-down modes. It is recommended not to use these
47
- * modes during debug. Once an application is downloaded via JTAG/SWD
48
- * interface, the USB to SWD/JTAG debug adapter (Keil ULINK2 for example)
49
- * should be removed from the target board, and thereafter, power cycle
50
- * the LPC17xx to allow wake-up from deep sleep and power-down modes
51
- * }}}
52
- *
53
- * As the interface firmware does not reset the target when a
54
- * mbed_interface_disconnect() semihosting call is made, the
55
- * core cannot wake-up from deepsleep.
56
- *
57
- * We treat a deepsleep() as a normal sleep().
58
- */
59
-
60
31
void deepsleep (void ) {
61
- // ensure debug is disconnected
62
- mbed_interface_disconnect ();
63
-
64
32
// PCON[PD] set to deepsleep
65
33
LPC_PMU -> PCON = 0x1 ;
66
34
0 commit comments