Merge pull request #391 from pimoroni/optimize/as7262

AS7262: Optimize function types. Saves 600 bytes.
pull/395/head
Philip Howard 2022-06-13 20:10:24 +01:00 zatwierdzone przez GitHub
commit 438002f569
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
24 zmienionych plików z 75 dodań i 134 usunięć

Wyświetl plik

@ -77,7 +77,7 @@ STATIC MP_DEFINE_CONST_DICT(Badger2040_locals_dict, Badger2040_locals_dict_table
/***** Class Definition *****/
const mp_obj_type_t Badger2040_type = {
{ &mp_type_type },
.name = MP_QSTR_badger2040,
.name = MP_QSTR_Badger2040,
.make_new = Badger2040_make_new,
.locals_dict = (mp_obj_dict_t*)&Badger2040_locals_dict,
};

Wyświetl plik

@ -11,12 +11,12 @@ MP_DEFINE_CONST_FUN_OBJ_1(BreakoutAS7262_hardware_version_obj, BreakoutAS7262_ha
MP_DEFINE_CONST_FUN_OBJ_1(BreakoutAS7262_firmware_version_obj, BreakoutAS7262_firmware_version);
MP_DEFINE_CONST_FUN_OBJ_1(BreakoutAS7262_read_obj, BreakoutAS7262_read);
MP_DEFINE_CONST_FUN_OBJ_1(BreakoutAS7262_temperature_obj, BreakoutAS7262_temperature);
MP_DEFINE_CONST_FUN_OBJ_KW(BreakoutAS7262_set_gain_obj, 1, BreakoutAS7262_set_gain);
MP_DEFINE_CONST_FUN_OBJ_KW(BreakoutAS7262_set_measurement_mode_obj, 1, BreakoutAS7262_set_measurement_mode);
MP_DEFINE_CONST_FUN_OBJ_KW(BreakoutAS7262_set_indicator_current_obj, 1, BreakoutAS7262_set_indicator_current);
MP_DEFINE_CONST_FUN_OBJ_KW(BreakoutAS7262_set_illumination_current_obj, 1, BreakoutAS7262_set_illumination_current);
MP_DEFINE_CONST_FUN_OBJ_KW(BreakoutAS7262_set_integration_time_obj, 1, BreakoutAS7262_set_integration_time);
MP_DEFINE_CONST_FUN_OBJ_KW(BreakoutAS7262_set_leds_obj, 1, BreakoutAS7262_set_leds);
MP_DEFINE_CONST_FUN_OBJ_2(BreakoutAS7262_set_gain_obj, BreakoutAS7262_set_gain);
MP_DEFINE_CONST_FUN_OBJ_2(BreakoutAS7262_set_measurement_mode_obj, BreakoutAS7262_set_measurement_mode);
MP_DEFINE_CONST_FUN_OBJ_2(BreakoutAS7262_set_indicator_current_obj, BreakoutAS7262_set_indicator_current);
MP_DEFINE_CONST_FUN_OBJ_2(BreakoutAS7262_set_illumination_current_obj, BreakoutAS7262_set_illumination_current);
MP_DEFINE_CONST_FUN_OBJ_2(BreakoutAS7262_set_integration_time_obj, BreakoutAS7262_set_integration_time);
MP_DEFINE_CONST_FUN_OBJ_3(BreakoutAS7262_set_leds_obj, BreakoutAS7262_set_leds);
/***** Binding of Methods *****/
STATIC const mp_rom_map_elem_t BreakoutAS7262_locals_dict_table[] = {
@ -26,24 +26,29 @@ STATIC const mp_rom_map_elem_t BreakoutAS7262_locals_dict_table[] = {
{ MP_ROM_QSTR(MP_QSTR_firmware_version), MP_ROM_PTR(&BreakoutAS7262_firmware_version_obj) },
{ MP_ROM_QSTR(MP_QSTR_read), MP_ROM_PTR(&BreakoutAS7262_read_obj) },
{ MP_ROM_QSTR(MP_QSTR_temperature), MP_ROM_PTR(&BreakoutAS7262_temperature_obj) },
{ MP_ROM_QSTR(MP_QSTR_set_gain), MP_ROM_PTR(&BreakoutAS7262_set_gain_obj) },
{ MP_ROM_QSTR(MP_QSTR_set_measurement_mode), MP_ROM_PTR(&BreakoutAS7262_set_measurement_mode_obj) },
{ MP_ROM_QSTR(MP_QSTR_set_indicator_current), MP_ROM_PTR(&BreakoutAS7262_set_indicator_current_obj) },
{ MP_ROM_QSTR(MP_QSTR_set_illumination_current), MP_ROM_PTR(&BreakoutAS7262_set_illumination_current_obj) },
{ MP_ROM_QSTR(MP_QSTR_set_integration_time), MP_ROM_PTR(&BreakoutAS7262_set_integration_time_obj) },
{ MP_ROM_QSTR(MP_QSTR_set_leds), MP_ROM_PTR(&BreakoutAS7262_set_leds_obj) },
{ MP_ROM_QSTR(MP_QSTR_X1), MP_ROM_INT(MP_X1) },
{ MP_ROM_QSTR(MP_QSTR_X3_7), MP_ROM_INT(MP_X3_7) },
{ MP_ROM_QSTR(MP_QSTR_X16), MP_ROM_INT(MP_X16) },
{ MP_ROM_QSTR(MP_QSTR_X64), MP_ROM_INT(MP_X64) },
{ MP_ROM_QSTR(MP_QSTR_MA12), MP_ROM_INT(MP_MA12) },
{ MP_ROM_QSTR(MP_QSTR_MA25), MP_ROM_INT(MP_MA25) },
{ MP_ROM_QSTR(MP_QSTR_MA50), MP_ROM_INT(MP_MA50) },
{ MP_ROM_QSTR(MP_QSTR_MA100), MP_ROM_INT(MP_MA100) },
{ MP_ROM_QSTR(MP_QSTR_MA1), MP_ROM_INT(MP_MA1) },
{ MP_ROM_QSTR(MP_QSTR_MA2), MP_ROM_INT(MP_MA2) },
{ MP_ROM_QSTR(MP_QSTR_MA4), MP_ROM_INT(MP_MA4) },
{ MP_ROM_QSTR(MP_QSTR_MA8), MP_ROM_INT(MP_MA8) },
{ MP_ROM_QSTR(MP_QSTR_CONT_YGNV), MP_ROM_INT(MP_CONT_YGNV) },
{ MP_ROM_QSTR(MP_QSTR_CONT_ROYG), MP_ROM_INT(MP_CONT_ROYG) },
{ MP_ROM_QSTR(MP_QSTR_CONT_ROYGBR), MP_ROM_INT(MP_CONT_ROYGBR) },
@ -54,7 +59,7 @@ STATIC MP_DEFINE_CONST_DICT(BreakoutAS7262_locals_dict, BreakoutAS7262_locals_di
/***** Class Definition *****/
const mp_obj_type_t breakout_as7262_BreakoutAS7262_type = {
{ &mp_type_type },
.name = MP_QSTR_breakout_as7262,
.name = MP_QSTR_BreakoutAS7262,
.make_new = BreakoutAS7262_make_new,
.locals_dict = (mp_obj_dict_t*)&BreakoutAS7262_locals_dict,
};

Wyświetl plik

@ -96,125 +96,61 @@ mp_obj_t BreakoutAS7262_temperature(mp_obj_t self_in) {
return mp_obj_new_int(self->breakout->temperature());
}
mp_obj_t BreakoutAS7262_set_gain(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
enum { ARG_self, ARG_gain };
static const mp_arg_t allowed_args[] = {
{ MP_QSTR_, MP_ARG_REQUIRED | MP_ARG_OBJ },
{ MP_QSTR_gain, MP_ARG_REQUIRED | MP_ARG_INT },
};
mp_obj_t BreakoutAS7262_set_gain(mp_obj_t self_in, mp_obj_t value_in) {
breakout_as7262_BreakoutAS7262_obj_t *self = MP_OBJ_TO_PTR2(self_in, breakout_as7262_BreakoutAS7262_obj_t);
mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)];
mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args);
int gain = args[ARG_gain].u_int;
if(gain < 0 || gain > 3) {
mp_raise_ValueError("mode not a valid value. Expected 0 to 3 (X1, X3_7, X16, X64)");
}
else {
breakout_as7262_BreakoutAS7262_obj_t *self = MP_OBJ_TO_PTR2(args[ARG_self].u_obj, breakout_as7262_BreakoutAS7262_obj_t);
self->breakout->set_gain((BreakoutAS7262::gain)gain);
}
return mp_const_none;
}
mp_obj_t BreakoutAS7262_set_measurement_mode(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
enum { ARG_self, ARG_mode };
static const mp_arg_t allowed_args[] = {
{ MP_QSTR_, MP_ARG_REQUIRED | MP_ARG_OBJ },
{ MP_QSTR_mode, MP_ARG_REQUIRED | MP_ARG_INT },
};
mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)];
mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args);
int mode = args[ARG_mode].u_int;
if(mode < 0 || mode > 3) {
mp_raise_ValueError("mode not a valid value. Expected 0 to 3 (CONT_YGNV, CONT_ROYG, CONT_ROYGBR, ONESHOT)");
}
else {
breakout_as7262_BreakoutAS7262_obj_t *self = MP_OBJ_TO_PTR2(args[ARG_self].u_obj, breakout_as7262_BreakoutAS7262_obj_t);
self->breakout->set_measurement_mode((BreakoutAS7262::measurement_mode)mode);
}
return mp_const_none;
}
mp_obj_t BreakoutAS7262_set_indicator_current(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
enum { ARG_self, ARG_current };
static const mp_arg_t allowed_args[] = {
{ MP_QSTR_, MP_ARG_REQUIRED | MP_ARG_OBJ },
{ MP_QSTR_current, MP_ARG_REQUIRED | MP_ARG_INT },
};
mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)];
mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args);
int value = mp_obj_get_int(value_in) & 3;
int current = args[ARG_current].u_int;
if(current < 0 || current > 3) {
mp_raise_ValueError("current not a valid value. Expected 0 to 3 (MA1, MA2, MA4, MA8)");
}
else {
breakout_as7262_BreakoutAS7262_obj_t *self = MP_OBJ_TO_PTR2(args[ARG_self].u_obj, breakout_as7262_BreakoutAS7262_obj_t);
self->breakout->set_indicator_current((BreakoutAS7262::indicator_current)current);
}
self->breakout->set_gain((BreakoutAS7262::gain)value);
return mp_const_none;
}
mp_obj_t BreakoutAS7262_set_illumination_current(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
enum { ARG_self, ARG_current };
static const mp_arg_t allowed_args[] = {
{ MP_QSTR_, MP_ARG_REQUIRED | MP_ARG_OBJ },
{ MP_QSTR_current, MP_ARG_REQUIRED | MP_ARG_INT },
};
mp_obj_t BreakoutAS7262_set_measurement_mode(mp_obj_t self_in, mp_obj_t value_in) {
breakout_as7262_BreakoutAS7262_obj_t *self = MP_OBJ_TO_PTR2(self_in, breakout_as7262_BreakoutAS7262_obj_t);
mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)];
mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args);
int value = mp_obj_get_int(value_in) & 3;
int current = args[ARG_current].u_int;
if(current < 0 || current > 3) {
mp_raise_ValueError("current not a valid value. Expected 0 to 3 (MA12, MA25, MA50, MA100)");
}
else {
breakout_as7262_BreakoutAS7262_obj_t *self = MP_OBJ_TO_PTR2(args[ARG_self].u_obj, breakout_as7262_BreakoutAS7262_obj_t);
self->breakout->set_illumination_current((BreakoutAS7262::illumination_current)current);
}
self->breakout->set_measurement_mode((BreakoutAS7262::measurement_mode)value);
return mp_const_none;
}
mp_obj_t BreakoutAS7262_set_integration_time(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
enum { ARG_self, ARG_integration_time };
static const mp_arg_t allowed_args[] = {
{ MP_QSTR_, MP_ARG_REQUIRED | MP_ARG_OBJ },
{ MP_QSTR_integration_time, MP_ARG_REQUIRED | MP_ARG_OBJ },
};
mp_obj_t BreakoutAS7262_set_indicator_current(mp_obj_t self_in, mp_obj_t value_in) {
breakout_as7262_BreakoutAS7262_obj_t *self = MP_OBJ_TO_PTR2(self_in, breakout_as7262_BreakoutAS7262_obj_t);
mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)];
mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args);
int value = mp_obj_get_int(value_in) & 3;
float integration_time = mp_obj_get_float(args[ARG_integration_time].u_obj);
breakout_as7262_BreakoutAS7262_obj_t *self = MP_OBJ_TO_PTR2(args[ARG_self].u_obj, breakout_as7262_BreakoutAS7262_obj_t);
self->breakout->set_integration_time(integration_time);
self->breakout->set_indicator_current((BreakoutAS7262::indicator_current)value);
return mp_const_none;
}
mp_obj_t BreakoutAS7262_set_leds(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
enum { ARG_self, ARG_illumination, ARG_indicator };
static const mp_arg_t allowed_args[] = {
{ MP_QSTR_, MP_ARG_REQUIRED | MP_ARG_OBJ },
{ MP_QSTR_illumination, MP_ARG_REQUIRED | MP_ARG_BOOL },
{ MP_QSTR_indicator, MP_ARG_REQUIRED | MP_ARG_BOOL },
};
mp_obj_t BreakoutAS7262_set_illumination_current(mp_obj_t self_in, mp_obj_t value_in) {
breakout_as7262_BreakoutAS7262_obj_t *self = MP_OBJ_TO_PTR2(self_in, breakout_as7262_BreakoutAS7262_obj_t);
mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)];
mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args);
int value = mp_obj_get_int(value_in) & 3;
breakout_as7262_BreakoutAS7262_obj_t *self = MP_OBJ_TO_PTR2(args[ARG_self].u_obj, breakout_as7262_BreakoutAS7262_obj_t);
self->breakout->set_leds(args[ARG_illumination].u_bool, args[ARG_indicator].u_bool);
self->breakout->set_illumination_current((BreakoutAS7262::illumination_current)value);
return mp_const_none;
}
mp_obj_t BreakoutAS7262_set_integration_time(mp_obj_t self_in, mp_obj_t value_in) {
breakout_as7262_BreakoutAS7262_obj_t *self = MP_OBJ_TO_PTR2(self_in, breakout_as7262_BreakoutAS7262_obj_t);
self->breakout->set_integration_time(mp_obj_get_float(value_in));
return mp_const_none;
}
mp_obj_t BreakoutAS7262_set_leds(mp_obj_t self_in, mp_obj_t illumination, mp_obj_t indicator) {
breakout_as7262_BreakoutAS7262_obj_t *self = MP_OBJ_TO_PTR2(self_in, breakout_as7262_BreakoutAS7262_obj_t);
self->breakout->set_leds(
illumination == mp_const_true,
indicator == mp_const_true
);
return mp_const_none;
}

