Keil Logo Arm Logo

Discussion Forum

ARTX-166 call to get current task's priority

Next Thread | Thread List | Previous Thread Start a Thread | Settings

Details Message
Read-Only
Author
Steve Erlanson
Posted
21-Mar-2007 01:45 GMT
Toolset
C166
New! ARTX-166 call to get current task's priority

I'm upgrading from RTX-166 to ARTX-166 and can't find the corresponding call, in ARTX-166, to get the current running task's priority.

RTX-166 had the following:


os_running_task_prio();

Does ARTX-166 have something similar?

Read-Only
Author
Stephane Georget
Posted
21-Mar-2007 15:51 GMT
Toolset
C166
New! RE: ARTX-166 call to get current task's priority

Hello,

Maybe I should let Keil answer you on that one, however I believe that this function is not implemented with ARTX.

You should be able to write your own os_running_task_prio() function by looking directly in the OS active task list. Something like this:

#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]->prio;
   }
   else {
      return 0;
   }
}

Steph-

Next Thread | Thread List | Previous Thread Start a Thread | Settings

Keil logo

Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.