Skip to content

Commit

Permalink
rp2: 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 427670c commit 22ad45f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions ports/rp2/machine_i2c.c
Expand Up @@ -68,8 +68,8 @@ typedef struct _machine_i2c_obj_t {
} machine_i2c_obj_t;

STATIC machine_i2c_obj_t machine_i2c_obj[] = {
{{&machine_hw_i2c_type}, i2c0, 0, MICROPY_HW_I2C0_SCL, MICROPY_HW_I2C0_SDA, 0},
{{&machine_hw_i2c_type}, i2c1, 1, MICROPY_HW_I2C1_SCL, MICROPY_HW_I2C1_SDA, 0},
{{&machine_i2c_type}, i2c0, 0, MICROPY_HW_I2C0_SCL, MICROPY_HW_I2C0_SDA, 0},
{{&machine_i2c_type}, i2c1, 1, MICROPY_HW_I2C1_SCL, MICROPY_HW_I2C1_SDA, 0},
};

STATIC void machine_i2c_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind) {
Expand Down Expand Up @@ -177,7 +177,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/rp2/modmachine.c
Expand Up @@ -239,7 +239,7 @@ STATIC const mp_rom_map_elem_t machine_module_globals_table[] = {
{ MP_ROM_QSTR(MP_QSTR_mem32), MP_ROM_PTR(&machine_mem32_obj) },

{ MP_ROM_QSTR(MP_QSTR_ADC), MP_ROM_PTR(&machine_adc_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_SoftI2C), MP_ROM_PTR(&mp_machine_soft_i2c_type) },
{ MP_ROM_QSTR(MP_QSTR_I2S), MP_ROM_PTR(&machine_i2s_type) },
{ MP_ROM_QSTR(MP_QSTR_Pin), MP_ROM_PTR(&machine_pin_type) },
Expand Down
2 changes: 1 addition & 1 deletion ports/rp2/modmachine.h
Expand Up @@ -4,7 +4,7 @@
#include "py/obj.h"

extern const mp_obj_type_t machine_adc_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_i2s_type;
extern const mp_obj_type_t machine_pin_type;
extern const mp_obj_type_t machine_rtc_type;
Expand Down

0 comments on commit 22ad45f

Please sign in to comment.