Skip to content
Snippets Groups Projects
Commit 739d8879 authored by dwf1m12's avatar dwf1m12
Browse files

enhance getc from FT1248/UART to support adp test

parent 6e12d2aa
No related branches found
No related tags found
No related merge requests found
...@@ -94,13 +94,9 @@ unsigned char UartPutc(unsigned char my_ch) ...@@ -94,13 +94,9 @@ unsigned char UartPutc(unsigned char my_ch)
// Get a character // Get a character
unsigned char UartGetc(void) unsigned char UartGetc(void)
{ {
if ((CMSDK_USRT2->CTRL & 1)==0) { while (((CMSDK_UART2->STATE & 2)==0) & ((CMSDK_USRT2->STATE & 2)==0));
while ((CMSDK_UART2->STATE & 2)==0); if ((CMSDK_UART2->STATE & 2)==2) return (CMSDK_UART2->DATA);
return (CMSDK_UART2->DATA); if ((CMSDK_USRT2->STATE & 2)==2) return (CMSDK_USRT2->DATA);
} else {
while ((CMSDK_USRT2->STATE & 2)==0);
return (CMSDK_USRT2->DATA);
}
} }
void UartEndSimulation(void) void UartEndSimulation(void)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment