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:
parent
216c97ff9a
commit
9472196ee7
@ -58,22 +58,20 @@ int mp_hal_stdin_rx_chr(void) {
|
|||||||
|
|
||||||
return 0;
|
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) {
|
void mp_hal_stdout_tx_strn(const char *str, mp_uint_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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
void mp_hal_stdout_tx_strn_cooked(const char *str, mp_uint_t len) {
|
void mp_hal_stdout_tx_strn_cooked(const char *str, mp_uint_t len) {
|
||||||
if (MP_STATE_PORT(pyb_stdio_uart) != NULL) {
|
if (MP_STATE_PORT(pyb_stdio_uart) != NULL) {
|
||||||
uart_tx_strn_cooked(MP_STATE_PORT(pyb_stdio_uart), str, len);
|
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));
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user