From f05ae416ff61c9381e467e1bf2558ed005b6cc3a Mon Sep 17 00:00:00 2001 From: Damien George Date: Mon, 16 Mar 2020 15:54:35 +1100 Subject: [PATCH] stm32/softtimer: Initialise pairing-heap node before pushing to heap. --- ports/stm32/softtimer.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/stm32/softtimer.c b/ports/stm32/softtimer.c index ae87e1f76f..d0a186c7d0 100644 --- a/ports/stm32/softtimer.c +++ b/ports/stm32/softtimer.c @@ -81,6 +81,7 @@ void soft_timer_handler(void) { } void soft_timer_insert(soft_timer_entry_t *entry) { + mp_pairheap_init_node(soft_timer_lt, &entry->pairheap); uint32_t irq_state = raise_irq_pri(IRQ_PRI_PENDSV); MP_STATE_PORT(soft_timer_heap) = (soft_timer_entry_t *)mp_pairheap_push(soft_timer_lt, &MP_STATE_PORT(soft_timer_heap)->pairheap, &entry->pairheap); if (entry == MP_STATE_PORT(soft_timer_heap)) {