OS _prio_self comment in the ostasksuspend (int8u PRIO) task suspension function of uCOS-II

Source: Internet
Author: User

The OS _prio_self macro IN THE ostasksuspend (int8u PRIO) task suspension function is used to indicate whether to suspend itself, in fact, in uCOS-II, OS _prio_self is mainly set to facilitate the function programming of the equivalent type of the suspended task itself. For example, to suspend itself in a task, at this time, at the call level, you do not need to obtain your own priority and other operations. You only need to call ostasksusped (OS _prio_self) to complete your own suspension, which greatly simplifies the programming of the suspension process, it also unifies the interface, whether it is to suspend itself or to suspend other tasks, this interface can be used to achieve,
You only need to transmit different parameters.

In addition, OS _tcb_reserved is (OS _tcb *) 1) used to create a task, this macro is used to occupy this priority, but it has not been initialized yet, therefore, using this macro in this function indicates that the process to be suspended is being created and initialization has not been completed.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.