#define RED 0x01;
#define GREEN 0x02;
#define YELLOW 0x03;
// global variable visible in Watch window of debugger
// increments at least once per button press
volatile uint32_t FallingEdges = 0;
uint8_t isRed = 0;
uint8_t isGreen =0;
uint8_t isYellow =0;
uint8_t setYellow =0;
uint8_t setGreen =0;
int test1 = 0, test2=0, test3=0, test4 = 0, test5 =0, test6 = 0;
void EdgeCounter_Init(void){
__ASM("CPSID I");
FallingEdges = 0; // initialize counter
P1SEL0 &= ~0x12;
P1SEL1 &= ~0x12; // configure P1.4 and P1.1 as GPIO
P1DIR &= ~0x12; // make P1.4 and P1.1 in (built-in Button 1 and Button 2)
P1REN |= 0x12; // enable pull resistors on P1.4 and P1.1
P1OUT |= 0x12; // P1.4 and P1.1 are pull-up
P1IES |= 0x12; // P1.4 and P1.1 are falling edge event
P1IFG &= ~0x12; // clear flag4 and flag1 (reduce possibility of extra interrupt)
P1IE |= 0x12; // arm interrupt on P1.4 and P1.1
NVIC_IPR8 = (NVIC_IPR8&0x00FFFFFF)|0x40000000; // priority 2
NVIC_ISER1 = 0x00000008; // enable interrupt 35 in NVIC
__ASM("CPSIE I");//EnableInterrupts(); // clear the I bit
}