make mp_stream_flush available

This commit is contained in:
Jeff Epler 2023-09-22 13:52:04 -05:00
parent 556ec9d300
commit 085cf0e3e4
No known key found for this signature in database
GPG Key ID: D5BF15AB975AB4DE
2 changed files with 2 additions and 1 deletions

View File

@ -472,7 +472,7 @@ STATIC mp_obj_t stream_tell(mp_obj_t self) {
}
MP_DEFINE_CONST_FUN_OBJ_1(mp_stream_tell_obj, stream_tell);
STATIC mp_obj_t stream_flush(mp_obj_t self) {
mp_obj_t mp_stream_flush(mp_obj_t self) {
const mp_stream_p_t *stream_p = mp_get_stream(self);
int error;
mp_uint_t res = stream_p->ioctl(self, MP_STREAM_FLUSH, 0, &error);

View File

@ -120,6 +120,7 @@ mp_uint_t mp_stream_rw(mp_obj_t stream, void *buf, mp_uint_t size, int *errcode,
#define mp_stream_read_exactly(stream, buf, size, err) mp_stream_rw(stream, buf, size, err, MP_STREAM_RW_READ)
void mp_stream_write_adaptor(void *self, const char *buf, size_t len);
mp_obj_t mp_stream_flush(mp_obj_t self); // CIRCUITPY
#if MICROPY_STREAMS_POSIX_API
#include <sys/types.h>