Skip to content

Commit 8e00844

Browse files
committed
stmhal: Fix build issue when MICROPY_PY_THREAD is disabled.
1 parent 00e7176 commit 8e00844

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

stmhal/main.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,9 @@ int main(void) {
454454
#endif
455455

456456
// basic sub-system init
457+
#if MICROPY_PY_THREAD
457458
pyb_thread_init(&pyb_thread_main);
459+
#endif
458460
pendsv_init();
459461
led_init();
460462
#if MICROPY_HW_HAS_SWITCH

stmhal/stm32_it.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,10 +289,12 @@ void SysTick_Handler(void) {
289289
dma_idle_handler(uwTick);
290290
}
291291

292+
#if MICROPY_PY_THREAD
292293
// signal a thread switch at 4ms=250Hz
293294
if (pyb_thread_enabled && (uwTick & 0x03) == 0x03) {
294295
SCB->ICSR = SCB_ICSR_PENDSVSET_Msk;
295296
}
297+
#endif
296298
}
297299

298300
/******************************************************************************/

0 commit comments

Comments
 (0)