@@ -640,16 +640,14 @@ void tsk_give( tsk_t *tsk, unsigned flags );
640640 * IMMEDIATE: don't delay execution of current task
641641 * INFINITE: delay indefinitely execution of current task
642642 *
643- * Return
644- * E_SUCCESS : task object successfully finished countdown
645- * E_FAILURE : task was resumed
643+ * Return : none
646644 *
647645 ******************************************************************************/
648646
649- unsigned tsk_sleepFor ( cnt_t delay );
647+ void tsk_sleepFor ( cnt_t delay );
650648
651649__STATIC_INLINE
652- unsigned tsk_delay ( cnt_t delay ) { return tsk_sleepFor (delay); }
650+ void tsk_delay ( cnt_t delay ) { tsk_sleepFor (delay); }
653651
654652/* *****************************************************************************
655653 *
@@ -663,13 +661,11 @@ unsigned tsk_delay( cnt_t delay ) { return tsk_sleepFor(delay); }
663661 * IMMEDIATE: don't delay execution of current task
664662 * INFINITE: delay indefinitely execution of current task
665663 *
666- * Return
667- * E_SUCCESS : task object successfully finished countdown
668- * E_FAILURE : task was resumed
664+ * Return : none
669665 *
670666 ******************************************************************************/
671667
672- unsigned tsk_sleepNext ( cnt_t delay );
668+ void tsk_sleepNext ( cnt_t delay );
673669
674670/* *****************************************************************************
675671 *
@@ -680,35 +676,34 @@ unsigned tsk_sleepNext( cnt_t delay );
680676 * Parameters
681677 * time : timepoint value
682678 *
683- * Return
684- * E_SUCCESS : task object successfully finished countdown
685- * E_FAILURE : task was resumed
679+ * Return : none
686680 *
687681 ******************************************************************************/
688682
689- unsigned tsk_sleepUntil ( cnt_t time );
683+ void tsk_sleepUntil ( cnt_t time );
690684
691685/* *****************************************************************************
692686 *
693687 * Name : tsk_sleep
694688 *
695689 * Description : delay indefinitely execution of current task
690+ * execution of the task can be resumed
696691 *
697692 * Parameters : none
698693 *
699- * Return
700- * E_FAILURE : task was resumed
694+ * Return : none
701695 *
702696 ******************************************************************************/
703697
704698__STATIC_INLINE
705- unsigned tsk_sleep ( void ) { return tsk_sleepFor (INFINITE); }
699+ void tsk_sleep ( void ) { tsk_sleepFor (INFINITE); }
706700
707701/* *****************************************************************************
708702 *
709703 * Name : tsk_suspend
710704 *
711705 * Description : delay indefinitely execution of given task
706+ * execution of the task can be resumed
712707 *
713708 * Parameters
714709 * tsk : pointer to task object
@@ -725,11 +720,11 @@ unsigned tsk_suspend( tsk_t *tsk );
725720 *
726721 * Name : tsk_resume
727722 *
728- * Description : resume execution of given delayed task
723+ * Description : resume execution of given suspended task
724+ * only suspended or indefinitely delayed tasks can be resumed
729725 *
730726 * Parameters
731727 * tsk : pointer to delayed task object
732- * event : the value at which the given task is woken up
733728 *
734729 * Return
735730 * E_SUCCESS : task was successfully resumed
@@ -766,14 +761,15 @@ struct staticTaskT : public __tsk
766761 staticTaskT ( fun_t *_state ): __tsk _TSK_INIT (_state, stack_, size_) {}
767762 ~staticTaskT ( void ) { assert (__tsk::hdr.id == ID_STOPPED); }
768763
769- void kill ( void ) { tsk_kill (this ); }
770- void join ( void ) { tsk_join (this ); }
771- void start ( void ) { tsk_start (this ); }
772- void startFrom ( fun_t *_state ) { tsk_startFrom (this , _state); }
773- unsigned suspend ( void ) { return tsk_resume (this ); }
774- unsigned resume ( void ) { return tsk_resume (this ); }
764+ void kill ( void ) { tsk_kill (this ); }
765+ void join ( void ) { tsk_join (this ); }
766+ void start ( void ) { tsk_start (this ); }
767+ void startFrom ( fun_t * _state ) { tsk_startFrom (this , _state); }
768+ void give ( unsigned _flags ) { tsk_give (this , _flags); }
769+ unsigned suspend ( void ) { return tsk_suspend (this ); }
770+ unsigned resume ( void ) { return tsk_resume (this ); }
775771
776- bool operator !( void ) { return __tsk::hdr.id == ID_STOPPED; }
772+ bool operator !( void ) { return __tsk::hdr.id == ID_STOPPED; }
777773
778774 private:
779775 stk_t stack_[SSIZE(size_)];
@@ -849,21 +845,22 @@ typedef startTaskT<OS_STACK_SIZE> startTask;
849845
850846namespace ThisTask
851847{
852- static inline void pass ( void ) { tsk_pass (); }
853- static inline void yield ( void ) { tsk_yield (); }
848+ static inline void pass ( void ) { tsk_pass (); }
849+ static inline void yield ( void ) { tsk_yield (); }
854850#if OS_FUNCTIONAL
855- static inline void flip ( FUN_t _state ) { ((TaskT<>*)System.cur )->fun_ = _state;
856- tsk_flip (TaskT<>::run_); }
851+ static inline void flip ( FUN_t _state ) { ((TaskT<>*)System.cur )->fun_ = _state;
852+ tsk_flip (TaskT<>::run_); }
857853#else
858- static inline void flip ( FUN_t _state ) { tsk_flip (_state); }
854+ static inline void flip ( FUN_t _state ) { tsk_flip (_state); }
859855#endif
860- static inline void stop ( void ) { tsk_stop (); }
861- static inline unsigned sleepFor ( cnt_t _delay ) { return tsk_sleepFor (_delay); }
862- static inline unsigned sleepNext ( cnt_t _delay ) { return tsk_sleepNext (_delay); }
863- static inline unsigned sleepUntil ( cnt_t _time ) { return tsk_sleepUntil (_time); }
864- static inline unsigned sleep ( void ) { return tsk_sleep (); }
865- static inline unsigned delay ( cnt_t _delay ) { return tsk_delay (_delay); }
866- static inline void suspend ( void ) { tsk_suspend (System.cur ); }
856+ static inline void stop ( void ) { tsk_stop (); }
857+ static inline void suspend ( void ) { tsk_suspend (System.cur ); }
858+ static inline void wait ( unsigned _flags ) { tsk_wait (_flags); }
859+ static inline void sleepFor ( cnt_t _delay ) { tsk_sleepFor (_delay); }
860+ static inline void sleepNext ( cnt_t _delay ) { tsk_sleepNext (_delay); }
861+ static inline void sleepUntil ( cnt_t _time ) { tsk_sleepUntil (_time); }
862+ static inline void sleep ( void ) { tsk_sleep (); }
863+ static inline void delay ( cnt_t _delay ) { tsk_delay (_delay); }
867864}
868865
869866#endif // __cplusplus
0 commit comments