mirror of
https://github.com/G42makes/mp-s7.git
synced 2024-09-25 05:55:13 +00:00
21 lines
383 B
C
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;
|
||
|
}
|