Skip to content

Commit 6e4db00

Browse files
committed
pybricks.iodevices.I2CDevice: Drop write_then_read method.
The original read/write were deemed generic enough. See #379
1 parent 8821de6 commit 6e4db00

File tree

1 file changed

+0
-14
lines changed

1 file changed

+0
-14
lines changed

pybricks/iodevices/pb_type_i2c_device.c

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -221,19 +221,6 @@ void pb_type_i2c_device_assert_string_at_register(mp_obj_t i2c_device_obj, uint8
221221
}
222222
}
223223

224-
// pybricks.iodevices.I2CDevice.write_then_read
225-
static mp_obj_t write_then_read(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
226-
PB_PARSE_ARGS_METHOD(n_args, pos_args, kw_args,
227-
device_obj_t, device,
228-
PB_ARG_REQUIRED(write_data),
229-
PB_ARG_REQUIRED(read_length)
230-
);
231-
232-
size_t write_len;
233-
return pb_type_i2c_device_start_operation(MP_OBJ_FROM_PTR(device), (const uint8_t *)mp_obj_str_get_data(write_data_in, &write_len), write_len, pb_obj_get_positive_int(read_length_in), mp_obj_new_bytes);
234-
}
235-
static MP_DEFINE_CONST_FUN_OBJ_KW(write_then_read_obj, 0, write_then_read);
236-
237224
// pybricks.iodevices.I2CDevice.read
238225
static mp_obj_t read(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
239226
PB_PARSE_ARGS_METHOD(n_args, pos_args, kw_args,
@@ -291,7 +278,6 @@ static MP_DEFINE_CONST_FUN_OBJ_KW(write_obj, 0, write);
291278
static const mp_rom_map_elem_t locals_dict_table[] = {
292279
{ MP_ROM_QSTR(MP_QSTR_read), MP_ROM_PTR(&read_obj) },
293280
{ MP_ROM_QSTR(MP_QSTR_write), MP_ROM_PTR(&write_obj) },
294-
{ MP_ROM_QSTR(MP_QSTR_write_then_read), MP_ROM_PTR(&write_then_read_obj) },
295281
};
296282
static MP_DEFINE_CONST_DICT(locals_dict, locals_dict_table);
297283

0 commit comments

Comments
 (0)