// Polls for a character on the serial port. // Need to change // Returns: Received character //-------------------------------------------------------------- void GetChar(void) { //Poll for data //do //{ // Nothing //} while(SCI0SR1_RDRF == 0); if(SCI0SR1_RDRF != 0){ if(SCI0DRL == 'x' || SCI0DRL == 'X'){ leftCommand = '\0'; (void)printf("\n\r>"); } else if(leftCommand == '\0'){ leftCommand = SCI0DRL; TERMIO_PutChar(leftCommand); } else if(SCI0DRL == '\r'){ DisableInterrupts; processInput(); (void)printf("\r\n>"); EnableInterrupts; } } }
/*FUNCTION*------------------------------------------------------------------- * * Function Name : WriteUARTN * Returned Value : * Comments : * This function writes N bytes on the SCI1 console output * *END*----------------------------------------------------------------------*/ UARTError WriteUARTN(const void* bytes, unsigned long length) { int i; char* src = (char*)bytes; for(i = 0; i< length; i++) { TERMIO_PutChar(*src++); } return kUARTNoError; }
void _ttywrch(int ch) { TERMIO_PutChar(ch); }
int fputc(int ch, FILE *f) { TERMIO_PutChar(ch); return (ch); }