nrf5: Force implementation of tx_str_cooked function if BLE NUS enabled.

If BLE UART service has been enabled, the mp_hal_stdout_tx_strn_cooked
is not defined by default anymore, and has to be implemented by the
UART driver (in this case BLE).
This commit is contained in:
Glenn Ruben Bakke 2017-02-28 23:18:31 +01:00
parent 216c97ff9a
commit 9472196ee7

View File

@ -58,22 +58,20 @@ int mp_hal_stdin_rx_chr(void) {
return 0;
}
#endif
void mp_hal_stdout_tx_str(const char *str) {
mp_hal_stdout_tx_strn(str, strlen(str));
}
#if (MICROPY_PY_BLE_NUS == 0)
void mp_hal_stdout_tx_strn(const char *str, mp_uint_t len) {
if (MP_STATE_PORT(pyb_stdio_uart) != NULL) {
uart_tx_strn(MP_STATE_PORT(pyb_stdio_uart), str, len);
}
}
#endif
void mp_hal_stdout_tx_strn_cooked(const char *str, mp_uint_t len) {
if (MP_STATE_PORT(pyb_stdio_uart) != NULL) {
uart_tx_strn_cooked(MP_STATE_PORT(pyb_stdio_uart), str, len);
}
}
#endif
void mp_hal_stdout_tx_str(const char *str) {
mp_hal_stdout_tx_strn(str, strlen(str));
}