Wyświetl plik

@ -41,9 +41,9 @@ extern mp_obj_t BreakoutAS7262_hardware_version(mp_obj_t self_in);
extern mp_obj_t BreakoutAS7262_firmware_version(mp_obj_t self_in);
extern mp_obj_t BreakoutAS7262_read(mp_obj_t self_in);
extern mp_obj_t BreakoutAS7262_temperature(mp_obj_t self_in);
extern mp_obj_t BreakoutAS7262_set_gain(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args);
extern mp_obj_t BreakoutAS7262_set_measurement_mode(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args);
extern mp_obj_t BreakoutAS7262_set_indicator_current(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args);
extern mp_obj_t BreakoutAS7262_set_illumination_current(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args);
extern mp_obj_t BreakoutAS7262_set_integration_time(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args);
extern mp_obj_t BreakoutAS7262_set_leds(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args);
extern mp_obj_t BreakoutAS7262_set_gain(mp_obj_t self_in, mp_obj_t value_in);
extern mp_obj_t BreakoutAS7262_set_measurement_mode(mp_obj_t self_in, mp_obj_t value_in);
extern mp_obj_t BreakoutAS7262_set_indicator_current(mp_obj_t self_in, mp_obj_t value_in);
extern mp_obj_t BreakoutAS7262_set_illumination_current(mp_obj_t self_in, mp_obj_t value_in);
extern mp_obj_t BreakoutAS7262_set_integration_time(mp_obj_t self_in, mp_obj_t value_in);
extern mp_obj_t BreakoutAS7262_set_leds(mp_obj_t self_in, mp_obj_t illumination, mp_obj_t indicator);

