I am trying to run a very simple program that lightens two LEDs on the exp4618 board when I push a button, but the compiler seams to ignore my while(1) forever loop, somehow the program excecute the P2OUT=0x00; row every time I have pushed the button and the LEDs are turned off again...
Very disturbing, is there any optimizations setting in the compiler that must be changed so that while(1) is not ignored??
#include "msp430xG46x.h"
void main(void)
{
P1DIR&=0xFD;
P2DIR|=0x06;
P2OUT=0x00;
while(1)
{
if ((P1IN | 0xFD)==0xFD)
{
P2OUT=0x06;
}
}
}