We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6be0a42 commit 530e5a1Copy full SHA for 530e5a1
shared-bindings/busio/I2C.c
@@ -344,9 +344,7 @@ STATIC mp_obj_t busio_i2c_writeto_then_readfrom(size_t n_args, const mp_obj_t *p
344
int32_t in_start = args[ARG_in_start].u_int;
345
const int32_t in_end = args[ARG_in_end].u_int;
346
normalize_buffer_bounds(&in_start, in_end, &in_length);
347
- if (in_length == 0) {
348
- mp_raise_ValueError_varg(translate("%q length must be >= %d"), MP_QSTR_out_buffer, 1);
349
- }
+ mp_arg_validate_length_min(in_length, 1, MP_QSTR_out_buffer);
350
351
uint8_t status = common_hal_busio_i2c_write_read(self, args[ARG_address].u_int,
352
((uint8_t *)out_bufinfo.buf) + out_start, out_length,((uint8_t *)in_bufinfo.buf) + in_start, in_length);
0 commit comments