stm32/mphalport: Make mp_hal_stdin_rx_chr/stdout_tx_strn weakly linked.

To allow for customizations.
This commit is contained in:
Peter D. Gray 2018-07-17 14:22:35 -04:00 committed by Damien George
parent 46091b8a95
commit 0d58f6ba5e
1 changed files with 2 additions and 2 deletions

View File

@ -19,7 +19,7 @@ NORETURN void mp_hal_raise(HAL_StatusTypeDef status) {
mp_raise_OSError(mp_hal_status_to_errno_table[status]); mp_raise_OSError(mp_hal_status_to_errno_table[status]);
} }
int mp_hal_stdin_rx_chr(void) { MP_WEAK int mp_hal_stdin_rx_chr(void) {
for (;;) { for (;;) {
#if 0 #if 0
#ifdef USE_HOST_MODE #ifdef USE_HOST_MODE
@ -52,7 +52,7 @@ void mp_hal_stdout_tx_str(const char *str) {
mp_hal_stdout_tx_strn(str, strlen(str)); mp_hal_stdout_tx_strn(str, strlen(str));
} }
void mp_hal_stdout_tx_strn(const char *str, size_t len) { MP_WEAK void mp_hal_stdout_tx_strn(const char *str, size_t len) {
if (MP_STATE_PORT(pyb_stdio_uart) != NULL) { if (MP_STATE_PORT(pyb_stdio_uart) != NULL) {
uart_tx_strn(MP_STATE_PORT(pyb_stdio_uart), str, len); uart_tx_strn(MP_STATE_PORT(pyb_stdio_uart), str, len);
} }