diff --git a/os/nil/src/ch.c b/os/nil/src/ch.c index 35ebbac03..2d9e211c2 100644 --- a/os/nil/src/ch.c +++ b/os/nil/src/ch.c @@ -369,10 +369,13 @@ void chSysTimerHandlerI(void) { /* Timeout on queues/semaphores requires a special handling because the counter must be incremented.*/ /*lint -save -e9013 [15.7] There is no else because it is not needed.*/ +#if CH_CFG_USE_SEMAPHORES == TRUE if (NIL_THD_IS_WTQUEUE(tp)) { tp->u1.semp->cnt++; } - else if (NIL_THD_IS_SUSPENDED(tp)) { + else +#endif + if (NIL_THD_IS_SUSPENDED(tp)) { *tp->u1.trp = NULL; } /*lint -restore*/