Hi all,
I am working on CC2541 Low power modes.
I tested the PM2 and it is wake up by using external Interrupt.
I found that the osal_start_timerEx() function not working.
Timer does not expire to set the event.
Can i know the issue behind it?
This is my sleep mode Entry code.
#define HAL_SLEEP_SET_POWER_MODE( mode )
st( SLEEPCMD &= ~PMODE;
SLEEPCMD |= (mode);
halSetSleepMode();
)
void setup_port_interrupt(void)
{
// Clear Port 0 Interrupt flags.
P0IF = 0;
P0IFG = 0x00;
// Interrupt enable on all pins on port 0.2.
P0IEN = 0x04;
// Enable CPU Interrupt for Port 0 (IEN1.P0IE = 1).
P0IE = 1;
// Enable Global Interrupt by setting the (IEN0.EA = 1).
EA = 1;
}
#pragma vector = P0INT_VECTOR
__interrupt void port0_isr(void)
{
// Note that the order in which the following flags are cleared is important.
// Clear Port 0 Interrupt Flags.
P0IFG = 0x00;
// Clear CPU Interrupt Flag for P0 (IRCON.P0IF = 0).
P0IF = 0;
// Set LED1 to indicate Active Mode.
CLEAR_SLEEP_MODE();
}
void halSleep( uint32 osal_timeout )
{
// Initialize P1_0for SRF05EB LED1.
P1SEL &= ~(0x01); // Function as General Purpose I/O.
P1_0 = 1; // LED1 on.
P1DIR |= 0x01; // Output.
// Initialize P0_0 for SRF05EB S1 button.
P0SEL &= ~(0x04); // Function as General Purpose I/O.
P0DIR &= ~(0x04); // Input.
P0INP |= 0x04; // 3-state input.
setup_port_interrupt();
halPwrMgtMode = HAL_SLEEP_TIMER;
HAL_SLEEP_SET_POWER_MODE( halPwrMgtMode );
HAL_ENABLE_INTERRUPTS();
return;
}
Can anyone help me to solve the problem?
Thanks
Arul