summaryrefslogtreecommitdiffstatshomepage
path: root/stmhal/uart.c
diff options
context:
space:
mode:
Diffstat (limited to 'stmhal/uart.c')
-rw-r--r--stmhal/uart.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/stmhal/uart.c b/stmhal/uart.c
index 108236ca1a..2b6f1e40d8 100644
--- a/stmhal/uart.c
+++ b/stmhal/uart.c
@@ -27,11 +27,11 @@
#include <stdio.h>
#include <string.h>
#include <stdarg.h>
-#include <errno.h>
#include "py/nlr.h"
#include "py/runtime.h"
#include "py/stream.h"
+#include "py/mperrno.h"
#include "py/mphal.h"
#include "uart.h"
#include "pybioctl.h"
@@ -829,7 +829,7 @@ STATIC mp_uint_t pyb_uart_read(mp_obj_t self_in, void *buf_in, mp_uint_t size, i
// check that size is a multiple of character width
if (size & self->char_width) {
- *errcode = EIO;
+ *errcode = MP_EIO;
return MP_STREAM_ERROR;
}
@@ -844,7 +844,7 @@ STATIC mp_uint_t pyb_uart_read(mp_obj_t self_in, void *buf_in, mp_uint_t size, i
// wait for first char to become available
if (!uart_rx_wait(self, self->timeout)) {
// return EAGAIN error to indicate non-blocking (then read() method returns None)
- *errcode = EAGAIN;
+ *errcode = MP_EAGAIN;
return MP_STREAM_ERROR;
}
@@ -871,13 +871,13 @@ STATIC mp_uint_t pyb_uart_write(mp_obj_t self_in, const void *buf_in, mp_uint_t
// check that size is a multiple of character width
if (size & self->char_width) {
- *errcode = EIO;
+ *errcode = MP_EIO;
return MP_STREAM_ERROR;
}
// wait to be able to write the first character. EAGAIN causes write to return None
if (!uart_tx_wait(self, self->timeout)) {
- *errcode = EAGAIN;
+ *errcode = MP_EAGAIN;
return MP_STREAM_ERROR;
}
@@ -917,7 +917,7 @@ STATIC mp_uint_t pyb_uart_ioctl(mp_obj_t self_in, mp_uint_t request, mp_uint_t a
ret |= MP_IOCTL_POLL_WR;
}
} else {
- *errcode = EINVAL;
+ *errcode = MP_EINVAL;
ret = MP_STREAM_ERROR;
}
return ret;