Sleep mode not working as expected | Cypress Semiconductor
Sleep mode not working as expected
I am trying to use sleep mode, but I'm experiencing two problems:
1. Only the first sleep seems to work. Subsequent sleep commands seem to pass instantly.
2. Even that first working sleep seems to be the wrong length of time.
Here is my code:
UART_Debug_PutString("going to sleep ...\r\n");
while(UART_Debug_GetTxBufferSize()) // Wait for the UART to finish
CyDelay(5); // Still needs more time
CyDelay(5); // Needed otherwise UART doesn't work.
What have I forgotten?
Many thanks - Hugo