Hi,
I'm using the SmartRF05 EB Rev. 1.8.1 together with the CC2533EM 1.7. I want to be able to get an interrupt when Button 2 on the EB is pushed. Hardware wise, I connect P10.20 to P10.1 on the EB to connect Button 2 to the CC2533 (since Button 2 is not connected to anything initially). Here's the relevant part of my code:
void Button_2_IntEnable(void);
void main (void){ halBoardInit(); Button_2_IntEnable(); halLedSet(1); while (1) { halLedToggle(1); halMcuWaitMs(1000); }
}
void Button_2_IntEnable(void){ PICTL |= 0x04; // interrupt on falling edge P2IFG = 0; //clear flag P2IF = 0; //clear flag P2IEN = 0x01; // Port 2 Interrupt Enable Mask EA = 1;}
#pragma vector=P2INT_VECTOR__interrupt void Button2_ISR(void){ halLedToggle(2);}
The interrupt doesn't work (the blinking of LED1 works, though, but no toggling of Button 2 when it's pushed). Upon compiling, I do get this warning, though:
Warning[w52]: More than one definition for the byte at address 0x33 in common segment INTVEC. It is defined in module "per_test" as well as in module "hal_digio"
The warning is related to the interrupt routine. How should I go about this?
Thanks!
Seems like one line was left out when I copied and pasted into this forum. After halBoardInit(), I have MCU_IO_INPUT(2, 0, MCU_IO_PULLUP); to define P2.0 as input with an internal pullup.