Skip to content

Commit

Permalink
samd: Rename machine I2C type consistently across ports.
Browse files Browse the repository at this point in the history
This renames:
- machine_hw_i2c_type -> machine_i2c_type
  • Loading branch information
iabdalkader authored and dpgeorge committed Oct 22, 2022
1 parent 22ad45f commit e275a58
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions ports/samd/machine_i2c.c
Expand Up @@ -144,7 +144,7 @@ mp_obj_t machine_i2c_make_new(const mp_obj_type_t *type, size_t n_args, size_t n
}

// Get the peripheral object.
machine_i2c_obj_t *self = mp_obj_malloc(machine_i2c_obj_t, &machine_hw_i2c_type);
machine_i2c_obj_t *self = mp_obj_malloc(machine_i2c_obj_t, &machine_i2c_type);
self->id = id;
self->instance = sercom_instance[self->id];

Expand Down Expand Up @@ -260,7 +260,7 @@ STATIC const mp_machine_i2c_p_t machine_i2c_p = {
};

MP_DEFINE_CONST_OBJ_TYPE(
machine_hw_i2c_type,
machine_i2c_type,
MP_QSTR_I2C,
MP_TYPE_FLAG_NONE,
make_new, machine_i2c_make_new,
Expand Down
2 changes: 1 addition & 1 deletion ports/samd/modmachine.c
Expand Up @@ -157,7 +157,7 @@ STATIC const mp_rom_map_elem_t machine_module_globals_table[] = {
{ MP_ROM_QSTR(MP_QSTR_Pin), MP_ROM_PTR(&machine_pin_type) },
{ MP_ROM_QSTR(MP_QSTR_PWM), MP_ROM_PTR(&machine_pwm_type) },
{ MP_ROM_QSTR(MP_QSTR_SoftI2C), MP_ROM_PTR(&mp_machine_soft_i2c_type) },
{ MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&machine_hw_i2c_type) },
{ MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&machine_i2c_type) },
{ MP_ROM_QSTR(MP_QSTR_SoftSPI), MP_ROM_PTR(&mp_machine_soft_spi_type) },
{ MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&machine_spi_type) },
{ MP_ROM_QSTR(MP_QSTR_Timer), MP_ROM_PTR(&machine_timer_type) },
Expand Down
2 changes: 1 addition & 1 deletion ports/samd/modmachine.h
Expand Up @@ -30,7 +30,7 @@

extern const mp_obj_type_t machine_adc_type;
extern const mp_obj_type_t machine_dac_type;
extern const mp_obj_type_t machine_hw_i2c_type;
extern const mp_obj_type_t machine_i2c_type;
extern const mp_obj_type_t machine_led_type;
extern const mp_obj_type_t machine_pin_type;
extern const mp_obj_type_t machine_pwm_type;
Expand Down

0 comments on commit e275a58

Please sign in to comment.