File tree Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change 647
647
648
648
// ********************** machine.I2C ************************
649
649
650
- static const mp_rom_map_elem_t i2c_globals_dict_table [] = {
650
+ static const mp_rom_map_elem_t i2c_locals_dict_table [] = {
651
651
{ MP_ROM_QSTR (MP_QSTR___name__ ), MP_OBJ_NEW_QSTR (MP_QSTR_I2C ) },
652
652
{ MP_ROM_QSTR (MP_QSTR_Bus ), (mp_obj_t )& mp_machine_hw_i2c_bus_type },
653
653
{ MP_ROM_QSTR (MP_QSTR_Device ), (mp_obj_t )& mp_machine_hw_i2c_device_type }
654
654
};
655
655
656
656
657
- static MP_DEFINE_CONST_DICT (i2c_globals_dict , i2c_globals_dict_table ) ;
657
+ static MP_DEFINE_CONST_DICT (i2c_locals_dict , i2c_locals_dict_table ) ;
658
658
659
-
660
- const mp_obj_module_t mp_module_i2c = {
661
- . base = { & mp_type_module } ,
662
- . globals = ( mp_obj_dict_t * ) & i2c_globals_dict ,
663
- };
664
-
665
- MP_REGISTER_MODULE ( MP_QSTR_I2C , mp_module_i2c );
659
+
660
+ MP_DEFINE_CONST_OBJ_TYPE (
661
+ machine_i2c_type ,
662
+ MP_QSTR_I2C ,
663
+ MP_TYPE_FLAG_NONE ,
664
+ locals_dict , & i2c_locals_dict
665
+ );
666
666
#else
667
667
void mp_machine_hw_i2c_bus_deinit_all (void ) {}
668
668
You can’t perform that action at this time.
0 commit comments