summaryrefslogtreecommitdiffstatshomepage
path: root/stmhal/uart.c
diff options
context:
space:
mode:
authorPaul Sokolovsky <pfalcon@users.sourceforge.net>2014-11-17 00:16:14 +0200
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2014-11-17 00:16:14 +0200
commitf4a6a577ab133781c06aec029c806c878555730a (patch)
tree0ef4da33c7e796c215daac7b74167ce74ba1fd28 /stmhal/uart.c
parent5228854f0e026838c21a1e603dab77bb61d2fada (diff)
downloadmicropython-f4a6a577ab133781c06aec029c806c878555730a.tar.gz
micropython-f4a6a577ab133781c06aec029c806c878555730a.zip
stream: Convert .ioctl() to take fixed number of args.
This is more efficient, as allows to use register calling convention. If needed, a structure pointer can be passed as argument to pass more data.
Diffstat (limited to 'stmhal/uart.c')
-rw-r--r--stmhal/uart.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/stmhal/uart.c b/stmhal/uart.c
index f29ccfeb31..870fa49837 100644
--- a/stmhal/uart.c
+++ b/stmhal/uart.c
@@ -713,13 +713,11 @@ 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, int *errcode, ...) {
+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;
- va_list vargs;
- va_start(vargs, errcode);
mp_uint_t ret;
if (request == MP_IOCTL_POLL) {
- mp_uint_t flags = va_arg(vargs, mp_uint_t);
+ mp_uint_t flags = arg;
ret = 0;
if ((flags & MP_IOCTL_POLL_RD) && uart_rx_any(self)) {
ret |= MP_IOCTL_POLL_RD;
@@ -731,7 +729,6 @@ STATIC mp_uint_t pyb_uart_ioctl(mp_obj_t self_in, mp_uint_t request, int *errcod
*errcode = EINVAL;
ret = MP_STREAM_ERROR;
}
- va_end(vargs);
return ret;
}