Wyświetl plik

@ -30,7 +30,7 @@ STATIC MP_DEFINE_CONST_DICT(BreakoutBH1745_locals_dict, BreakoutBH1745_locals_di
/***** Class Definition *****/
const mp_obj_type_t breakout_bh1745_BreakoutBH1745_type = {
{ &mp_type_type },
.name = MP_QSTR_breakout_bh1745,
.name = MP_QSTR_BreakoutBH1745,
.make_new = BreakoutBH1745_make_new,
.locals_dict = (mp_obj_dict_t*)&BreakoutBH1745_locals_dict,
};

Wyświetl plik

@ -18,7 +18,7 @@ STATIC MP_DEFINE_CONST_DICT(BreakoutBME280_locals_dict, BreakoutBME280_locals_di
/***** Class Definition *****/
const mp_obj_type_t breakout_bme280_BreakoutBME280_type = {
{ &mp_type_type },
.name = MP_QSTR_breakout_bme280,
.name = MP_QSTR_BreakoutBME280,
.make_new = BreakoutBME280_make_new,
.locals_dict = (mp_obj_dict_t*)&BreakoutBME280_locals_dict,
};

Wyświetl plik

@ -17,7 +17,7 @@ STATIC MP_DEFINE_CONST_DICT(BreakoutBME68X_locals_dict, BreakoutBME68X_locals_di
/***** Class Definition *****/
const mp_obj_type_t breakout_bme68x_BreakoutBME68X_type = {
{ &mp_type_type },
.name = MP_QSTR_breakout_bme68x,
.name = MP_QSTR_BreakoutBME68X,
.make_new = BreakoutBME68X_make_new,
.locals_dict = (mp_obj_dict_t*)&BreakoutBME68X_locals_dict,
};

Wyświetl plik

@ -18,7 +18,7 @@ STATIC MP_DEFINE_CONST_DICT(BreakoutBMP280_locals_dict, BreakoutBMP280_locals_di
/***** Class Definition *****/
const mp_obj_type_t breakout_bmp280_BreakoutBMP280_type = {
{ &mp_type_type },
.name = MP_QSTR_breakout_bmp280,
.name = MP_QSTR_BreakoutBMP280,
.make_new = BreakoutBMP280_make_new,
.locals_dict = (mp_obj_dict_t*)&BreakoutBMP280_locals_dict,
};

Wyświetl plik

@ -30,7 +30,7 @@ STATIC MP_DEFINE_CONST_DICT(BreakoutDotMatrix_locals_dict, BreakoutDotMatrix_loc
/***** Class Definition *****/
const mp_obj_type_t breakout_dotmatrix_BreakoutDotMatrix_type = {
{ &mp_type_type },
.name = MP_QSTR_breakout_dotmatrix,
.name = MP_QSTR_BreakoutDotMatrix,
.make_new = BreakoutDotMatrix_make_new,
.locals_dict = (mp_obj_dict_t*)&BreakoutDotMatrix_locals_dict,
};

Wyświetl plik

@ -36,7 +36,7 @@ STATIC MP_DEFINE_CONST_DICT(BreakoutEncoder_locals_dict, BreakoutEncoder_locals_
/***** Class Definition *****/
const mp_obj_type_t breakout_encoder_BreakoutEncoder_type = {
{ &mp_type_type },
.name = MP_QSTR_breakout_encoder,
.name = MP_QSTR_BreakoutEncoder,
.make_new = BreakoutEncoder_make_new,
.locals_dict = (mp_obj_dict_t*)&BreakoutEncoder_locals_dict,
};

Wyświetl plik

@ -24,7 +24,7 @@ STATIC MP_DEFINE_CONST_DICT(BreakoutICP10125_locals_dict, BreakoutICP10125_local
/***** Class Definition *****/
const mp_obj_type_t breakout_icp10125_BreakoutICP10125_type = {
{ &mp_type_type },
.name = MP_QSTR_breakout_matrix11x7,
.name = MP_QSTR_BreakoutICP10125,
.make_new = BreakoutICP10125_make_new,
.locals_dict = (mp_obj_dict_t*)&BreakoutICP10125_locals_dict,
};

Wyświetl plik

@ -65,7 +65,7 @@ STATIC MP_DEFINE_CONST_DICT(BreakoutIOExpander_locals_dict, BreakoutIOExpander_l
/***** Class Definition *****/
const mp_obj_type_t breakout_ioexpander_BreakoutIOExpander_type = {
{ &mp_type_type },
.name = MP_QSTR_breakout_ioexpander,
.name = MP_QSTR_BreakoutIOExpander,
.make_new = BreakoutIOExpander_make_new,
.locals_dict = (mp_obj_dict_t*)&BreakoutIOExpander_locals_dict,
};

Wyświetl plik

@ -47,7 +47,7 @@ STATIC MP_DEFINE_CONST_DICT(BreakoutLTR559_locals_dict, BreakoutLTR559_locals_di
/***** Class Definition *****/
const mp_obj_type_t breakout_ltr559_BreakoutLTR559_type = {
{ &mp_type_type },
.name = MP_QSTR_breakout_ltr559,
.name = MP_QSTR_BreakoutLTR559,
.make_new = BreakoutLTR559_make_new,
.locals_dict = (mp_obj_dict_t*)&BreakoutLTR559_locals_dict,
};

Wyświetl plik

@ -22,7 +22,7 @@ STATIC MP_DEFINE_CONST_DICT(BreakoutMatrix11x7_locals_dict, BreakoutMatrix11x7_l
/***** Class Definition *****/
const mp_obj_type_t breakout_matrix11x7_BreakoutMatrix11x7_type = {
{ &mp_type_type },
.name = MP_QSTR_breakout_matrix11x7,
.name = MP_QSTR_BreakoutMatrix11x7,
.make_new = BreakoutMatrix11x7_make_new,
.locals_dict = (mp_obj_dict_t*)&BreakoutMatrix11x7_locals_dict,
};

Wyświetl plik

@ -50,7 +50,7 @@ STATIC MP_DEFINE_CONST_DICT(BreakoutMICS6814_locals_dict, BreakoutMICS6814_local
/***** Class Definition *****/
const mp_obj_type_t breakout_mics6814_BreakoutMICS6814_type = {
{ &mp_type_type },
.name = MP_QSTR_breakout_mics6814,
.name = MP_QSTR_BreakoutMICS6814,
.make_new = BreakoutMICS6814_make_new,
.locals_dict = (mp_obj_dict_t*)&BreakoutMICS6814_locals_dict,
};

Wyświetl plik

@ -83,7 +83,7 @@ STATIC MP_DEFINE_CONST_DICT(BreakoutMSA301_locals_dict, BreakoutMSA301_locals_di
/***** Class Definition *****/
const mp_obj_type_t breakout_msa301_BreakoutMSA301_type = {
{ &mp_type_type },
.name = MP_QSTR_breakout_msa301,
.name = MP_QSTR_BreakoutMSA301,
.make_new = BreakoutMSA301_make_new,
.locals_dict = (mp_obj_dict_t*)&BreakoutMSA301_locals_dict,
};

Wyświetl plik

@ -34,7 +34,7 @@ STATIC MP_DEFINE_CONST_DICT(BreakoutPMW3901_locals_dict, BreakoutPMW3901_locals_
/***** Class Definition *****/
const mp_obj_type_t breakout_pmw3901_BreakoutPMW3901_type = {
{ &mp_type_type },
.name = MP_QSTR_breakout_pmw3901,
.name = MP_QSTR_BreakoutPMW3901,
.print = BreakoutPMW3901_print,
.make_new = BreakoutPMW3901_make_new,
.locals_dict = (mp_obj_dict_t*)&BreakoutPMW3901_locals_dict,
@ -65,7 +65,7 @@ MP_REGISTER_MODULE(MP_QSTR_breakout_pmw3901, breakout_pmw3901_user_cmodule, MODU
/***** Class Definition *****/
const mp_obj_type_t breakout_paa5100_BreakoutPAA5100_type = {
{ &mp_type_type },
.name = MP_QSTR_breakout_pmw3901,
.name = MP_QSTR_BreakoutPAA5100,
.print = BreakoutPMW3901_print,
.make_new = BreakoutPAA5100_make_new,
.locals_dict = (mp_obj_dict_t*)&BreakoutPMW3901_locals_dict,

Wyświetl plik

@ -34,7 +34,7 @@ STATIC MP_DEFINE_CONST_DICT(BreakoutPotentiometer_locals_dict, BreakoutPotentiom
/***** Class Definition *****/
const mp_obj_type_t breakout_potentiometer_BreakoutPotentiometer_type = {
{ &mp_type_type },
.name = MP_QSTR_breakout_potentiometer,
.name = MP_QSTR_BreakoutPotentiometer,
.make_new = BreakoutPotentiometer_make_new,
.locals_dict = (mp_obj_dict_t*)&BreakoutPotentiometer_locals_dict,
};

Wyświetl plik

@ -22,7 +22,7 @@ STATIC MP_DEFINE_CONST_DICT(BreakoutRGBMatrix5x5_locals_dict, BreakoutRGBMatrix5
/***** Class Definition *****/
const mp_obj_type_t breakout_rgbmatrix5x5_BreakoutRGBMatrix5x5_type = {
{ &mp_type_type },
.name = MP_QSTR_breakout_rgbmatrix5x5,
.name = MP_QSTR_BreakoutRGBMatrix5x5,
.make_new = BreakoutRGBMatrix5x5_make_new,
.locals_dict = (mp_obj_dict_t*)&BreakoutRGBMatrix5x5_locals_dict,
};

Wyświetl plik

@ -48,7 +48,7 @@ STATIC MP_DEFINE_CONST_DICT(BreakoutRoundLCD_locals_dict, BreakoutRoundLCD_local
/***** Class Definition *****/
const mp_obj_type_t breakout_roundlcd_BreakoutRoundLCD_type = {
{ &mp_type_type },
.name = MP_QSTR_breakout_roundlcd,
.name = MP_QSTR_BreakoutRoundLCD,
.print = BreakoutRoundLCD_print,
.make_new = BreakoutRoundLCD_make_new,
.locals_dict = (mp_obj_dict_t*)&BreakoutRoundLCD_locals_dict,

Wyświetl plik

@ -138,7 +138,7 @@ STATIC MP_DEFINE_CONST_DICT(BreakoutRTC_locals_dict, BreakoutRTC_locals_dict_tab
/***** Class Definition *****/
const mp_obj_type_t breakout_rtc_BreakoutRTC_type = {
{ &mp_type_type },
.name = MP_QSTR_breakout_rtc,
.name = MP_QSTR_BreakoutRTC,
.make_new = BreakoutRTC_make_new,
.locals_dict = (mp_obj_dict_t*)&BreakoutRTC_locals_dict,
};

Wyświetl plik

@ -36,7 +36,7 @@ STATIC MP_DEFINE_CONST_DICT(BreakoutSGP30_locals_dict, BreakoutSGP30_locals_dict
/***** Class Definition *****/
const mp_obj_type_t breakout_sgp30_BreakoutSGP30_type = {
{ &mp_type_type },
.name = MP_QSTR_breakout_matrix11x7,
.name = MP_QSTR_BreakoutSGP30,
.make_new = BreakoutSGP30_make_new,
.locals_dict = (mp_obj_dict_t*)&BreakoutSGP30_locals_dict,
};

Wyświetl plik

@ -38,7 +38,7 @@ STATIC MP_DEFINE_CONST_DICT(BreakoutTrackball_locals_dict, BreakoutTrackball_loc
/***** Class Definition *****/
const mp_obj_type_t breakout_trackball_BreakoutTrackball_type = {
{ &mp_type_type },
.name = MP_QSTR_breakout_trackball,
.name = MP_QSTR_BreakoutTrackball,
.make_new = BreakoutTrackball_make_new,
.locals_dict = (mp_obj_dict_t*)&BreakoutTrackball_locals_dict,
};

Wyświetl plik

@ -49,7 +49,7 @@ STATIC MP_DEFINE_CONST_DICT(VL53L5CX_locals_dict, VL53L5CX_locals_dict_table);
/***** Class Definition *****/
const mp_obj_type_t VL53L5CX_type = {
{ &mp_type_type },
.name = MP_QSTR_breakout_vl53l5cx,
.name = MP_QSTR_VL53L5CX,
.make_new = VL53L5CX_make_new,
.locals_dict = (mp_obj_dict_t*)&VL53L5CX_locals_dict,
};