예제 #1
0
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);
    }
}
예제 #2
0
void mp_hal_stdout_tx_char(char c) {
    uart_tx_one_char(UART0, c);
    mp_uos_dupterm_tx_strn(&c, 1);
}
예제 #3
0
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;
}
예제 #4
0
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
}
예제 #5
0
void mp_hal_stdout_tx_strn(const char *str, uint32_t len) {
    mp_uos_dupterm_tx_strn(str, len);
}
예제 #6
0
void mp_hal_stdout_tx_str(const char *str) {
    mp_uos_dupterm_tx_strn(str, strlen(str));
}