From c77c93324d4813c0b12342d1df952570a35d1740 Mon Sep 17 00:00:00 2001 From: Giovanni Di Sirio Date: Sat, 13 Feb 2021 09:00:03 +0000 Subject: [PATCH] Added assertion into chSchGoSleepS() to prevent sleeping in the idle thread. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@14048 27425a3e-05d8-49a3-a47f-9c15f0e5edd8 --- os/rt/src/chschd.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/os/rt/src/chschd.c b/os/rt/src/chschd.c index e8c362b6f..1e76eb015 100644 --- a/os/rt/src/chschd.c +++ b/os/rt/src/chschd.c @@ -413,6 +413,8 @@ void chSchGoSleepS(tstate_t newstate) { chDbgCheckClassS(); + chDbgAssert(otp != chSysGetIdleThreadX(), "sleeping in idle thread"); + /* New state.*/ otp->state = newstate;