stmhal: Fix build issue when MICROPY_PY_THREAD is disabled.

This commit is contained in:
Damien George 2017-01-31 19:52:50 +11:00
parent 00e7176624
commit 8e00844929
2 changed files with 4 additions and 0 deletions

View File

@ -454,7 +454,9 @@ int main(void) {
#endif
// basic sub-system init
#if MICROPY_PY_THREAD
pyb_thread_init(&pyb_thread_main);
#endif
pendsv_init();
led_init();
#if MICROPY_HW_HAS_SWITCH

View File

@ -289,10 +289,12 @@ void SysTick_Handler(void) {
dma_idle_handler(uwTick);
}
#if MICROPY_PY_THREAD
// signal a thread switch at 4ms=250Hz
if (pyb_thread_enabled && (uwTick & 0x03) == 0x03) {
SCB->ICSR = SCB_ICSR_PENDSVSET_Msk;
}
#endif
}
/******************************************************************************/