BSP430
20141115
Board Support Package for MSP430 microcontrollers
Main Page
Related Pages
Modules
Data Structures
Files
Examples
All
Data Structures
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Modules
Pages
bootstrap/lpm/main.c
#include <
bsp430/platform.h
>
#include <
bsp430/clock.h
>
#include <
bsp430/lpm.h
>
#include <
bsp430/utility/led.h
>
static
const
unsigned
int
lpm_bits[] = {
LPM0_bits
,
LPM1_bits
,
LPM2_bits
,
LPM3_bits
,
LPM4_bits
};
void
main ()
{
WDTCTL = WDTPW | WDTHOLD;
#if (BSP430_LED - 0)
vBSP430ledInitialize_ni
();
{
int
i;
vBSP430ledSet
(0, 1);
for
(i = 0; i < 20; ++i) {
vBSP430ledSet
(0, -1);
vBSP430ledSet
(1, -1);
__delay_cycles(
BSP430_CLOCK_PUC_MCLK_HZ
/ 10);
}
/* The subsequent vBSP430lpmConfigurePortsForLPM_ni() call should
* turn off the LED that's still lit. */
}
#endif
vBSP430lpmConfigurePortsForLPM_ni
();
__delay_cycles(
BSP430_CLOCK_PUC_MCLK_HZ
);
while
(1) {
#if (0 <= APP_LPM) && (APP_LPM <= 4)
BSP430_CORE_LPM_ENTER_NI
(lpm_bits[APP_LPM]);
/* For this application it doesn't matter that GIE is now set */
#endif
}
}
Generated on Sat Nov 15 2014 11:27:13 for BSP430 by
1.8.8