您的位置:首页 > 移动开发 > IOS开发

SYS/BIOS 学习历程(一)Creating a SYS/BIOS Project with the TI Resource Explorer

2014-06-06 11:02 513 查看
Creating a SYS/BIOS Project with the TI Resource Explorer





Notational Conventions

This document uses the following conventions:

• Program listings, program examples, and interactive displays are shown in a special typeface.

Examples use a bold version of the special typeface for emphasis.

Here is a sample program listing:


#include <xdc/runtime/System.h>

int main(){

System_printf("Hello World!\n");

return (0);

}

• Square brackets ( [ and ] ) identify an optional parameter. If you use an optional parameter, you

specify the information within the brackets. Unless the square brackets are in a bold typeface, do not

enter the brackets themselves.


#include <xdc/std.h>

#include <xdc/runtime/Error.h>

#include <xdc/runtime/System.h>

#include <ti/sysbios/BIOS.h>

#include <ti/sysbios/knl/Task.h>

#include <xdc/runtime/System.h>//

/*======== taskFxn ========*/

Void taskFxn(UArg a0, UArg a1)

{

System_printf("enter taskFxn()\n");

Task_sleep(10);

System_printf("exit taskFxn()\n");

}

/*======== main ======== */

Int main()

{

Task_Handle task;

Error_Block eb;

System_printf("enter main()\n");

Error_init(&eb);

task = Task_create(taskFxn, NULL, &eb);

if (task == NULL) {

System_printf("Task_create() failed!\n");

BIOS_exit(0);

}

BIOS_start(); /* does not return */

return(0);

}

参考:TI SYS/BIOS v6.35 Real-time Operating System User's Guide





内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