Skip to content

Commit 4d8ef0b

Browse files
committed
Pimoroni I2C: Switch to mp_obj_malloc.
1 parent 05e15f0 commit 4d8ef0b

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

micropython/modules/pimoroni_i2c/pimoroni_i2c.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,7 @@ mp_obj_t PimoroniI2C_make_new(const mp_obj_type_t *type, size_t n_args, size_t n
7474
mp_raise_ValueError(MP_ERROR_TEXT("bad SCL pin"));
7575
}
7676

77-
self = m_new_obj(_PimoroniI2C_obj_t);
78-
self->base.type = &PimoroniI2C_type;
77+
self = mp_obj_malloc(_PimoroniI2C_obj_t), &PimoroniI2C_type);
7978

8079
self->i2c = m_new_class(I2C, sda, scl, baud);
8180

0 commit comments

Comments
 (0)