File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
examples/stm32/f4/stm32f4-discovery/timer Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change 24
24
#include <libopencm3/cm3/nvic.h>
25
25
#include <libopencm3/stm32/exti.h>
26
26
27
+ #include <libopencmsis/core_cm3.h>
28
+
27
29
uint16_t frequency_sequence [18 ] = {
28
30
1000 ,
29
31
500 ,
@@ -183,8 +185,16 @@ int main(void)
183
185
gpio_setup ();
184
186
tim_setup ();
185
187
188
+ /* Loop calling Wait For Interrupt. In older pre cortex ARM this is
189
+ * just equivalent to nop. On cortex it puts the cpu to sleep until
190
+ * one of the three occurs:
191
+ *
192
+ * a non-masked interrupt occurs and is taken
193
+ * an interrupt masked by PRIMASK becomes pending
194
+ * a Debug Entry request
195
+ */
186
196
while (1 )
187
- __asm( "nop" );
197
+ __WFI (); /* Wait For Interrupt. */
188
198
189
199
return 0 ;
190
200
}
You can’t perform that action at this time.
0 commit comments