zephyr: Rename machine I2C and SPI types consistently across ports.
This renames: - machine_hard_i2c_type -> machine_i2c_type - machine_hard_spi_type -> machine_spi_type
This commit is contained in:
parent
bfa6f34404
commit
5e90ec2331
|
@ -84,7 +84,7 @@ mp_obj_t machine_hard_i2c_make_new(const mp_obj_type_t *type, size_t n_args, siz
|
|||
mp_raise_NotImplementedError(MP_ERROR_TEXT("explicit choice of timeout is not implemented"));
|
||||
}
|
||||
|
||||
machine_hard_i2c_obj_t *self = mp_obj_malloc(machine_hard_i2c_obj_t, &machine_hard_i2c_type);
|
||||
machine_hard_i2c_obj_t *self = mp_obj_malloc(machine_hard_i2c_obj_t, &machine_i2c_type);
|
||||
self->dev = dev;
|
||||
self->restart = false;
|
||||
|
||||
|
@ -127,7 +127,7 @@ STATIC const mp_machine_i2c_p_t machine_hard_i2c_p = {
|
|||
};
|
||||
|
||||
MP_DEFINE_CONST_OBJ_TYPE(
|
||||
machine_hard_i2c_type,
|
||||
machine_i2c_type,
|
||||
MP_QSTR_I2C,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
make_new, machine_hard_i2c_make_new,
|
||||
|
|
|
@ -106,7 +106,7 @@ mp_obj_t machine_hard_spi_make_new(const mp_obj_type_t *type, size_t n_args, siz
|
|||
.cs = NULL
|
||||
};
|
||||
|
||||
machine_hard_spi_obj_t *self = mp_obj_malloc(machine_hard_spi_obj_t, &machine_hard_spi_type);
|
||||
machine_hard_spi_obj_t *self = mp_obj_malloc(machine_hard_spi_obj_t, &machine_spi_type);
|
||||
self->dev = dev;
|
||||
self->config = cfg;
|
||||
|
||||
|
@ -198,7 +198,7 @@ STATIC const mp_machine_spi_p_t machine_hard_spi_p = {
|
|||
};
|
||||
|
||||
MP_DEFINE_CONST_OBJ_TYPE(
|
||||
machine_hard_spi_type,
|
||||
machine_spi_type,
|
||||
MP_QSTR_SPI,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
make_new, machine_hard_spi_make_new,
|
||||
|
|
|
@ -69,10 +69,10 @@ STATIC const mp_rom_map_elem_t machine_module_globals_table[] = {
|
|||
{ MP_ROM_QSTR(MP_QSTR_idle), MP_ROM_PTR(&machine_idle_obj) },
|
||||
|
||||
#if MICROPY_PY_MACHINE_I2C
|
||||
{ MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&machine_hard_i2c_type) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&machine_i2c_type) },
|
||||
#endif
|
||||
#if MICROPY_PY_MACHINE_SPI
|
||||
{ MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&machine_hard_spi_type) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&machine_spi_type) },
|
||||
#endif
|
||||
{ MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&machine_uart_type) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_Pin), MP_ROM_PTR(&machine_pin_type) },
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
#include "py/obj.h"
|
||||
|
||||
extern const mp_obj_type_t machine_pin_type;
|
||||
extern const mp_obj_type_t machine_hard_i2c_type;
|
||||
extern const mp_obj_type_t machine_hard_spi_type;
|
||||
extern const mp_obj_type_t machine_i2c_type;
|
||||
extern const mp_obj_type_t machine_spi_type;
|
||||
extern const mp_obj_type_t machine_uart_type;
|
||||
|
||||
MP_DECLARE_CONST_FUN_OBJ_0(machine_info_obj);
|
||||
|
|
Loading…
Reference in New Issue