diff options
Diffstat (limited to 'ports')
-rw-r--r-- | ports/MSP430/chcore.h | 7 | ||||
-rw-r--r-- | ports/MSP430/port.dox | 9 |
2 files changed, 14 insertions, 2 deletions
diff --git a/ports/MSP430/chcore.h b/ports/MSP430/chcore.h index 1111118d7..9c42487f2 100644 --- a/ports/MSP430/chcore.h +++ b/ports/MSP430/chcore.h @@ -202,11 +202,16 @@ struct context { /**
* This port function is implemented as inlined code for performance reasons.
+ * @note The port code does not define a low poer mode, this macro has to be
+ * defined externally. The default implementation is a "nop", not a
+ * real low power mode.
*/
#if ENABLE_WFI_IDLE != 0
+#ifndef port_wait_for_interrupt
#define port_wait_for_interrupt() { \
- asm volatile ("wfi"); \
+ asm volatile ("nop"); \
}
+#endif
#else
#define port_wait_for_interrupt()
#endif
diff --git a/ports/MSP430/port.dox b/ports/MSP430/port.dox index 774098e3d..301dcec90 100644 --- a/ports/MSP430/port.dox +++ b/ports/MSP430/port.dox @@ -22,7 +22,8 @@ * order to formally change state because this may change).
* - <b>Serving Regular Interrupt</b>. Normal interrupt service code.
* - <b>Serving Fast Interrupt</b>. Not present in this architecture.
- * - <b>Serving Non-Maskable Interrupt</b>. Not present in this architecture.
+ * - <b>Serving Non-Maskable Interrupt</b>. The MSP430 has several non
+ * maskable interrupt sources that can be associated to this state.
* - <b>Halted</b>. Implemented as an infinite loop with interrupts disabled.
*
* @section MSP430_NOTES The MSP430 port notes
@@ -30,6 +31,12 @@ * enough stack space for interrupts in each thread stack. This can be done
* by modifying the @p INT_REQUIRED_STACK macro into
* <b>./ports/MSP430/chcore.h</b>.
+ * - The state of the hardware multiplier is not saved in the thread context,
+ * make sure to use it in <b>Suspended</b> state (interrupts masked).
+ * - The port code does not define the switch to a low power mode for the
+ * idle thread because the MSP430 has several low power modes. You can
+ * select the proper low power mode for you application by defining the
+ * macro @p port_wait_for_interrupt().
*
* @ingroup Ports
*/
|