diff options
| author | cajt <cjt@users.sf.net> | 2024-08-28 22:19:21 +0200 |
|---|---|---|
| committer | Damien George <damien@micropython.org> | 2024-09-06 17:11:47 +1000 |
| commit | 65244d291acda865aef60ec3cd7291c2211caeb2 (patch) | |
| tree | 02bee35e23173733428ee28053bf9dda39b87272 /extmod/modlwip.c | |
| parent | a831c788f76c0742f85b8a35a5860255229b98dc (diff) | |
extmod/modlwip: Fix compile error for lwIP with SLIP support.
Fixes a compile error if STM32 port is compiled with:
make BOARD=(..) MICROPY_PY_LWIP=1 MICROPY_PY_LWIP_SLIP=1
`sio_send()` and `sio_tryread()` now use `mp_get_stream`.
Signed-off-by: Carl Treudler <cjt@users.sf.net>
Diffstat (limited to 'extmod/modlwip.c')
| -rw-r--r-- | extmod/modlwip.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/extmod/modlwip.c b/extmod/modlwip.c index b07c1d815..21c6f7264 100644 --- a/extmod/modlwip.c +++ b/extmod/modlwip.c @@ -127,15 +127,15 @@ sio_fd_t sio_open(u8_t dvnum) { } void sio_send(u8_t c, sio_fd_t fd) { - mp_obj_type_t *type = mp_obj_get_type(MP_STATE_VM(lwip_slip_stream)); + const mp_stream_p_t *stream_p = mp_get_stream(MP_STATE_VM(lwip_slip_stream)); int error; - type->stream_p->write(MP_STATE_VM(lwip_slip_stream), &c, 1, &error); + stream_p->write(MP_STATE_VM(lwip_slip_stream), &c, 1, &error); } u32_t sio_tryread(sio_fd_t fd, u8_t *data, u32_t len) { - mp_obj_type_t *type = mp_obj_get_type(MP_STATE_VM(lwip_slip_stream)); + const mp_stream_p_t *stream_p = mp_get_stream(MP_STATE_VM(lwip_slip_stream)); int error; - mp_uint_t out_sz = type->stream_p->read(MP_STATE_VM(lwip_slip_stream), data, len, &error); + mp_uint_t out_sz = stream_p->read(MP_STATE_VM(lwip_slip_stream), data, len, &error); if (out_sz == MP_STREAM_ERROR) { if (mp_is_nonblocking_error(error)) { return 0; |
