This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] CC3220SF:现有 pthread 列表

Guru**** 2553260 points


请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/wireless-connectivity/wi-fi-group/wifi/f/wi-fi-forum/923708/cc3220sf-list-of-existing-pthreads

器件型号:CC3220SF

是否有办法列出以编程方式在 TI-RTOS 下运行的 pthread?

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好!

    您可以使用以下代码:

    #include "XDC/std.h"
    #include "XDC/runtime/System.h"
    #include "XDC/runtime/Memory.h"
    #include "ti/sysBIOS/KNL/Task.h"
    
    void dumpTask (Task_Handle 任务){
    
    char* taskMode[]={"running "、"ready "、"blocked"、"Statp百分比"、"stit"、"inactive";"statt at_task";
    
    
    
    Task_stat (task、&stat);
    percent =((stat.used*100)/stat.STACKSIZE);
    
    print ("0x%x:%-21s %d %-10s |%-5d %-5d (%d%%)"、
    任务、
    Task_handle_name (task)、
    STAT.PRIORITY、
    taskMode[stat.mode]、
    stat.used、
    STAT.STACKSIZE、
    百分比);
    }
    
    void showTasks (void){
    
    Task_Object * task;
    int i;
    
    //显示
    (i = 0;i < Task_Object_count();i++){的静态任务
    任务= Task_Object_Get (NULL、I);
    dumpTask (task);
    }
    
    //显示动态创建的任务
    task = Task_Object_First();
    while (task){
    dumpTask (任务);
    任务= Task_Object_next (task);
    }
    

    BTW... 我不确定具体的#includes 是强制性的。 您需要自行检查。

    1月