Hi,
I am using MCU TM4C129ENCPDT. I have configured UART7 as the wake up source when my device goes to sleep.
However, I see that my device does not go to sleep. I am sending you the snippet of the code.
uint8_t Set_Battery_Mode(void)
{
uint8_t u8_wifi_ret;
bool benable;
/*Enable UART7 in sleep mode*/
SysCtlPeripheralSleepEnable(SYSCTL_PERIPH_UART7);
UARTClockSourceSet(UART7_BASE, UART_CLOCK_PIOSC);/*Sleep mode clocking for UART is enabled */
/*To set wake up source*/
benable = IntMasterEnable();/*Enable interrupts to the processor*/
if(0u == benable)
{
System_printf("interrupts to the processor not enabled\r\n");
System_flush();
}
IntRegister(INT_UART7, UART7Handler); /*Registers a function to be called when an interrupt ocurs*/
IntPrioritySet(INT_UART7, 0); /*Set the UART 7 interrupt priority to the highest priority*/
IntEnable(INT_UART7); /* Enables UART7 as an interrupt in the interrupt controller*/
UARTIntEnable(UART7_BASE, UART_INT_RX);/* Rx has been set up as an interrupt source*/
/* WiFi is switched OFF in battery mode*/
u8_wifi_ret = WiFi_OFF();
if(0 == u8_wifi_ret)
{
System_printf("\nWiFi OFF Success...\r\n");
System_flush();
}
else
{
System_printf("\nWiFi OFF failed....\r\n");
System_flush();
}
/*System goes to sleep mode*/
SysCtlSleep();
gu8_current_mode = BATTERY_MODE;
return gu8_current_mode;
}
UART pin configurations are taken care in the driver level.
Kindly help. Thankyou.
Regards,
Anjana