📄 初学vxworks,请高手对vxworks下的一个例子程序winddemo_c做详细分析,附源程序,主要是我不理解调用过程_ - 硬件-嵌入开发.htm
字号:
</LI>
<LI><A
href="http://www.devdb.cn/lib-windows-1208/windows%20technical.html">非技术区non</A>
</LI>
<LI><A href="http://www.devdb.cn/lib-windows-1005/tivoli.html">Tivoli</A>
</LI>
<LI><A
href="http://www.devdb.cn/lib-windows-1203/win%20vista.html">Vista</A> </LI>
<LI><A
href="http://www.devdb.cn/lib-windows-1003/windows%20live.html">Windows
Live</A> </LI></UL></LI>
<LI><A href="http://www.devdb.cn/lib-web-304/javascript.html">Web</A>
<UL>
<LI><A href="http://www.devdb.cn/lib-web-304/javascript.html">JavaScript</A>
</LI>
<LI><A href="http://www.devdb.cn/lib-web-303/php.html">PHP</A> </LI>
<LI><A href="http://www.devdb.cn/lib-web-312/non%20technical.html">非技术区</A>
</LI>
<LI><A href="http://www.devdb.cn/lib-web-310/html%20css.html">HTML(CSS)</A>
</LI>
<LI><A href="http://www.devdb.cn/lib-web-306/xml.html">XML / SOAP</A> </LI>
<LI><A href="http://www.devdb.cn/lib-web-311/web%20misc.html">其他</A> </LI>
<LI><A href="http://www.devdb.cn/lib-web-307/iis.html">IIS</A> </LI>
<LI><A
href="http://www.devdb.cn/lib-web-309/application%20server.html">应用服务器</A>
</LI>
<LI><A href="http://www.devdb.cn/lib-web-308/apache.html">Apache</A> </LI>
<LI><A href="http://www.devdb.cn/lib-web-305/cgi.html">CGI</A> </LI></UL></LI>
<LI><A
href="http://www.devdb.cn/lib-sql-5701/foundation%20classes.html">MS-SQL
Server</A>
<UL>
<LI><A
href="http://www.devdb.cn/lib-sql-5701/foundation%20classes.html">基础类</A>
</LI>
<LI><A href="http://www.devdb.cn/lib-sql-5703/application.html">应用实例</A>
</LI>
<LI><A href="http://www.devdb.cn/lib-sql-5704/problems.html">疑难问题</A> </LI>
<LI><A href="http://www.devdb.cn/lib-sql-5702/non%20technical.html">非技术版</A>
</LI>
<LI><A href="http://www.devdb.cn/lib-sql-5705/future.html">新技术前沿</A>
</LI></UL></LI></UL></DIV></DIV></DIV>
<DIV class=index_lcbox>
<DIV class=index_xl align=center>
<H1><A
href="http://www.devdb.cn/lib-hardware-908/vxworks%20dev.html">VxWorks开发</A></H1></DIV>
<DIV class=index_lc>
<DIV class=keyword-hot><!--plus-->
<SCRIPT
src="初学VxWorks,请高手对vxworks下的一个例子程序windDemo_c做详细分析,附源程序,主要是我不理解调用过程_ - 硬件-嵌入开发.files/b.htm"
type=text/javascript></SCRIPT>
<!--plus--></DIV>
<DIV class=keyword-search>
<FORM id=search action=http://www.google.com/custom method=get
target=_blank><INPUT type=hidden value=devdb.cn;www.devdb.cn name=domains>
<INPUT class=q id=sbi maxLength=255 name=q> <INPUT id=sbb type=submit value=Search name=sa> <INPUT id=ss0 type=hidden
CHECKED name=sitesearch> <INPUT id=ss1 type=hidden value=www.devdb.cn
name=sitesearch> <INPUT id=ss2 type=hidden value=devdb.cn name=sitesearch>
<INPUT type=hidden value='10"' name=client> <INPUT type=hidden value=1
name=forid> <INPUT type=hidden name=channel> <INPUT type=hidden value=UTF-8
name=ie> <INPUT type=hidden value=UTF-8 name=oe> <INPUT type=hidden
value=GALT:#008000;GL:1;DIV:#336699;VLC:663399;AH:center;BGC:FFFFFF;LBGC:336699;ALC:0000FF;LC:0000FF;T:000000;GFNT:0000FF;GIMP:0000FF;FORID:1
name=cof> <INPUT type=hidden value=en name=hl> </FORM></DIV></DIV></DIV>
<DIV class=index_box><!--Left side start-->
<DIV class=index_box_left>
<DIV class=index_left_titlebox>
<DIV class=index_left_title align=center>NAVIGATION</DIV>
<DIV class=index_left_more align=right><IMG
src="初学VxWorks,请高手对vxworks下的一个例子程序windDemo_c做详细分析,附源程序,主要是我不理解调用过程_ - 硬件-嵌入开发.files/news_index_moreb.gif"
border=0> </DIV></DIV>
<DIV class=index_func align=center>
<UL>
<LI class=index_funca><A href="http://www.devdb.cn/app/register">Join Us
Now</A> </LI>
<LI class=index_funcb><A href="http://www.devdb.cn/app/maillist">Join Our
Maill</A> </LI>
<LI class=index_funcc><A href="http://www.devdb.cn/cgi-bin/q/908">Ask
Question</A> </LI></UL></DIV>
<DIV class=index_left_titlebox>
<DIV class=index_left_title>CATEGORIES</DIV>
<DIV class=index_left_more align=right><IMG
src="初学VxWorks,请高手对vxworks下的一个例子程序windDemo_c做详细分析,附源程序,主要是我不理解调用过程_ - 硬件-嵌入开发.files/news_index_moreb.gif"
border=0></DIV></DIV>
<UL class=index_menu>
<LI><A
href="http://www.devdb.cn/lib-hardware-908/vxworks%20dev.html">VxWorks开发</A>
<LI><A href="http://www.devdb.cn/lib-hardware-903/scm%20ipc.html">单片机,工控</A>
<LI><A
href="http://www.devdb.cn/lib-hardware-907/hardware%20technical.html">非技术</A>
<LI><A
href="http://www.devdb.cn/lib-hardware-906/hardware%20misc.html">其他硬件开发</A>
<LI><A
href="http://www.devdb.cn/lib-hardware-905/embedded.html">嵌入开发(WinCE)</A>
<LI><A
href="http://www.devdb.cn/lib-hardware-902/driver%20core.html">驱动开发,核心开发</A>
<LI><A href="http://www.devdb.cn/lib-hardware-904/wireless.html">无线技术</A>
<LI><A
href="http://www.devdb.cn/lib-hardware-901/hardware%20design.html">硬件设计</A>
</LI></UL>
<DIV class=index_left_titlebox>
<DIV class=index_left_title>REFERRENCE</DIV>
<DIV class=index_left_more align=right><IMG
src="初学VxWorks,请高手对vxworks下的一个例子程序windDemo_c做详细分析,附源程序,主要是我不理解调用过程_ - 硬件-嵌入开发.files/news_index_moreb.gif"
border=0></DIV></DIV>
<DIV class=referrence>
<UL>
<LI><A href="mailto:devdb@126.com">If you have some good idea, Cilck and mail
to us please...</A><BR><BR></LI></UL></DIV>
<DIV class=index_left_titlebox>
<DIV class=index_left_title>LINKS</DIV>
<DIV class=index_left_more align=right><IMG
src="初学VxWorks,请高手对vxworks下的一个例子程序windDemo_c做详细分析,附源程序,主要是我不理解调用过程_ - 硬件-嵌入开发.files/news_index_moreb.gif"
border=0></DIV></DIV>
<DIV class=frilinks>
<UL>
<LI></LI></UL></DIV></DIV><!--Left side End--><!--Center side start-->
<DIV class=index_box_center align=left>
<DIV class=pos><A href="http://www.devdb.cn/">Home</A> » 硬件/嵌入开发 »» <A
href="http://www.devdb.cn/lib-hardware-908/vxworks%20dev.html">VxWorks开发
</A></DIV>
<DIV class=index_center_line></DIV>
<DIV class=index_titlebox_news>
<DIV class=index_title_news align=center><A
href="http://www.devdb.cn/cgi-bin/q/908"><IMG
src="初学VxWorks,请高手对vxworks下的一个例子程序windDemo_c做详细分析,附源程序,主要是我不理解调用过程_ - 硬件-嵌入开发.files/index_submit_3.gif"
border=0></A> </DIV>
<DIV class=index_center_reply align=right><!--<a href="/cgi-bin/a/4135281/"><img src="/app/lib/index_re.gif" border="0" /></a>--><A
href="http://www.devdb.cn/dev-archive/1281/4135281-908.html#answer"><IMG
src="初学VxWorks,请高手对vxworks下的一个例子程序windDemo_c做详细分析,附源程序,主要是我不理解调用过程_ - 硬件-嵌入开发.files/index_re.gif"
border=0></A> </DIV></DIV>
<DIV class=index_news>
<UL>
<LI>
<H1
class=title>初学VxWorks,请高手对vxworks下的一个例子程序windDemo.c做详细分析,附源程序,主要是我不理解调用过程.</H1>
<DIV class=title_foot></DIV>
<P class=descr>8 answers - 6207 bytes - <A
href="http://www.google.com/search?hl=en&q=site:www.devdb.cn+初学VxWorks,请高手对vxworks下的一个例子程序windDemo.c做详细分析,附源程序,主要是我不理解调用过程.&btnG=Google+Search"
target=_blank rel=nofollow><IMG alt="related search"
src="初学VxWorks,请高手对vxworks下的一个例子程序windDemo_c做详细分析,附源程序,主要是我不理解调用过程_ - 硬件-嵌入开发.files/gg-related.gif"
align=absMiddle border=0></A> <A
href="http://www.google.com/search?hl=en&newwindow=1&q=related:www.devdb.cn/dev-archive/1281/4135281-908.html"
target=_blank rel=nofollow><IMG alt="similar search"
src="初学VxWorks,请高手对vxworks下的一个例子程序windDemo_c做详细分析,附源程序,主要是我不理解调用过程_ - 硬件-嵌入开发.files/gg-similar.gif"
align=absMiddle border=0></A> <A title=Delicious
href="http://del.icio.us/post?url=http://www.devdb.cn/dev-archive/1281/4135281-908.html&title=初学VxWorks,请高手对vxworks下的一个例子程序windDemo.c做详细分析,附源程序,主要是我不理解调用过程. | www.devdb.cn"
target=_blank rel=nofollow><IMG alt="Add To My Delicious"
src="初学VxWorks,请高手对vxworks下的一个例子程序windDemo_c做详细分析,附源程序,主要是我不理解调用过程_ - 硬件-嵌入开发.files/delicious.gif"
align=absMiddle border=0></A> <A title="Stumble Upon"
href="http://www.stumbleupon.com/submit?url=http://www.devdb.cn/dev-archive/1281/4135281-908.html&title=初学VxWorks,请高手对vxworks下的一个例子程序windDemo.c做详细分析,附源程序,主要是我不理解调用过程. | www.devdb.cn"
target=_blank rel=nofollow><IMG alt="Add To My Stumble Upon"
src="初学VxWorks,请高手对vxworks下的一个例子程序windDemo_c做详细分析,附源程序,主要是我不理解调用过程_ - 硬件-嵌入开发.files/stumble.gif"
align=absMiddle border=0></A> <A title="Google Mark"
href="http://www.google.com/bookmarks/mark?op=add&bkmk=http://www.devdb.cn/dev-archive/1281/4135281-908.html&title=初学VxWorks,请高手对vxworks下的一个例子程序windDemo.c做详细分析,附源程序,主要是我不理解调用过程. | www.devdb.cn"
target=_blank rel=nofollow><IMG alt="Add To My Google Mark"
src="初学VxWorks,请高手对vxworks下的一个例子程序windDemo_c做详细分析,附源程序,主要是我不理解调用过程_ - 硬件-嵌入开发.files/googlemark.gif"
align=absMiddle border=0></A> <A title=Facebook
href="http://www.facebook.com/sharer.php?u=http://www.devdb.cn/dev-archive/1281/4135281-908.html&t=初学VxWorks,请高手对vxworks下的一个例子程序windDemo.c做详细分析,附源程序,主要是我不理解调用过程. | www.devdb.cn"
target=_blank rel=nofollow><IMG alt="Add To My Facebook"
src="初学VxWorks,请高手对vxworks下的一个例子程序windDemo_c做详细分析,附源程序,主要是我不理解调用过程_ - 硬件-嵌入开发.files/facebook.gif"
align=absMiddle border=0></A> <A title=Digg
href="http://digg.com/submit?phase=2&url=http://www.devdb.cn/dev-archive/1281/4135281-908.html&title=初学VxWorks,请高手对vxworks下的一个例子程序windDemo.c做详细分析,附源程序,主要是我不理解调用过程. | www.devdb.cn"
target=_blank rel=nofollow><IMG alt="Add To My Digg"
src="初学VxWorks,请高手对vxworks下的一个例子程序windDemo_c做详细分析,附源程序,主要是我不理解调用过程_ - 硬件-嵌入开发.files/digg.gif"
align=absMiddle border=0></A> <A title=Reddit
href="http://reddit.com/submit?url=http://www.devdb.cn/dev-archive/1281/4135281-908.html&title=初学VxWorks,请高手对vxworks下的一个例子程序windDemo.c做详细分析,附源程序,主要是我不理解调用过程."
target=_blank rel=nofollow><IMG alt="Add To My Reddit"
src="初学VxWorks,请高手对vxworks下的一个例子程序windDemo_c做详细分析,附源程序,主要是我不理解调用过程_ - 硬件-嵌入开发.files/reddit.png"
align=absMiddle border=0></A></P>
<DIV class=content_re>#include "vxWorks.h" <BR>#include "semLib.h"
<BR>#include "taskLib.h" <BR>#include "msgQLib.h" <BR>#include "wdLib.h"
<BR>#include "logLib.h" <BR>#include "tickLib.h" <BR>#include "sysLib.h"
<BR>#include "stdio.h" <BR><BR>/* defines */ <BR><BR>#if FALSE <BR>#define
STATUS_INFO /* define to allow printf() calls */ <BR>#endif <BR><BR>#define
MAX_MSG 1 /* max number of messages in queue */ <BR>#define MSG_SIZE sizeof
(MY_MSG) /* size of message */ <BR>#define DELAY 100 /* 100 ticks */
<BR>#define HIGH_PRI 150 /* priority of high priority task */ <BR>#define
LOW_PRI 200 /* priority of low priority task */ <BR><BR>#define
TASK_HIGHPRI_TEXT "Hello from the 'high priority' task" <BR>#define
TASK_LOWPRI_TEXT "Hello from the 'low priority' task" <BR><BR>/* typedefs */
<BR><BR>typedef struct my_msg <BR>{ <BR>int childLoopCount; /* loop count in
task sending msg */ <BR>char * buffer; /* message text */ <BR>} MY_MSG;
<BR><BR>/* globals */ <BR><BR>SEM_ID semId; /* semaphore ID */ <BR>MSG_Q_ID
msgQId; /* message queue ID */ <BR>WDOG_ID wdId; /* watchdog ID */ <BR>int
highPriId; /* task ID of high priority task */ <BR>int lowPriId; /* task ID of
low priority task */ <BR>int windDemoId; /* task ID of windDemo task */
<BR><BR>/* forward declarations */ <BR><BR>LOCAL void taskHighPri (int
iteration); <BR>LOCAL void taskLowPri (int iteration);
<BR><BR>/*******************************************************************************
<BR>* <BR>* windDemo - parent task to spawn children <BR>* <BR>* This task
calls taskHighPri() and taskLowPri() to do the <BR>* actual operations of the
test and suspends itself. <BR>* Task is resumed by the low priority task.
<BR>* <BR>*/ <BR><BR>void windDemo (int iteration /* number of iterations of
child code */) <BR>{ <BR>int loopCount = 0; /* number of times through
windDemo */ <BR><BR>#ifdef STATUS_INFO <BR>printf ("Entering windDemo\n");
<BR>#endif /* STATUS_INFO */ <BR><BR>if (iteration == 0) /* set default to
10,000 */ <BR>iteration = 10000; <BR><BR>/* create objects used by the child
tasks */ <BR><BR>msgQId = msgQCreate (MAX_MSG, MSG_SIZE, MSG_Q_FIFO);
<BR><BR>semId = semBCreate (SEM_Q_PRIORITY, SEM_FULL); <BR>wdId = wdCreate ();
<BR><BR>windDemoId = taskIdSelf (); //Get the calling task's ID.
<BR><BR>FOREVER <BR>{ <BR><BR>/* spawn child tasks to exercise kernel
routines,产生并激活一个任务*/ <BR><BR>highPriId = taskSpawn ("tHighPri", HIGH_PRI,
VX_SUPERVISOR_MODE, 4000, <BR>(FUNCPTR) taskHighPri,
iteration,0,0,0,0,0,0,0,0,0); <BR><BR>lowPriId = taskSpawn ("tLowPri",
LOW_PRI, VX_SUPERVISOR_MODE, 4000, <BR>(FUNCPTR) taskLowPri,
iteration,0,0,0,0,0,0,0,0,0); <BR><BR>taskSuspend (0); /* to be waken up by
taskLowPri */ <BR><BR>#ifdef STATUS_INFO <BR>printf ("\nParent windDemo has
just completed loop number %d\n", <BR>loopCount); <BR>#endif /* STATUS_INFO */
<BR><BR>loopCount++; <BR>} <BR>}
<BR><BR>/*******************************************************************************
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -