serial_putc waits for the transmission to complete

pull/11816/head
d-kato 2019-11-06 20:48:30 +09:00
parent 076bbe9d56
commit 86f648d0b7
1 changed files with 1 additions and 0 deletions

View File

@ -592,6 +592,7 @@ void serial_putc(serial_t *obj, int c) {
while (!serial_writable(obj));
obj->serial.uart->SCFTDR = c;
serial_put_done(obj);
while ((obj->serial.uart->SCFSR & 0x40) == 0); // Wait TEND = 1
}
static void serial_put_done(serial_t *obj)