DSP/BIOS实时操作系统中PIP对象多任务间传递数据示例程序
生活随笔
收集整理的這篇文章主要介紹了
DSP/BIOS实时操作系统中PIP对象多任务间传递数据示例程序
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
2019獨角獸企業重金招聘Python工程師標準>>>
#include <std.h>#include <log.h> #include <tsk.h>#include "tskcfg.h"Void main() {}Void mytest() { int *add;int i,j;LOG_printf(&trace, "Task mytest() DONE");if(PIP_getWriterNumFrames(&pip1)<=0)return;PIP_alloc(&pip1);add=PIP_getWriterAddr(&pip1);for(j=0;j<100;j++){*add++ = j;LOG_printf(&trace, "add[%d]=%d",j,j);}PIP_put(&pip1); }Void mytest2() {int *add1;int i,j;int buf[10];LOG_printf(&trace, "Task mytest2() DONE");if(PIP_getWriterNumFrames(&pip1)<=0)return;PIP_get(&pip1);add1 = PIP_getReaderAddr(&pip1);for(j=0;j<100;j++){buf[j]=0;buf[j]=*add1++;LOG_printf(&trace, "buf[%d]=%d",j,buf[j]);}PIP_free(&pip1);}任務1:mytest和任務2:mytest2,使用管道對象pip1來實現數據傳遞。
示例程序方便理解和記憶。
轉載于:https://my.oschina.net/dongdong2012/blog/93862
總結
以上是生活随笔為你收集整理的DSP/BIOS实时操作系统中PIP对象多任务间传递数据示例程序的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: poj 1789 Truck Histo
- 下一篇: RHEL5.5配置DHCP服务器以及DH