From b96b0d6c00ea72895582ec14f9c7dccd3fe7062a Mon Sep 17 00:00:00 2001 From: Nao Pross Date: Sat, 10 Jun 2017 17:47:36 +0200 Subject: add port interface header, api still to implement fix for bug in usart.c, in function usart_write() that checked the trasmission_empty register at the wrong time causing it to overwrite the buffer. --- sw/z80/kernel/usart.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sw/z80/kernel/usart.c') diff --git a/sw/z80/kernel/usart.c b/sw/z80/kernel/usart.c index 4c2fdaf..9ec6dbd 100644 --- a/sw/z80/kernel/usart.c +++ b/sw/z80/kernel/usart.c @@ -65,8 +65,8 @@ int usart_write(uint8_t *data, size_t size) while (size--) { _usart->buffer = *(dp++); + while (_usart->LSR.transmitter_empty); } - while (_usart->LSR.transmitter_empty); // TODO: do something that actually counts for sent bytes return size; @@ -83,7 +83,7 @@ int usart_read(uint8_t *buffer, size_t count) if (_usart->LSR.framing_error || _usart->LSR.parity_error) { bp--; // delete last byte (?) } else { - read_count++; + read_count++; } } -- cgit v1.2.1