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). * - Serving Regular Interrupt. Normal interrupt service code. * - Serving Fast Interrupt. Not present in this architecture. - * - Serving Non-Maskable Interrupt. Not present in this architecture. + * - Serving Non-Maskable Interrupt. The MSP430 has several non + * maskable interrupt sources that can be associated to this state. * - Halted. 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 * ./ports/MSP430/chcore.h. + * - The state of the hardware multiplier is not saved in the thread context, + * make sure to use it in Suspended 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 */