Skip to content

Commit 25fc41d

Browse files
committed
unix, modtermios: Make it properly configurable; fix spelling mistake.
1 parent 4f9ebad commit 25fc41d

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

unix/modtermios.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ STATIC mp_obj_t mod_termios_tcgetattr(mp_obj_t fd_in) {
6363
cc->items[i] = MP_OBJ_NEW_SMALL_INT(term.c_cc[i]);
6464
} else {
6565
// https://docs.python.org/3/library/termios.html says value is *string*,
66-
// but now way unicode chars could be there.
66+
// but no way unicode chars could be there.
6767
cc->items[i] = mp_obj_new_bytes(&term.c_cc[i], 1);
6868
}
6969
}

unix/mpconfigport.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,18 @@ extern const struct _mp_obj_module_t mp_module_ffi;
8484
#else
8585
#define MICROPY_PY_TIME_DEF
8686
#endif
87+
#if MICROPY_PY_TERMIOS
88+
#define MICROPY_PY_TERMIOS_DEF { MP_OBJ_NEW_QSTR(MP_QSTR_termios), (mp_obj_t)&mp_module_termios },
89+
#else
90+
#define MICROPY_PY_TERMIOS_DEF
91+
#endif
8792

8893
#define MICROPY_PORT_BUILTIN_MODULES \
8994
MICROPY_PY_FFI_DEF \
9095
MICROPY_PY_TIME_DEF \
9196
{ MP_OBJ_NEW_QSTR(MP_QSTR_microsocket), (mp_obj_t)&mp_module_socket }, \
9297
{ MP_OBJ_NEW_QSTR(MP_QSTR__os), (mp_obj_t)&mp_module_os }, \
93-
{ MP_OBJ_NEW_QSTR(MP_QSTR_termios), (mp_obj_t)&mp_module_termios }, \
98+
MICROPY_PY_TERMIOS_DEF \
9499

95100
// type definitions for the specific machine
96101

0 commit comments

Comments
 (0)