summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2017-01-31 19:52:50 +1100
committerDamien George <damien.p.george@gmail.com>2017-01-31 19:52:50 +1100
commit8e008449298d95addf6bd56f448b0d100b163399 (patch)
tree6cd5e34f2f130cf01fdfc3665fa7c5a9a41c2fb1
parent00e717662449cacdb2bc40988b12831749a7369b (diff)
downloadmicropython-8e008449298d95addf6bd56f448b0d100b163399.tar.gz
micropython-8e008449298d95addf6bd56f448b0d100b163399.zip
stmhal: Fix build issue when MICROPY_PY_THREAD is disabled.
-rw-r--r--stmhal/main.c2
-rw-r--r--stmhal/stm32_it.c2
2 files changed, 4 insertions, 0 deletions
diff --git a/stmhal/main.c b/stmhal/main.c
index ebab885091..7bf6f6a3af 100644
--- a/stmhal/main.c
+++ b/stmhal/main.c
@@ -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
diff --git a/stmhal/stm32_it.c b/stmhal/stm32_it.c
index a6503d3100..4dddc5e0ba 100644
--- a/stmhal/stm32_it.c
+++ b/stmhal/stm32_it.c
@@ -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
}
/******************************************************************************/