📄 int8u ostaskcreateext.htm
字号:
<html xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:w="urn:schemas-microsoft-com:office:word"
xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=GB2312">
<meta name=ProgId content=Word.Document>
<meta name=Generator content="Microsoft Word 9">
<meta name=Originator content="Microsoft Word 9">
<link rel=File-List href="./INT8U%20OSTaskCreateExt.files/filelist.xml">
<title>INT8U OSTaskCreateExt(void (*task)(void *pd), void *pdata, OS_STK *ptos,
INT8U prio, INT16U, id, OS_STK *pbos, INT32U stk_size</title>
<!--[if gte mso 9]><xml>
<o:DocumentProperties>
<o:Author>halex</o:Author>
<o:Revision>1</o:Revision>
<o:TotalTime>0</o:TotalTime>
<o:Created>2003-05-25T16:51:00Z</o:Created>
<o:Pages>1</o:Pages>
<o:Words>1284</o:Words>
<o:Characters>7319</o:Characters>
<o:Company>lab706</o:Company>
<o:Lines>60</o:Lines>
<o:Paragraphs>14</o:Paragraphs>
<o:CharactersWithSpaces>8988</o:CharactersWithSpaces>
<o:Version>9.2812</o:Version>
</o:DocumentProperties>
</xml><![endif]--><!--[if gte mso 9]><xml>
<w:WordDocument>
<w:View>Normal</w:View>
<w:Zoom>0</w:Zoom>
<w:PunctuationKerning/>
<w:DrawingGridVerticalSpacing>7.8 磅</w:DrawingGridVerticalSpacing>
<w:DisplayHorizontalDrawingGridEvery>0</w:DisplayHorizontalDrawingGridEvery>
<w:DisplayVerticalDrawingGridEvery>2</w:DisplayVerticalDrawingGridEvery>
<w:Compatibility>
<w:SpaceForUL/>
<w:BalanceSingleByteDoubleByteWidth/>
<w:DoNotLeaveBackslashAlone/>
<w:ULTrailSpace/>
<w:DoNotExpandShiftReturn/>
<w:AdjustLineHeightInTable/>
<w:UseFELayout/>
</w:Compatibility>
<w:DoNotOptimizeForBrowser/>
</w:WordDocument>
</xml><![endif]-->
<style>
<!--
/* Font Definitions */
@font-face
{font-family:宋体;
panose-1:2 1 6 0 3 1 1 1 1 1;
mso-font-alt:SimSun;
mso-font-charset:134;
mso-generic-font-family:auto;
mso-font-pitch:variable;
mso-font-signature:3 135135232 16 0 262145 0;}
@font-face
{font-family:"\@宋体";
panose-1:2 1 6 0 3 1 1 1 1 1;
mso-font-charset:134;
mso-generic-font-family:auto;
mso-font-pitch:variable;
mso-font-signature:3 135135232 16 0 262145 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{mso-style-parent:"";
margin:0cm;
margin-bottom:.0001pt;
text-align:justify;
text-justify:inter-ideograph;
mso-pagination:none;
font-size:10.5pt;
mso-bidi-font-size:12.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:宋体;
mso-font-kerning:1.0pt;}
h1
{mso-style-next:正文;
margin-top:17.0pt;
margin-right:0cm;
margin-bottom:16.5pt;
margin-left:0cm;
text-align:justify;
text-justify:inter-ideograph;
line-height:240%;
mso-pagination:lines-together;
page-break-after:avoid;
mso-outline-level:1;
font-size:22.0pt;
font-family:"Times New Roman";
mso-font-kerning:22.0pt;}
p.CodeSeg, li.CodeSeg, div.CodeSeg
{mso-style-name:CodeSeg;
mso-style-update:auto;
margin:0cm;
margin-bottom:.0001pt;
text-align:justify;
text-justify:inter-ideograph;
mso-pagination:widow-orphan;
tab-stops:18.0pt 22.5pt 54.0pt 90.0pt 126.0pt 162.0pt 198.0pt 234.0pt 270.0pt 306.0pt 342.0pt;
background:#F2F2F2;
mso-shading:windowtext;
mso-pattern:gray-5 auto;
text-autospace:none;
border:none;
mso-border-alt:solid #999999 3.0pt;
padding:0cm;
mso-padding-alt:1.0pt 1.0pt 15.0pt 1.0pt;
mso-border-shadow:yes;
font-size:10.0pt;
font-family:"Courier New";
mso-fareast-font-family:宋体;
mso-fareast-language:RU;
font-weight:bold;}
p.NewSectionPara, li.NewSectionPara, div.NewSectionPara
{mso-style-name:NewSectionPara;
margin:0cm;
margin-bottom:.0001pt;
text-align:justify;
text-justify:inter-ideograph;
mso-pagination:widow-orphan;
tab-stops:22.5pt;
text-autospace:none;
font-size:10.0pt;
mso-bidi-font-size:12.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:宋体;
mso-fareast-language:RU;}
p.Descript, li.Descript, div.Descript
{mso-style-name:Descript;
margin:0cm;
margin-bottom:.0001pt;
text-align:justify;
text-justify:inter-ideograph;
mso-pagination:widow-orphan;
tab-stops:22.5pt 27.0pt;
text-autospace:none;
font-size:10.0pt;
mso-bidi-font-size:12.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:宋体;
mso-fareast-language:RU;}
p.Code, li.Code, div.Code
{mso-style-name:Code;
mso-style-parent:CodeSeg;
margin:0cm;
margin-bottom:.0001pt;
text-align:justify;
text-justify:inter-ideograph;
mso-pagination:widow-orphan;
tab-stops:18.0pt 22.5pt 54.0pt 90.0pt 126.0pt 162.0pt 198.0pt 234.0pt 270.0pt 306.0pt 342.0pt;
text-autospace:none;
font-size:7.0pt;
font-family:"Courier New";
mso-fareast-font-family:宋体;
mso-fareast-language:RU;
font-weight:bold;}
/* Page Definitions */
@page
{mso-page-border-surround-header:no;
mso-page-border-surround-footer:no;}
@page Section1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;
mso-header-margin:36.0pt;
mso-footer-margin:36.0pt;
mso-paper-source:0;}
div.Section1
{page:Section1;}
@page Section2
{size:595.3pt 841.9pt;
margin:72.0pt 90.0pt 72.0pt 90.0pt;
mso-header-margin:42.55pt;
mso-footer-margin:49.6pt;
mso-paper-source:0;
layout-grid:15.6pt;}
div.Section2
{page:Section2;}
-->
</style>
</head>
<body background="./系统的服务例程.files/image001.jpg" lang=ZH-CN style='tab-interval:21.0pt;text-justify-trim:punctuation'>
<div class=Section1>
<h1><span lang=EN-US style='font-size:14.0pt;mso-bidi-font-size:8.0pt'>INT8U
OSTaskCreateExt(void (*task)(void *pd), void *pdata, OS_STK *ptos, INT8U prio,
INT16U, id, OS_STK *pbos, INT32U stk_size, void *pext, INT16U opt);<o:p></o:p></span></h1>
<p class=Descript><b><span lang=EN-US style='font-family:"Courier New"'>OSTaskCreateExt()</span><span
lang=EN-US> </span></b><span lang=EN-US>allows an application to create a task
so it can be managed by µC/OS-II.<span style="mso-spacerun: yes">
</span>This function serves the same purpose as </span><b><span lang=EN-US
style='font-family:"Courier New"'>OSTaskCreate()</span></b><span lang=EN-US>
except that it allows you to specify additional information about your task to
µC/OS-II.<span style="mso-spacerun: yes"> </span>Tasks can either be
created prior to the start of multitasking or by a running task.<span
style="mso-spacerun: yes"> </span>A task cannot be created by an
ISR.<span style="mso-spacerun: yes"> </span>A task MUST be written as an
infinite loop as shown in the example code below and, MUST NOT return.
Depending on how the stack frame was built, your task will either have
interrupts enable or disabled.<span style="mso-spacerun: yes"> </span>You
will need to check with the processor specific code for details.<span
style="mso-spacerun: yes"> </span>You should note that the first four
arguments are exactly the same as the ones for </span><b><span lang=EN-US
style='font-family:"Courier New"'>OSTaskCreate()</span></b><span lang=EN-US>.<span
style="mso-spacerun: yes"> </span>This was done to simplify the migration
to this new, and more powerful function. </span></p>
<p class=NewSectionPara><span lang=EN-US><![if !supportEmptyParas]> <![endif]><o:p></o:p></span></p>
<p class=NewSectionPara><b><span lang=EN-US>Arguments<o:p></o:p></span></b></p>
<p class=NewSectionPara><span lang=EN-US><![if !supportEmptyParas]> <![endif]><o:p></o:p></span></p>
<p class=Descript><b><span lang=EN-US style='font-family:"Courier New"'>task</span></b><span
lang=EN-US> is a pointer to the task's code.</span></p>
<p class=NewSectionPara><span lang=EN-US><![if !supportEmptyParas]> <![endif]><o:p></o:p></span></p>
<p class=Descript><b><span lang=EN-US style='font-family:"Courier New"'>pdata</span></b><span
lang=EN-US> is a pointer to an optional data area which can be used to pass
parameters to the task when it is created.<span style="mso-spacerun:
yes"> </span>Where the task is concerned, it thinks it was invoked and
passed the argument </span><b><span lang=EN-US style='font-family:"Courier New"'>pdata</span></b><span
lang=EN-US> as follows:</span></p>
<p class=Descript><span lang=EN-US><![if !supportEmptyParas]> <![endif]><o:p></o:p></span></p>
<div style='border:solid #999999 1.5pt;padding:1.0pt 1.0pt 15.0pt 1.0pt;
background:#F2F2F2;mso-shading:windowtext;mso-pattern:gray-5 auto'>
<p class=CodeSeg style='border:none;mso-border-alt:solid #999999 1.5pt;
padding:0cm;mso-padding-alt:1.0pt 1.0pt 15.0pt 1.0pt'><span lang=EN-US><span
style='mso-tab-count:1'> </span>void Task (void *pdata)</span></p>
<p class=CodeSeg style='border:none;mso-border-alt:solid #999999 1.5pt;
padding:0cm;mso-padding-alt:1.0pt 1.0pt 15.0pt 1.0pt'><span lang=EN-US><span
style='mso-tab-count:1'> </span>{</span></p>
<p class=CodeSeg style='border:none;mso-border-alt:solid #999999 1.5pt;
padding:0cm;mso-padding-alt:1.0pt 1.0pt 15.0pt 1.0pt'><span lang=EN-US><span
style="mso-spacerun: yes"> </span>.<span
style="mso-spacerun:
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -