diff options
author | Damien George <damien.p.george@gmail.com> | 2017-10-13 20:01:57 +1100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2017-10-13 20:01:57 +1100 |
commit | 37282f8fc135a16ff36e2afe0de907cbde531ed0 (patch) | |
tree | daabbdc393b9870b5383aee08817df24a396ad98 /extmod/misc.h | |
parent | e39fcda8eb1bfc1ccc1660079189f9ae39392abe (diff) |
extmod/uos_dupterm: Update uos.dupterm() and helper funcs to have index.
The uos.dupterm() signature and behaviour is updated to reflect the latest
enhancements in the docs. It has minor backwards incompatibility in that
it no longer accepts zero arguments.
The dupterm_rx helper function is moved from esp8266 to extmod and
generalised to support multiple dupterm slots.
A port can specify multiple slots by defining the MICROPY_PY_OS_DUPTERM
config macro to an integer, being the number of slots it wants to have;
0 means to disable the dupterm feature altogether.
The unix and esp8266 ports are updated to work with the new interface and
are otherwise unchanged with respect to functionality.
Diffstat (limited to 'extmod/misc.h')
-rw-r--r-- | extmod/misc.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/extmod/misc.h b/extmod/misc.h index 6c13592c7..d6f6d859c 100644 --- a/extmod/misc.h +++ b/extmod/misc.h @@ -35,8 +35,9 @@ MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(mp_uos_dupterm_obj); #if MICROPY_PY_OS_DUPTERM +int mp_uos_dupterm_rx_chr(void); void mp_uos_dupterm_tx_strn(const char *str, size_t len); -void mp_uos_deactivate(const char *msg, mp_obj_t exc); +void mp_uos_deactivate(size_t dupterm_idx, const char *msg, mp_obj_t exc); #else #define mp_uos_dupterm_tx_strn(s, l) #endif |