61
61
//| with device:
62
62
//| device.write(bytes_read)"""
63
63
//| ...
64
- //|
64
+ //|
65
65
STATIC mp_obj_t busdevice_i2cdevice_make_new (const mp_obj_type_t * type , size_t n_args , const mp_obj_t * pos_args , mp_map_t * kw_args ) {
66
66
busdevice_i2cdevice_obj_t * self = m_new_obj (busdevice_i2cdevice_obj_t );
67
67
self -> base .type = & busdevice_i2cdevice_type ;
@@ -107,7 +107,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(busdevice_i2cdevice___exit___obj, 4,
107
107
//| :param int start: Index to start writing at
108
108
//| :param int end: Index to write up to but not include; if None, use ``len(buf)``"""
109
109
//| ...
110
- //|
110
+ //|
111
111
STATIC void readinto (busdevice_i2cdevice_obj_t * self , mp_obj_t buffer , int32_t start , mp_int_t end ) {
112
112
mp_buffer_info_t bufinfo ;
113
113
mp_get_buffer_raise (buffer , & bufinfo , MP_BUFFER_WRITE );
@@ -131,7 +131,7 @@ STATIC mp_obj_t busdevice_i2cdevice_readinto(size_t n_args, const mp_obj_t *pos_
131
131
{ MP_QSTR_start , MP_ARG_KW_ONLY | MP_ARG_INT , {.u_int = 0 } },
132
132
{ MP_QSTR_end , MP_ARG_KW_ONLY | MP_ARG_INT , {.u_int = INT_MAX } },
133
133
};
134
-
134
+
135
135
busdevice_i2cdevice_obj_t * self = MP_OBJ_TO_PTR (pos_args [0 ]);
136
136
137
137
mp_arg_val_t args [MP_ARRAY_SIZE (allowed_args )];
@@ -179,7 +179,7 @@ STATIC mp_obj_t busdevice_i2cdevice_write(size_t n_args, const mp_obj_t *pos_arg
179
179
{ MP_QSTR_end , MP_ARG_KW_ONLY | MP_ARG_INT , {.u_int = INT_MAX } },
180
180
};
181
181
busdevice_i2cdevice_obj_t * self = MP_OBJ_TO_PTR (pos_args [0 ]);
182
-
182
+
183
183
mp_arg_val_t args [MP_ARRAY_SIZE (allowed_args )];
184
184
mp_arg_parse_all (n_args - 1 , pos_args + 1 , kw_args , MP_ARRAY_SIZE (allowed_args ), allowed_args , args );
185
185
@@ -210,7 +210,7 @@ MP_DEFINE_CONST_FUN_OBJ_KW(busdevice_i2cdevice_write_obj, 2, busdevice_i2cdevice
210
210
//| :param int in_end: Index to write up to but not include; if None, use ``len(in_buffer)``
211
211
//| """
212
212
//| ...
213
- //|
213
+ //|
214
214
STATIC mp_obj_t busdevice_i2cdevice_write_then_readinto (size_t n_args , const mp_obj_t * pos_args , mp_map_t * kw_args ) {
215
215
enum { ARG_out_buffer , ARG_in_buffer , ARG_out_start , ARG_out_end , ARG_in_start , ARG_in_end };
216
216
static const mp_arg_t allowed_args [] = {
@@ -227,7 +227,7 @@ STATIC mp_obj_t busdevice_i2cdevice_write_then_readinto(size_t n_args, const mp_
227
227
mp_arg_parse_all (n_args - 1 , pos_args + 1 , kw_args , MP_ARRAY_SIZE (allowed_args ), allowed_args , args );
228
228
229
229
write (self , args [ARG_out_buffer ].u_obj , args [ARG_out_start ].u_int , args [ARG_out_end ].u_int );
230
-
230
+
231
231
readinto (self , args [ARG_in_buffer ].u_obj , args [ARG_in_start ].u_int , args [ARG_in_end ].u_int );
232
232
233
233
return mp_const_none ;
@@ -241,7 +241,7 @@ MP_DEFINE_CONST_FUN_OBJ_KW(busdevice_i2cdevice_write_then_readinto_obj, 3, busde
241
241
//| or that the device does not support these means of probing
242
242
//| """
243
243
//| ...
244
- //|
244
+ //|
245
245
STATIC mp_obj_t busdevice_i2cdevice___probe_for_device (mp_obj_t self_in ) {
246
246
busdevice_i2cdevice_obj_t * self = self_in ;
247
247
common_hal_busdevice_i2cdevice___probe_for_device (self );
@@ -266,4 +266,4 @@ const mp_obj_type_t busdevice_i2cdevice_type = {
266
266
.name = MP_QSTR_I2CDevice ,
267
267
.make_new = busdevice_i2cdevice_make_new ,
268
268
.locals_dict = (mp_obj_dict_t * )& busdevice_i2cdevice_locals_dict ,
269
- };
269
+ };
0 commit comments