mp-s7/mp-s7-src/stringio.c
2019-11-02 19:00:04 +00:00

21 lines
383 B
C

#include <unistd.h>
#include "py/mpconfig.h"
/*
* Core UART functions to implement for a port
*/
// Receive single character
int mp_hal_stdin_rx_chr(void) {
unsigned char c = 0;
int r = read(0, &c, 1);
(void)r;
return c;
}
// Send string of given length
void mp_hal_stdout_tx_strn(const char *str, mp_uint_t len) {
int r = write(1, str, len);
(void)r;
}