This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

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?

  • 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-