void uart0_init(void) {
- /* select pins 0.0 and 0.1 as tx and rx */
- PINSEL0=(PINSEL0&~(0xf))|0x05;
-
/* configure uart 0 */
UART0_FCR=0x07; // enable fifo
UART0_LCR=0x83; // set dlab + word length
continue;
}
- /* flush if \n and \r do not fit in the tx buffer */
- if(i>14)
- while(!(UART0_LSR&(1<<6)))
- continue;
-
- UART0_THR='\n';
- UART0_THR='\r';
-
/* flush uart0 anyways */
while(!(UART0_LSR&(1<<6)))
continue;