diff options
author | Damien George <damien.p.george@gmail.com> | 2016-12-02 16:37:29 +1100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2016-12-02 16:37:29 +1100 |
commit | 304cfda8c466920b1d29903bfca8bca5ed110f3b (patch) | |
tree | 1a6e2aec1e3da97d6e50512c4923a404087bd932 /stmhal/uart.c | |
parent | 6194336d81e73e74eb7e0f26501966082ce4d411 (diff) | |
download | micropython-304cfda8c466920b1d29903bfca8bca5ed110f3b.tar.gz micropython-304cfda8c466920b1d29903bfca8bca5ed110f3b.zip |
py/stream: Move ad-hoc ioctl constants to stream.h and rename them.
The constants MP_IOCTL_POLL_xxx, which were stmhal-specific, are moved
from stmhal/pybioctl.h (now deleted) to py/stream.h. And they are renamed
to MP_STREAM_POLL_xxx to be consistent with other such constants.
All uses of these constants have been updated.
Diffstat (limited to 'stmhal/uart.c')
-rw-r--r-- | stmhal/uart.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/stmhal/uart.c b/stmhal/uart.c index 37c1906c1f..b16cf3481c 100644 --- a/stmhal/uart.c +++ b/stmhal/uart.c @@ -34,7 +34,6 @@ #include "py/mperrno.h" #include "py/mphal.h" #include "uart.h" -#include "pybioctl.h" #include "irq.h" //TODO: Add UART7/8 support for MCU_SERIES_F7 @@ -901,14 +900,14 @@ STATIC mp_uint_t pyb_uart_write(mp_obj_t self_in, const void *buf_in, mp_uint_t STATIC mp_uint_t pyb_uart_ioctl(mp_obj_t self_in, mp_uint_t request, mp_uint_t arg, int *errcode) { pyb_uart_obj_t *self = self_in; mp_uint_t ret; - if (request == MP_IOCTL_POLL) { + if (request == MP_STREAM_POLL) { mp_uint_t flags = arg; ret = 0; - if ((flags & MP_IOCTL_POLL_RD) && uart_rx_any(self)) { - ret |= MP_IOCTL_POLL_RD; + if ((flags & MP_STREAM_POLL_RD) && uart_rx_any(self)) { + ret |= MP_STREAM_POLL_RD; } - if ((flags & MP_IOCTL_POLL_WR) && __HAL_UART_GET_FLAG(&self->uart, UART_FLAG_TXE)) { - ret |= MP_IOCTL_POLL_WR; + if ((flags & MP_STREAM_POLL_WR) && __HAL_UART_GET_FLAG(&self->uart, UART_FLAG_TXE)) { + ret |= MP_STREAM_POLL_WR; } } else { *errcode = MP_EINVAL; |