@@ -194,7 +194,7 @@ STATIC void readfrom(busio_i2c_obj_t *self, mp_int_t address, mp_obj_t buffer, i
194194 mp_buffer_info_t bufinfo ;
195195 mp_get_buffer_raise (buffer , & bufinfo , MP_BUFFER_WRITE );
196196
197- uint32_t length = bufinfo .len ;
197+ size_t length = bufinfo .len ;
198198 normalize_buffer_bounds (& start , end , & length );
199199 if (length == 0 ) {
200200 mp_raise_ValueError (translate ("Buffer must be at least length 1" ));
@@ -253,7 +253,7 @@ STATIC void writeto(busio_i2c_obj_t *self, mp_int_t address, mp_obj_t buffer, in
253253 mp_buffer_info_t bufinfo ;
254254 mp_get_buffer_raise (buffer , & bufinfo , MP_BUFFER_READ );
255255
256- uint32_t length = bufinfo .len ;
256+ size_t length = bufinfo .len ;
257257 normalize_buffer_bounds (& start , end , & length );
258258
259259 // do the transfer
@@ -288,7 +288,8 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_KW(busio_i2c_writeto_obj, 1, busio_i2c_writeto);
288288//| .. method:: writeto_then_readfrom(address, out_buffer, in_buffer, *, out_start=0, out_end=None, in_start=0, in_end=None)
289289//|
290290//| Write the bytes from ``out_buffer`` to the slave specified by ``address``, generate no stop
291- //| bit, generate a repeated start and read into ``in_buffer``.
291+ //| bit, generate a repeated start and read into ``in_buffer``. ``out_buffer`` and
292+ //| ``in_buffer`` can be the same buffer because they are used sequentially.
292293//|
293294//| If ``start`` or ``end`` is provided, then the corresponding buffer will be sliced
294295//| as if ``buffer[start:end]``. This will not cause an allocation like ``buf[start:end]``
0 commit comments