在TI的SDK工程中添加POSIX支持

本文详细介绍了在TI的SDK中启用POSIX支持的过程,包括配置设置、头文件使用及线程创建函数的添加,最终实现编译成功。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

偶然看到TI的文档的截图

那么如果要是 有POSIX支持的SDK下面编程,一定很爽,于是对比了一下TI提供的工程实例,首先是头文件

有了头文件支持,但是编译还是过不去

于是看配置文件

里面有一个 POSIX configuration于是赶紧再ble的工程添加它

就是下面的这个配置

/* ================ POSIX configuration ================ */
var Settings = xdc.useModule('ti.posix.tirtos.Settings');

if (Program.build.target.$name.match(/iar/)) {
    /* 
     * For the IAR target, the 'ti.posix.tirtos.Settings' uses the
     * MultithreadSupport module. By default, the MultithreadSupport module
     * use the '--threaded_lib' library which provides a separate 'errno'
     * per thread and makes other rts libraries reentrant. This library has
     * a larger footprint which can be a problem for some apps, so we
     * override the default and disable it here.
     */
    var MultithreadSupport = 
        xdc.useModule('ti.sysbios.rts.iar.MultithreadSupport');
    MultithreadSupport.enableMultithreadSupport = false;
}

然后在主函数里面添加上线程创建的函数

编译成功!

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值