<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://www.robotc.net/w/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://www.robotc.net/w/index.php?title=ARDUINO_MEGA_Functions_Task_Control&amp;feed=atom&amp;action=history</id>
		<title>ARDUINO MEGA Functions Task Control - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://www.robotc.net/w/index.php?title=ARDUINO_MEGA_Functions_Task_Control&amp;feed=atom&amp;action=history"/>
		<link rel="alternate" type="text/html" href="http://www.robotc.net/w/index.php?title=ARDUINO_MEGA_Functions_Task_Control&amp;action=history"/>
		<updated>2013-05-22T12:07:57Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.18.0</generator>

	<entry>
		<id>http://www.robotc.net/w/index.php?title=ARDUINO_MEGA_Functions_Task_Control&amp;diff=3278&amp;oldid=prev</id>
		<title>Bfeher at 20:49, 11 May 2012</title>
		<link rel="alternate" type="text/html" href="http://www.robotc.net/w/index.php?title=ARDUINO_MEGA_Functions_Task_Control&amp;diff=3278&amp;oldid=prev"/>
				<updated>2012-05-11T20:49:01Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
		&lt;tr valign='top'&gt;
		&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
		&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 20:49, 11 May 2012&lt;/td&gt;
		&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;yambe:breadcrumb&amp;gt;ARDUINO_MEGA_Functions_and_Variables|Functions and Variables&amp;lt;/yambe:breadcrumb&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;{{DISPLAYTITLE:2560 (MEGA) Task Control}}&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;yambe:breadcrumb &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;self=&amp;quot;2560 (MEGA) Task Control&amp;quot;&lt;/ins&gt;&amp;gt;ARDUINO_MEGA_Functions_and_Variables|Functions and Variables&amp;lt;/yambe:breadcrumb&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;br /&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;br /&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Bfeher</name></author>	</entry>

	<entry>
		<id>http://www.robotc.net/w/index.php?title=ARDUINO_MEGA_Functions_Task_Control&amp;diff=3042&amp;oldid=prev</id>
		<title>Tfriez at 02:10, 10 May 2012</title>
		<link rel="alternate" type="text/html" href="http://www.robotc.net/w/index.php?title=ARDUINO_MEGA_Functions_Task_Control&amp;diff=3042&amp;oldid=prev"/>
				<updated>2012-05-10T02:10:24Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
		&lt;tr valign='top'&gt;
		&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
		&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 02:10, 10 May 2012&lt;/td&gt;
		&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 4:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 4:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;{|&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;{|&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;|-&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;|-&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;|Up to &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;19 &lt;/del&gt;additional tasks can execute concurrently with task main within &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;a VEX Cortex user program (and up to 4 additional tasks within a VEX PIC &lt;/del&gt;user program&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;)&lt;/del&gt;. The ‘main’ or ‘primary’ task is automatically started when a user program is run. Execution of other tasks can be started and stopped with the &amp;lt;span class=&amp;quot;keywordBI&amp;quot;&amp;gt;StartTask&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;keywordBI&amp;quot;&amp;gt;StopTask&amp;lt;/span&amp;gt; functions. The &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;VEX &lt;/del&gt;will share CPU execution time among various tasks by giving each task a “time slice” where it will execute a group of instructions.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;|Up to &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;3 &lt;/ins&gt;additional tasks can execute concurrently with task main within &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;an Arduino &lt;/ins&gt;user program. The ‘main’ or ‘primary’ task is automatically started when a user program is run. Execution of other tasks can be started and stopped with the &amp;lt;span class=&amp;quot;keywordBI&amp;quot;&amp;gt;StartTask&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;keywordBI&amp;quot;&amp;gt;StopTask&amp;lt;/span&amp;gt; functions. The &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Arduino &lt;/ins&gt;will share CPU execution time among various tasks by giving each task a “time slice” where it will execute a group of instructions.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160; &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160; &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Each task can be assigned a priority from 0 to 255. The &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;VEX &lt;/del&gt;scheduler gives execution time to the highest priority task that is &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;waiting &lt;/del&gt;to run. A round robin scheduling scheme is used when there are multiple tasks ready to run all with the highest priority. Lower priority tasks will not execute until there are no tasks of higher priority that are &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;ready to run&lt;/del&gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Each task can be assigned a priority from 0 to 255. The &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Arduino &lt;/ins&gt;scheduler gives execution time to the highest priority task that is &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;in queue &lt;/ins&gt;to run &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;code&lt;/ins&gt;. A round robin scheduling scheme is used when there are multiple tasks ready to run all with the highest priority. Lower priority tasks will not execute until there are no tasks of higher priority that are &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;queuing&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160; &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160; &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;A task that is waiting for a time period to expire is not ready to run. Once the time period has expired it will again become ready to run. Waiting tasks do not consume any CPU cycles.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;A task that is waiting for a time period to expire is not ready to run. Once the time period has expired it will again become ready to run. Waiting tasks do not consume any CPU cycles.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Tfriez</name></author>	</entry>

	<entry>
		<id>http://www.robotc.net/w/index.php?title=ARDUINO_MEGA_Functions_Task_Control&amp;diff=2999&amp;oldid=prev</id>
		<title>Tfriez: Created page with &quot;&lt;yambe:breadcrumb&gt;ARDUINO_MEGA_Functions_and_Variables|Functions and Variables&lt;/yambe:breadcrumb&gt; &lt;br /&gt;  {| |- |Up to 19 additional tasks can execute concurrently with task m...&quot;</title>
		<link rel="alternate" type="text/html" href="http://www.robotc.net/w/index.php?title=ARDUINO_MEGA_Functions_Task_Control&amp;diff=2999&amp;oldid=prev"/>
				<updated>2012-05-09T21:24:01Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;&amp;lt;yambe:breadcrumb&amp;gt;ARDUINO_MEGA_Functions_and_Variables|Functions and Variables&amp;lt;/yambe:breadcrumb&amp;gt; &amp;lt;br /&amp;gt;  {| |- |Up to 19 additional tasks can execute concurrently with task m...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;yambe:breadcrumb&amp;gt;ARDUINO_MEGA_Functions_and_Variables|Functions and Variables&amp;lt;/yambe:breadcrumb&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
|Up to 19 additional tasks can execute concurrently with task main within a VEX Cortex user program (and up to 4 additional tasks within a VEX PIC user program). The ‘main’ or ‘primary’ task is automatically started when a user program is run. Execution of other tasks can be started and stopped with the &amp;lt;span class=&amp;quot;keywordBI&amp;quot;&amp;gt;StartTask&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;keywordBI&amp;quot;&amp;gt;StopTask&amp;lt;/span&amp;gt; functions. The VEX will share CPU execution time among various tasks by giving each task a “time slice” where it will execute a group of instructions.&lt;br /&gt;
 &lt;br /&gt;
Each task can be assigned a priority from 0 to 255. The VEX scheduler gives execution time to the highest priority task that is waiting to run. A round robin scheduling scheme is used when there are multiple tasks ready to run all with the highest priority. Lower priority tasks will not execute until there are no tasks of higher priority that are ready to run.&lt;br /&gt;
 &lt;br /&gt;
A task that is waiting for a time period to expire is not ready to run. Once the time period has expired it will again become ready to run. Waiting tasks do not consume any CPU cycles.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{tl|1|1}}&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== abortTimeslice ==&lt;br /&gt;
{| style=&amp;quot;color:black;&amp;quot; width=&amp;quot;100%&amp;quot; cellpadding=&amp;quot;5%&amp;quot; cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| class=&amp;quot;functionType&amp;quot;| &amp;lt;span class=&amp;quot;bigKeywordBI&amp;quot;&amp;gt;void &amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;bigKeywordB&amp;quot;&amp;gt;abortTimeslice&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;bigCodePunc&amp;quot;&amp;gt;()&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;font-family:Verdana, Geneva, sans-serif; color:black; background-color:#FFFFFF; text-align:left; font-size:100%;&amp;quot;|([[Data_Types#dataType_void|void]]) Immediately ends the current task time slice and allows another task to be immediately scheduled and executed. Tasks are given CPU execution time so that highest priority tasks get all the CPU time. If there are multiple tasks with the same highest priority then they are given &amp;quot;slices&amp;quot; of CPU time in a round robin fashion. This function will immediately end the current timeslice. &lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
  {|&lt;br /&gt;
  |-&lt;br /&gt;
  |&amp;lt;syntaxhighlight lang=&amp;quot;ROBOTC&amp;quot;&amp;gt;&lt;br /&gt;
abortTimeslice();  // aborts the current time slice of the task&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  |-&lt;br /&gt;
  |}&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== hogCPU ==&lt;br /&gt;
{| style=&amp;quot;color:black;&amp;quot; width=&amp;quot;100%&amp;quot; cellpadding=&amp;quot;5%&amp;quot; cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| class=&amp;quot;functionType&amp;quot;| &amp;lt;span class=&amp;quot;bigKeywordBI&amp;quot;&amp;gt;void &amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;bigKeywordB&amp;quot;&amp;gt;hogCPU&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;bigCodePunc&amp;quot;&amp;gt;()&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;font-family:Verdana, Geneva, sans-serif; color:black; background-color:#FFFFFF; text-align:left; font-size:100%;&amp;quot;|([[Data_Types#dataType_void|void]]) This special function is used to temporarily suspend the normal task scheduler and give all the CPU time to the current task. As long as this task can run, then it will get all of the CPU time until a &amp;lt;span class=&amp;quot;keywordB&amp;quot;&amp;gt;releaseCPU&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;codePunc&amp;quot;&amp;gt;()&amp;lt;/span&amp;gt; function call is made. You can execute the &amp;lt;span class=&amp;quot;keywordB&amp;quot;&amp;gt;hogCPU&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;codePunc&amp;quot;&amp;gt;()&amp;lt;/span&amp;gt; command inside of task main to hog the CPU away from ROBOTC's background driver task.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
  {|&lt;br /&gt;
  |-&lt;br /&gt;
  |&amp;lt;syntaxhighlight lang=&amp;quot;ROBOTC&amp;quot;&amp;gt;&lt;br /&gt;
hogCPU();  // suspend every other task and focus 100% on the current task&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  |-&lt;br /&gt;
  |}&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== kDefaultTaskPriority ==&lt;br /&gt;
{| style=&amp;quot;color:black;&amp;quot; width=&amp;quot;100%&amp;quot; cellpadding=&amp;quot;5%&amp;quot; cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| class=&amp;quot;variableType&amp;quot;| &amp;lt;span class=&amp;quot;bigKeywordBI&amp;quot;&amp;gt;const int &amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;bigKeywordB&amp;quot;&amp;gt;kDefaultTaskPriority&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;bigCodePunc&amp;quot;&amp;gt; = &amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;bigCodeStringsNums&amp;quot;&amp;gt;7&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;font-family:Verdana, Geneva, sans-serif; color:black; background-color:#FFFFFF; text-align:left; font-size:100%;&amp;quot;|([[Data_Types#dataType_int|int]]) Constant. The default priority assigned to a task. Equivalent to setting a priority of 7.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
  {|&lt;br /&gt;
  |-&lt;br /&gt;
  |&amp;lt;syntaxhighlight lang=&amp;quot;ROBOTC&amp;quot;&amp;gt;&lt;br /&gt;
int myPriority = 0;                 // creates a variable to hold the task priority value&lt;br /&gt;
myPriority = kDefaultTaskPriority;  // sets 'myPriority' to 7 (default)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  |-&lt;br /&gt;
  |}&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== kLowPriority ==&lt;br /&gt;
{| style=&amp;quot;color:black;&amp;quot; width=&amp;quot;100%&amp;quot; cellpadding=&amp;quot;5%&amp;quot; cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| class=&amp;quot;variableType&amp;quot;| &amp;lt;span class=&amp;quot;bigKeywordBI&amp;quot;&amp;gt;const int &amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;bigKeywordB&amp;quot;&amp;gt;kLowPriority&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;bigCodePunc&amp;quot;&amp;gt; = &amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;bigCodeStringsNums&amp;quot;&amp;gt;0&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;font-family:Verdana, Geneva, sans-serif; color:black; background-color:#FFFFFF; text-align:left; font-size:100%;&amp;quot;|([[Data_Types#dataType_int|int]]) Constant. Lowest priority that can be assigned to a task. Equivalent to setting a priority of 0.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
  {|&lt;br /&gt;
  |-&lt;br /&gt;
  |&amp;lt;syntaxhighlight lang=&amp;quot;ROBOTC&amp;quot;&amp;gt;&lt;br /&gt;
int myPriority = 0;                // creates a variable to hold the task priority value&lt;br /&gt;
nSchedulePriority = kLowPriority;  // assigns the Priority of the Task to the Lowest Priority&lt;br /&gt;
myPriority = nSchedulePriority;    // sets the current priority to a variable to view in the debugger&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  |-&lt;br /&gt;
  |}&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== kHighPriority ==&lt;br /&gt;
{| style=&amp;quot;color:black;&amp;quot; width=&amp;quot;100%&amp;quot; cellpadding=&amp;quot;5%&amp;quot; cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| class=&amp;quot;variableType&amp;quot;| &amp;lt;span class=&amp;quot;bigKeywordBI&amp;quot;&amp;gt;const int &amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;bigKeywordB&amp;quot;&amp;gt;kLowPriority&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;bigCodePunc&amp;quot;&amp;gt; = &amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;bigCodeStringsNums&amp;quot;&amp;gt;255&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;font-family:Verdana, Geneva, sans-serif; color:black; background-color:#FFFFFF; text-align:left; font-size:100%;&amp;quot;|([[Data_Types#dataType_int|int]]) Constant. Highest priority that can be assigned to a task. Equivalent to setting a priority of 255.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
  {|&lt;br /&gt;
  |-&lt;br /&gt;
  |&amp;lt;syntaxhighlight lang=&amp;quot;ROBOTC&amp;quot;&amp;gt;&lt;br /&gt;
int myPriority = 0;                 // creates a variable to hold the task priority value&lt;br /&gt;
nSchedulePriority = kHighPriority;  // assigns the Priority of the Task to the Highest Priority&lt;br /&gt;
myPriority = nSchedulePriority;     // sets the current priority to a variable to view in the debugger&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  |-&lt;br /&gt;
  |}&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== nSchedulePriority ==&lt;br /&gt;
{| style=&amp;quot;color:black;&amp;quot; width=&amp;quot;100%&amp;quot; cellpadding=&amp;quot;5%&amp;quot; cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| class=&amp;quot;variableType&amp;quot;| &amp;lt;span class=&amp;quot;bigKeywordBI&amp;quot;&amp;gt;word &amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;bigKeywordB&amp;quot;&amp;gt;nSchedulePriority&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;font-family:Verdana, Geneva, sans-serif; color:black; background-color:#FFFFFF; text-align:left; font-size:100%;&amp;quot;|([[Data_Types#dataType_word|word]]) The CPU scheduler priority for the current task. ROBOTC shares CPU execution time among various tasks by giving each task a “time slice” where it will execute a group of instructions. Each task can be assigned a priority from 0 to 255. The scheduler gives execution time to the highest priority task that is waiting to run. A round robin scheduling scheme is used when there are multiple tasks ready to run all with the highest priority. Lower priority tasks will not execute until there are no tasks of higher priority that are ready to run. By default, tasks are assigned a priority value of &amp;quot;7&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
  {|&lt;br /&gt;
  |-&lt;br /&gt;
  |&amp;lt;syntaxhighlight lang=&amp;quot;ROBOTC&amp;quot;&amp;gt;&lt;br /&gt;
nSchedulePriority = 100;  // assigns the current task with a priority of 100&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  |-&lt;br /&gt;
  |}&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== releaseCPU ==&lt;br /&gt;
{| style=&amp;quot;color:black;&amp;quot; width=&amp;quot;100%&amp;quot; cellpadding=&amp;quot;5%&amp;quot; cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| class=&amp;quot;functionType&amp;quot;| &amp;lt;span class=&amp;quot;bigKeywordBI&amp;quot;&amp;gt;void &amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;bigKeywordB&amp;quot;&amp;gt;releaseCPU&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;bigCodePunc&amp;quot;&amp;gt;()&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;font-family:Verdana, Geneva, sans-serif; color:black; background-color:#FFFFFF; text-align:left; font-size:100%;&amp;quot;|([[Data_Types#dataType_void|void]]) This special function is used to resume the normal task schedule. It cancels the effect of a previous &amp;lt;span class=&amp;quot;keywordB&amp;quot;&amp;gt;releaseCPU&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;codePunc&amp;quot;&amp;gt;()&amp;lt;/span&amp;gt; function call.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
  {|&lt;br /&gt;
  |-&lt;br /&gt;
  |&amp;lt;syntaxhighlight lang=&amp;quot;ROBOTC&amp;quot;&amp;gt;&lt;br /&gt;
releaseCPU();  // resume other tasks and return control to the task scheduler&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  |-&lt;br /&gt;
  |}&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== StartTask ==&lt;br /&gt;
{| style=&amp;quot;color:black;&amp;quot; width=&amp;quot;100%&amp;quot; cellpadding=&amp;quot;5%&amp;quot; cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| class=&amp;quot;functionType&amp;quot;| &amp;lt;span class=&amp;quot;bigKeywordBI&amp;quot;&amp;gt;void &amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;bigKeywordBI&amp;quot;&amp;gt;StartTask&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;bigCodePunc&amp;quot;&amp;gt;(&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;bigKeywordBI&amp;quot;&amp;gt;void &amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;bigCodeBasic&amp;quot;&amp;gt;TaskID&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;bigCodePunc&amp;quot;&amp;gt;, &amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;bigKeywordBI&amp;quot;&amp;gt;const short &amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;bigCodeBasic&amp;quot;&amp;gt;nTaskPriority&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;bigCodePunc&amp;quot;&amp;gt;)&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;font-family:Verdana, Geneva, sans-serif; color:black; background-color:#FFFFFF; text-align:left; font-size:100%;&amp;quot;|([[Data_Types#dataType_void|void]]) A functional call to start or restart the execution of a specific task. The &amp;lt;span class=&amp;quot;codeBasic&amp;quot;&amp;gt;nPriority&amp;lt;/span&amp;gt; command is optional, and can be used to assign a priority to a task at the time the task is told to start executing. If the &amp;lt;span class=&amp;quot;codeBasic&amp;quot;&amp;gt;nPriority&amp;lt;/span&amp;gt; command is not specified, the task will start with a default priority of &amp;quot;7&amp;quot;. &lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
  {| class=&amp;quot;parameterTable&amp;quot; cellpadding=&amp;quot;5%&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
  ! width=&amp;quot;20%&amp;quot; style=&amp;quot;border-style: solid; border-width: 0px 0px 1px 0px&amp;quot;|Parameter&lt;br /&gt;
  ! width=&amp;quot;60%&amp;quot; style=&amp;quot;border-style: solid; border-width: 0px 0px 1px 0px&amp;quot;|Explanation&lt;br /&gt;
  ! width=&amp;quot;20%&amp;quot; style=&amp;quot;border-style: solid; border-width: 0px 0px 1px 0px&amp;quot;|Data Type&lt;br /&gt;
  |-&lt;br /&gt;
  | style=&amp;quot;border-style: solid; border-width: 1px 0px 1px 0px&amp;quot;|''TaskID'' &lt;br /&gt;
  | style=&amp;quot;border-style: solid; border-width: 1px 0px 1px 0px&amp;quot;|The ID of the task to start.&lt;br /&gt;
  | style=&amp;quot;border-style: solid; border-width: 1px 0px 1px 0px&amp;quot;|[[Data_Types#dataType_void|void]]&lt;br /&gt;
  |-&lt;br /&gt;
  | style=&amp;quot;border-style: solid; border-width: 0px 0px 0px 0px&amp;quot;|''nTaskPriority'' &lt;br /&gt;
  | style=&amp;quot;border-style: solid; border-width: 0px 0px 0px 0px&amp;quot;|The priority to start the task with (optional).&lt;br /&gt;
  | style=&amp;quot;border-style: solid; border-width: 0px 0px 0px 0px&amp;quot;|[[Data_Types#dataType_short|short]]&lt;br /&gt;
  |-&lt;br /&gt;
  |}&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
  {|&lt;br /&gt;
  |-&lt;br /&gt;
  |&amp;lt;syntaxhighlight lang=&amp;quot;ROBOTC&amp;quot;&amp;gt;&lt;br /&gt;
StartTask(MoveArm, 10);  // starts the task named &amp;quot;MoveArm&amp;quot; with a priorty of 10&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  |-&lt;br /&gt;
  |}&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== StopAllTasks  ==&lt;br /&gt;
{| style=&amp;quot;color:black;&amp;quot; width=&amp;quot;100%&amp;quot; cellpadding=&amp;quot;5%&amp;quot; cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| class=&amp;quot;functionType&amp;quot;| &amp;lt;span class=&amp;quot;bigKeywordBI&amp;quot;&amp;gt;void &amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;bigKeywordB&amp;quot;&amp;gt;StopAllTasks&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;bigCodePunc&amp;quot;&amp;gt;()&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;font-family:Verdana, Geneva, sans-serif; color:black; background-color:#FFFFFF; text-align:left; font-size:100%;&amp;quot;|([[Data_Types#dataType_void|void]]) A function call to stop every task running, including the main program task. &lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
  {|&lt;br /&gt;
  |-&lt;br /&gt;
  |&amp;lt;syntaxhighlight lang=&amp;quot;ROBOTC&amp;quot;&amp;gt;&lt;br /&gt;
StopAllTasks();  // stops all tasks currently running and exits the current program&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  |-&lt;br /&gt;
  |}&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== StopTask ==&lt;br /&gt;
{| style=&amp;quot;color:black;&amp;quot; width=&amp;quot;100%&amp;quot; cellpadding=&amp;quot;5%&amp;quot; cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| class=&amp;quot;functionType&amp;quot;| &amp;lt;span class=&amp;quot;bigKeywordBI&amp;quot;&amp;gt;void &amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;bigKeywordBI&amp;quot;&amp;gt;StopTask&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;bigCodePunc&amp;quot;&amp;gt;(&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;bigKeywordBI&amp;quot;&amp;gt;void &amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;bigCodeBasic&amp;quot;&amp;gt;TaskID&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;bigCodePunc&amp;quot;&amp;gt;)&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;font-family:Verdana, Geneva, sans-serif; color:black; background-color:#FFFFFF; text-align:left; font-size:100%;&amp;quot;|([[Data_Types#dataType_void|void]]) A functional call to start or restart the execution of a specific task. The &amp;lt;span class=&amp;quot;codeBasic&amp;quot;&amp;gt;nPriority&amp;lt;/span&amp;gt; command is optional, and can be used to assign a priority to a task at the time the task is told to start executing. If the &amp;lt;span class=&amp;quot;codeBasic&amp;quot;&amp;gt;nPriority&amp;lt;/span&amp;gt; command is not specified, the task will start with a default priority of &amp;quot;7&amp;quot;. &lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
  {| class=&amp;quot;parameterTable&amp;quot; cellpadding=&amp;quot;5%&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
  ! width=&amp;quot;20%&amp;quot; style=&amp;quot;border-style: solid; border-width: 0px 0px 1px 0px&amp;quot;|Parameter&lt;br /&gt;
  ! width=&amp;quot;60%&amp;quot; style=&amp;quot;border-style: solid; border-width: 0px 0px 1px 0px&amp;quot;|Explanation&lt;br /&gt;
  ! width=&amp;quot;20%&amp;quot; style=&amp;quot;border-style: solid; border-width: 0px 0px 1px 0px&amp;quot;|Data Type&lt;br /&gt;
  |-&lt;br /&gt;
  | style=&amp;quot;border-style: solid; border-width: 1px 0px 0px 0px&amp;quot;|''TaskID'' &lt;br /&gt;
  | style=&amp;quot;border-style: solid; border-width: 1px 0px 0px 0px&amp;quot;|The ID of the task to stop.&lt;br /&gt;
  | style=&amp;quot;border-style: solid; border-width: 1px 0px 0px 0px&amp;quot;|[[Data_Types#dataType_void|void]]&lt;br /&gt;
  |-&lt;br /&gt;
  |}&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
  {|&lt;br /&gt;
  |-&lt;br /&gt;
  |&amp;lt;syntaxhighlight lang=&amp;quot;ROBOTC&amp;quot;&amp;gt;&lt;br /&gt;
StopTask(MoveArm);  // stops the task named &amp;quot;MoveArm&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  |-&lt;br /&gt;
  |}&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Tfriez</name></author>	</entry>

	</feed>