<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.arm.com/utility/feedstylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>ARTX-166 call to get current task&amp;#39;s priority</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/21456/artx-166-call-to-get-current-task-s-priority</link><description> 
I&amp;#39;m upgrading from RTX-166 to ARTX-166 and can&amp;#39;t find the
corresponding call, in ARTX-166, to get the current running task&amp;#39;s
priority. 

 
RTX-166 had the following: 

 

os_running_task_prio();

 

 
Does ARTX-166 have something similar? 
 </description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: ARTX-166 call to get current task's priority</title><link>https://community.arm.com/thread/47967?ContentTypeID=1</link><pubDate>Wed, 21 Mar 2007 09:51:19 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:bb428819-a910-4bf6-b232-8aa06d19ceb4</guid><dc:creator>Georget Stephane</dc:creator><description>&lt;p&gt;&lt;p&gt;
Hello,&lt;/p&gt;

&lt;p&gt;
Maybe I should let Keil answer you on that one, however I believe
that this function is not implemented with ARTX.&lt;/p&gt;

&lt;p&gt;
You should be able to write your own &lt;b&gt;os_running_task_prio()&lt;/b&gt;
function by looking directly in the OS active task list. Something
like this:&lt;/p&gt;

&lt;pre&gt;
#include ... a bunch of things
extern ... a bunch of things too

U8 os_tsk_ret_prio_self (void) {
   /* Get current task ID */
   OS_TID CurrentTID = os_tsk_self();
   if (CurrentTID != 0) {
      /* The OS_TID index starts at 1, whereas */
      /* entries in the table start            */
      /* at 0.                                 */
      return os_active_TCB[CurrentTID -1]-&amp;gt;prio;
   }
   else {
      return 0;
   }
}
&lt;/pre&gt;

&lt;p&gt;
Steph-&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>