diff --git a/miosix/kernel/kernel.cpp b/miosix/kernel/kernel.cpp
index c5ac40df6264ae66a72531189ffe3dadf45d9b63..91c88e14b8f3a914f108ed4dea205e1854335a57 100755
--- a/miosix/kernel/kernel.cpp
+++ b/miosix/kernel/kernel.cpp
@@ -292,7 +292,7 @@ bool IRQwakeThreads(long long currentTime)
     {
         if(currentTime<(*it)->wakeupTime) break;
         //Wake both threads doing absoluteSleep() and timedWait()
-        (*it)->thread->flags.IRQexitSleepAndWait();
+        (*it)->thread->flags.IRQclearSleepAndWait();
         if(const_cast<Thread*>(runningThread)->getPriority()<(*it)->thread->getPriority())
             result=true;
         it=sleepingList.erase(it);
@@ -379,7 +379,7 @@ void Thread::nanoSleepUntil(long long absoluteTimeNs)
     //the timer isr will wake threads, modifying the sleepingList
     {
         FastInterruptDisableLock lock;
-        d.thread->flags.IRQsetSleep(true); //Sleeping thread: set sleep flag
+        d.thread->flags.IRQsetSleep(); //Sleeping thread: set sleep flag
         IRQaddToSleepingList(&d);
     }
     // NOTE: There is no need to synchronize the timer (calling IRQsetNextInterrupt)
@@ -889,13 +889,13 @@ void Thread::ThreadFlags::IRQsetWait(bool waiting)
     Scheduler::IRQwaitStatusHook(this->t);
 }
 
-void Thread::ThreadFlags::IRQsetSleep(bool sleeping)
+void Thread::ThreadFlags::IRQsetSleep()
 {
-    if(sleeping) flags |= SLEEP; else flags &= ~SLEEP;
+    flags |= SLEEP;
     Scheduler::IRQwaitStatusHook(this->t);
 }
 
-void Thread::ThreadFlags::IRQexitSleepAndWait()
+void Thread::ThreadFlags::IRQclearSleepAndWait()
 {
     flags &= ~(WAIT | SLEEP);
     Scheduler::IRQwaitStatusHook(this->t);
diff --git a/miosix/kernel/kernel.h b/miosix/kernel/kernel.h
index 793dd4bbc126114662b5744ee341ed496fa3d394..876abdc9efd8b7ab6abe5f7c45868e7b7dafdbbf 100755
--- a/miosix/kernel/kernel.h
+++ b/miosix/kernel/kernel.h
@@ -938,16 +938,14 @@ private:
         /**
          * Set the sleep flag of the thread.
          * Can only be called with interrupts disabled or within an interrupt.
-         * \param sleeping if true the flag will be set, otherwise cleared
          */
-        void IRQsetSleep(bool sleeping);
+        void IRQsetSleep();
 
         /**
-         * Shorthand for IRQsetWait(false); IRQsetSleep(false);
-         * Used by IRQwakeThreads to wake both threads doing absoluteSleep()
-         * and timedWait()
+         * Used by IRQwakeThreads to clear both the sleep and wait flags,
+         * waking threads doing absoluteSleep() as well as timedWait()
          */
-        void IRQexitSleepAndWait();
+        void IRQclearSleepAndWait();
 
         /**
          * Set the wait_join flag of the thread.