MicroPython: Change machine_hw_i2c_type to machine_i2c_type.

pull/515/head
Phil Howard 2022-11-09 10:42:21 +00:00 zatwierdzone przez Phil Howard
rodzic 04888da334
commit 9bf1583787
3 zmienionych plików z 3 dodań i 3 usunięć

Wyświetl plik

@ -265,7 +265,7 @@ mp_obj_t ModPicoGraphics_make_new(const mp_obj_type_t *type, size_t n_args, size
_PimoroniBus_obj_t *bus = (_PimoroniBus_obj_t *)MP_OBJ_TO_PTR(args[ARG_bus].u_obj);
parallel_bus = *(ParallelPins *)(bus->pins);
} else if (mp_obj_is_type(args[ARG_bus].u_obj, &PimoroniI2C_type) || MP_OBJ_IS_TYPE(args[ARG_bus].u_obj, &machine_hw_i2c_type)) {
} else if (mp_obj_is_type(args[ARG_bus].u_obj, &PimoroniI2C_type) || MP_OBJ_IS_TYPE(args[ARG_bus].u_obj, &machine_i2c_type)) {
if(bus_type != BUS_I2C) mp_raise_ValueError("unexpected I2C bus!");
self->i2c = PimoroniI2C_from_machine_i2c_or_native(args[ARG_bus].u_obj);
i2c_bus = (pimoroni::I2C *)(self->i2c->i2c);

Wyświetl plik

@ -14,7 +14,7 @@ extern "C" {
_PimoroniI2C_obj_t* PimoroniI2C_from_machine_i2c_or_native(mp_obj_t i2c_obj) {
if(MP_OBJ_IS_TYPE(i2c_obj, &PimoroniI2C_type)) {
return (_PimoroniI2C_obj_t *)MP_OBJ_TO_PTR(i2c_obj);
} else if(MP_OBJ_IS_TYPE(i2c_obj, &machine_hw_i2c_type)) {
} else if(MP_OBJ_IS_TYPE(i2c_obj, &machine_i2c_type)) {
_PimoroniI2C_obj_t *pimoroni_i2c = m_new_obj(_PimoroniI2C_obj_t);
machine_i2c_obj_t *machine_i2c = (machine_i2c_obj_t *)MP_OBJ_TO_PTR(i2c_obj);
pimoroni_i2c = m_new_obj(_PimoroniI2C_obj_t);

Wyświetl plik

@ -18,7 +18,7 @@ extern mp_obj_t PimoroniI2C___del__(mp_obj_t self_in);
extern bool Pimoroni_mp_obj_to_i2c(mp_obj_t in, void *out);
extern const mp_obj_type_t machine_hw_i2c_type;
extern const mp_obj_type_t machine_i2c_type;
typedef struct _machine_i2c_obj_t {
mp_obj_base_t base;