void mp_hal_stdout_tx_strn_cooked(const char *str, uint32_t len) { const char *last = str; while (len--) { if (*str == '\n') { if (str > last) { mp_uos_dupterm_tx_strn(last, str - last); } mp_uos_dupterm_tx_strn("\r\n", 2); ++str; last = str; } else { ++str; } } if (str > last) { mp_uos_dupterm_tx_strn(last, str - last); } }
void mp_hal_stdout_tx_char(char c) { uart_tx_one_char(UART0, c); mp_uos_dupterm_tx_strn(&c, 1); }
STATIC void stderr_print_strn(void *env, const char *str, size_t len) { (void)env; ssize_t dummy = write(STDERR_FILENO, str, len); mp_uos_dupterm_tx_strn(str, len); (void)dummy; }
void mp_hal_stdout_tx_strn(const char *str, size_t len) { int ret = write(1, str, len); mp_uos_dupterm_tx_strn(str, len); (void)ret; // to suppress compiler warning }
void mp_hal_stdout_tx_strn(const char *str, uint32_t len) { mp_uos_dupterm_tx_strn(str, len); }
void mp_hal_stdout_tx_str(const char *str) { mp_uos_dupterm_tx_strn(str, strlen(str)); }