8000 Long live shared bus singletons · rhwlo/circuitpython@a086631 · GitHub
[go: up one dir, main page]

Skip to content

Commit a086631

Browse files
committed
Long live shared bus singletons
Without long living them you may clone them when long living a module that uses them. Fixes adafruit#1603
1 parent 74083da commit a086631

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

supervisor/shared/board_busses.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ STATIC mp_obj_t i2c_singleton = NULL;
4747
mp_obj_t board_i2c(void) {
4848

4949
if (i2c_singleton == NULL) {
50-
busio_i2c_obj_t *self = m_new_obj(busio_i2c_obj_t);
50+
busio_i2c_obj_t *self = m_new_ll_obj(busio_i2c_obj_t);
5151
self->base.type = &busio_i2c_type;
5252

5353
assert_pin_free(DEFAULT_I2C_BUS_SDA);
@@ -99,7 +99,7 @@ STATIC mp_obj_t uart_singleton = NULL;
9999

100100
mp_obj_t board_uart(void) {
101101
if (uart_singleton == NULL) {
102-
busio_uart_obj_t *self = m_new_obj(busio_uart_obj_t);
102+
busio_uart_obj_t *self = m_new_ll_obj(busio_uart_obj_t);
103103
self->base.type = &busio_uart_type;
104104

105105
assert_pin_free(DEFAULT_UART_BUS_RX);

0 commit comments

Comments
 (0)
0