
/*
.----------------------------------------------------------------
| void LcdWait(void);
|
| Waits in a loop while the LCD busy flag is set (BF=1).  
|
| Requires: Nothing
| Returns:  Nothing (leaves RS=0, RW*=1 and LCD_PORT = FF)
`----------------------------------------------------------------*/
void LcdWait(void)
{
U8 tmp;

LCD_PORT = 0xFF;                       // Set port for inputs.
LCD_RS = 0;                            // RS = 0 for LCDCR.
LCD_RW = 1;                            // Set R/W* = 1.

do{
   LCD_E = 1;                          // E high.
   tmp = LCD_PORT;                     // Read the data.
   LCD_E = 0;                          // E low again.
   }
while(tmp & 0x80);                     // If BF = 0, done.
}
