diff options
Diffstat (limited to 'src/rv64/rv64-uart.c')
| -rw-r--r-- | src/rv64/rv64-uart.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/rv64/rv64-uart.c b/src/rv64/rv64-uart.c index ea896bc..3e3eee7 100644 --- a/src/rv64/rv64-uart.c +++ b/src/rv64/rv64-uart.c @@ -11,34 +11,34 @@ /* this file handles the UART */ -static uint8_t* mp_uart_ptr = (uint8_t*)SYS_UART_BASE; +static uint8_t* cb_uart_ptr = (uint8_t*)SYS_UART_BASE; -utf_char_t mp_get_char(void) +utf_char_t cb_get_char(void) { uintptr_t ptr = SYS_UART_BASE; while (!(*(((volatile uint8_t*)ptr) + 0x05) & 0x01)) ; - return (utf_char_t)*mp_uart_ptr; + return (utf_char_t)*cb_uart_ptr; } // we need that one, to avoid sending mutliple chars to UART. -static boolean mp_locked_put_char = no; +static boolean cb_locked_put_char = no; -void mp_put_char(utf_char_t ch) +void cb_put_char(utf_char_t ch) { - while (mp_locked_put_char) + while (cb_locked_put_char) { } - mp_locked_put_char = yes; - *mp_uart_ptr = ch; - mp_locked_put_char = no; + cb_locked_put_char = yes; + *cb_uart_ptr = ch; + cb_locked_put_char = no; } /// @brief UART put string /// @param text the input text. -size_t mp_put_string(const char* text) +size_t cb_put_string(const char* text) { if (text == nil) return 0; @@ -47,7 +47,7 @@ size_t mp_put_string(const char* text) for (; i < strlen(text); i++) { - mp_put_char(text[i]); + cb_put_char(text[i]); } return i; |
