aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/platforms/Posix/hal_lld.c
diff options
context:
space:
mode:
Diffstat (limited to 'os/hal/platforms/Posix/hal_lld.c')
-rw-r--r--os/hal/platforms/Posix/hal_lld.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/os/hal/platforms/Posix/hal_lld.c b/os/hal/platforms/Posix/hal_lld.c
index 8b59d992b..8e1c34939 100644
--- a/os/hal/platforms/Posix/hal_lld.c
+++ b/os/hal/platforms/Posix/hal_lld.c
@@ -78,8 +78,10 @@ void ChkIntSources(void) {
#if HAL_USE_SERIAL
if (sd_lld_interrupt_pending()) {
+ dbg_check_lock();
if (chSchIsPreemptionRequired())
chSchDoReschedule();
+ dbg_check_unlock();
return;
}
#endif
@@ -87,9 +89,19 @@ void ChkIntSources(void) {
gettimeofday(&tv, NULL);
if (timercmp(&tv, &nextcnt, >=)) {
timeradd(&nextcnt, &tick, &nextcnt);
+
+ CH_IRQ_PROLOGUE();
+
+ chSysLockFromIsr();
chSysTimerHandlerI();
+ chSysUnlockFromIsr();
+
+ CH_IRQ_EPILOGUE();
+
+ dbg_check_lock();
if (chSchIsPreemptionRequired())
chSchDoReschedule();
+ dbg_check_unlock();
}
}