xmclib/CMSIS/Documentation/RTOS/html/dirstructfiles.html
2024-10-17 17:09:59 +02:00

505 lines
40 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Directory Structure and File Overview</title>
<title>CMSIS-RTOS: Directory Structure and File Overview</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="cmsis.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="printComponentTabs.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
$(document).ready(initResizable);
$(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 46px;">
<td id="projectlogo"><img alt="Logo" src="CMSIS_Logo_Final.png"/></td>
<td style="padding-left: 0.5em;">
<div id="projectname">CMSIS-RTOS
&#160;<span id="projectnumber">Version 1.03</span>
</div>
<div id="projectbrief">Real-Time Operating System: API and RTX Reference Implementation.</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<div id="CMSISnav" class="tabs1">
<ul class="tablist">
<script type="text/javascript">
<!--
writeComponentTabs.call(this);
//-->
</script>
</ul>
</div>
<!-- Generated by Doxygen 1.8.6 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li class="current"><a href="pages.html"><span>Usage&#160;and&#160;Description</span></a></li>
<li><a href="modules.html"><span>Reference</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('dirstructfiles.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Macros</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark">&#160;</span>Pages</a></div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="header">
<div class="headertitle">
<div class="title">Directory Structure and File Overview </div> </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p>The following section provides an overview of the directory structure and the files that are relevant for the user's for CMSIS-RTOS RTX.</p>
<h1><a class="anchor" id="Folders"></a>
CMSIS-RTOS RTX Directory Structure</h1>
<p>The CMSIS-RTOS RTX is delivered in source code and several examples are provided.</p>
<table class="cmtable" summary="CMSIS-RTOS RTX Library Files">
<tr>
<th>Directory </th><th>Content </th></tr>
<tr>
<td>INC </td><td>The include files for CMSIS-RTOS RTX. <a class="el" href="cmsis__os_8h.html">cmsis_os.h</a> is the central include file for user applications. </td></tr>
<tr>
<td>LIB </td><td>CMSIS-RTOS RTX library files for ARMCC, GCC, and IAR Compiler. </td></tr>
<tr>
<td>SRC </td><td>Source code of CMSIS-RTOS RTX library along with project files for ARMCC, GCC, and IAR Compiler. </td></tr>
<tr>
<td>Templates </td><td>CMSIS-RTOS RTX configuration file (<a class="el" href="dirstructfiles.html#RTX_Conf_CM">RTX_Conf_CM.c</a>). </td></tr>
<tr>
<td>UserCode Templates </td><td>Template files for creating application projects with CMSIS-RTOS RTX. </td></tr>
</table>
<h1><a class="anchor" id="libFiles"></a>
CMSIS-RTOS RTX Library Files</h1>
<p>The CMSIS-RTOS RTX Library is available pre-compiled for ARMCC, GCC, and IAR C/C++ Compilers and supports all Cortex-M processor variants in every configuration.</p>
<table class="cmtable" summary="CMSIS-RTOS RTX Library Files">
<tr>
<th>Library File </th><th>Processor Configuration </th></tr>
<tr>
<td>LIB/ARM/RTX_CM0.lib </td><td>CMSIS-RTOS RTX Library for ARMCC Compiler, Cortex-M0 and M1, little-endian. </td></tr>
<tr>
<td>LIB/ARM/RTX_CM0_B.lib </td><td>CMSIS-RTOS RTX Library for ARMCC Compiler, Cortex-M0 and M1, big-endian. </td></tr>
<tr>
<td>LIB/ARM/RTX_CM3.lib </td><td>CMSIS-RTOS RTX Library for ARMCC Compiler, Cortex-M3, M4, and M7 without FPU, little-endian. </td></tr>
<tr>
<td>LIB/ARM/RTX_CM3_B.lib </td><td>CMSIS-RTOS RTX Library for ARMCC Compiler, Cortex-M3, M4, and M7 without FPU, big-endian. </td></tr>
<tr>
<td>LIB/ARM/RTX_CM4.lib </td><td>CMSIS-RTOS RTX Library for ARMCC Compiler, Cortex-M4 and M7 with FPU, little-endian. </td></tr>
<tr>
<td>LIB/ARM/RTX_CM4_B.lib </td><td>CMSIS-RTOS RTX Library for ARMCC Compiler, Cortex-M4 and M7 with FPU, big-endian. </td></tr>
<tr>
<td>LIB/GCC/libRTX_CM0.a </td><td>CMSIS-RTOS RTX Library for GCC Compiler, Cortex-M0 and M1, little-endian. </td></tr>
<tr>
<td>LIB/GCC/libRTX_CM0_B.a </td><td>CMSIS-RTOS RTX Library for GCC Compiler, Cortex-M0 and M1, big-endian. </td></tr>
<tr>
<td>LIB/GCC/libRTX_CM3.a </td><td>CMSIS-RTOS RTX Library for GCC Compiler, Cortex-M3, M4, and M7 without FPU, little-endian. </td></tr>
<tr>
<td>LIB/GCC/libRTX_CM3_B.a </td><td>CMSIS-RTOS RTX Library for GCC Compiler, Cortex-M3, M4, and M7 without FPU, big-endian. </td></tr>
<tr>
<td>LIB/GCC/libRTX_CM4.a </td><td>CMSIS-RTOS RTX Library for GCC Compiler, Cortex-M4 and M7 with FPU, little-endian. </td></tr>
<tr>
<td>LIB/GCC/libRTX_CM4_B.a </td><td>CMSIS-RTOS RTX Library for GCC Compiler, Cortex-M4 and M7 with FPU, big-endian. </td></tr>
<tr>
<td>LIB/IAR/RTX_CM0.lib </td><td>CMSIS-RTOS RTX Library for IAR Compiler, Cortex-M0 and M1, little-endian. </td></tr>
<tr>
<td>LIB/IAR/RTX_CM0_B.lib </td><td>CMSIS-RTOS RTX Library for IAR Compiler, Cortex-M0 and M1, big-endian. </td></tr>
<tr>
<td>LIB/IAR/RTX_CM3.lib </td><td>CMSIS-RTOS RTX Library for IAR Compiler, Cortex-M3, M4, and M7 without FPU, little-endian. </td></tr>
<tr>
<td>LIB/IAR/RTX_CM3_B.lib </td><td>CMSIS-RTOS RTX Library for IAR Compiler, Cortex-M3, M4, and M7 without FPU, big-endian. </td></tr>
<tr>
<td>LIB/IAR/RTX_CM4.lib </td><td>CMSIS-RTOS RTX Library for IAR Compiler, Cortex-M4 and M7 with FPU, little-endian. </td></tr>
<tr>
<td>LIB/IAR/RTX_CM4_B.lib </td><td>CMSIS-RTOS RTX Library for IAR Compiler, Cortex-M4 and M7 with FPU, big-endian. </td></tr>
</table>
<h1><a class="anchor" id="RTX_Conf_CM"></a>
Configuration File RTX_Conf_CM.c</h1>
<div class="fragment"><div class="line"><span class="comment">/*----------------------------------------------------------------------------</span></div>
<div class="line"><span class="comment"> * CMSIS-RTOS - RTX</span></div>
<div class="line"><span class="comment"> *----------------------------------------------------------------------------</span></div>
<div class="line"><span class="comment"> * Name: RTX_Conf_CM.C</span></div>
<div class="line"><span class="comment"> * Purpose: Configuration of CMSIS RTX Kernel for Cortex-M</span></div>
<div class="line"><span class="comment"> * Rev.: V4.70.1</span></div>
<div class="line"><span class="comment"> *----------------------------------------------------------------------------</span></div>
<div class="line"><span class="comment"> *</span></div>
<div class="line"><span class="comment"> * Copyright (c) 1999-2009 KEIL, 2009-2015 ARM Germany GmbH</span></div>
<div class="line"><span class="comment"> * All rights reserved.</span></div>
<div class="line"><span class="comment"> * Redistribution and use in source and binary forms, with or without</span></div>
<div class="line"><span class="comment"> * modification, are permitted provided that the following conditions are met:</span></div>
<div class="line"><span class="comment"> * - Redistributions of source code must retain the above copyright</span></div>
<div class="line"><span class="comment"> * notice, this list of conditions and the following disclaimer.</span></div>
<div class="line"><span class="comment"> * - Redistributions in binary form must reproduce the above copyright</span></div>
<div class="line"><span class="comment"> * notice, this list of conditions and the following disclaimer in the</span></div>
<div class="line"><span class="comment"> * documentation and/or other materials provided with the distribution.</span></div>
<div class="line"><span class="comment"> * - Neither the name of ARM nor the names of its contributors may be used </span></div>
<div class="line"><span class="comment"> * to endorse or promote products derived from this software without </span></div>
<div class="line"><span class="comment"> * specific prior written permission.</span></div>
<div class="line"><span class="comment"> *</span></div>
<div class="line"><span class="comment"> * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &quot;AS IS&quot; </span></div>
<div class="line"><span class="comment"> * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE </span></div>
<div class="line"><span class="comment"> * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE</span></div>
<div class="line"><span class="comment"> * ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE</span></div>
<div class="line"><span class="comment"> * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR</span></div>
<div class="line"><span class="comment"> * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF </span></div>
<div class="line"><span class="comment"> * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS </span></div>
<div class="line"><span class="comment"> * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN </span></div>
<div class="line"><span class="comment"> * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) </span></div>
<div class="line"><span class="comment"> * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE</span></div>
<div class="line"><span class="comment"> * POSSIBILITY OF SUCH DAMAGE.</span></div>
<div class="line"><span class="comment"> *---------------------------------------------------------------------------*/</span></div>
<div class="line"> </div>
<div class="line"><span class="preprocessor">#include &quot;<a class="code" href="cmsis__os_8h.html">cmsis_os.h</a>&quot;</span></div>
<div class="line"> </div>
<div class="line"></div>
<div class="line"><span class="comment">/*----------------------------------------------------------------------------</span></div>
<div class="line"><span class="comment"> * RTX User configuration part BEGIN</span></div>
<div class="line"><span class="comment"> *---------------------------------------------------------------------------*/</span></div>
<div class="line"> </div>
<div class="line"><span class="comment">//-------- &lt;&lt;&lt; Use Configuration Wizard in Context Menu &gt;&gt;&gt; -----------------</span></div>
<div class="line"><span class="comment">//</span></div>
<div class="line"><span class="comment">// &lt;h&gt;Thread Configuration</span></div>
<div class="line"><span class="comment">// =======================</span></div>
<div class="line"><span class="comment">//</span></div>
<div class="line"><span class="comment">// &lt;o&gt;Number of concurrent running user threads &lt;1-250&gt;</span></div>
<div class="line"><span class="comment">// &lt;i&gt; Defines max. number of user threads that will run at the same time.</span></div>
<div class="line"><span class="comment">// &lt;i&gt; Default: 6</span></div>
<div class="line"><span class="preprocessor">#ifndef OS_TASKCNT</span></div>
<div class="line"><span class="preprocessor"></span><span class="preprocessor"> #define OS_TASKCNT 6</span></div>
<div class="line"><span class="preprocessor"></span><span class="preprocessor">#endif</span></div>
<div class="line"><span class="preprocessor"></span> </div>
<div class="line"><span class="comment">// &lt;o&gt;Default Thread stack size [bytes] &lt;64-4096:8&gt;&lt;#/4&gt;</span></div>
<div class="line"><span class="comment">// &lt;i&gt; Defines default stack size for threads with osThreadDef stacksz = 0</span></div>
<div class="line"><span class="comment">// &lt;i&gt; Default: 200</span></div>
<div class="line"><span class="preprocessor">#ifndef OS_STKSIZE</span></div>
<div class="line"><span class="preprocessor"></span><span class="preprocessor"> #define OS_STKSIZE 50 // this stack size value is in words</span></div>
<div class="line"><span class="preprocessor"></span><span class="preprocessor">#endif</span></div>
<div class="line"><span class="preprocessor"></span> </div>
<div class="line"><span class="comment">// &lt;o&gt;Main Thread stack size [bytes] &lt;64-32768:8&gt;&lt;#/4&gt;</span></div>
<div class="line"><span class="comment">// &lt;i&gt; Defines stack size for main thread.</span></div>
<div class="line"><span class="comment">// &lt;i&gt; Default: 200</span></div>
<div class="line"><span class="preprocessor">#ifndef OS_MAINSTKSIZE</span></div>
<div class="line"><span class="preprocessor"></span><span class="preprocessor"> #define OS_MAINSTKSIZE 50 // this stack size value is in words</span></div>
<div class="line"><span class="preprocessor"></span><span class="preprocessor">#endif</span></div>
<div class="line"><span class="preprocessor"></span> </div>
<div class="line"><span class="comment">// &lt;o&gt;Number of threads with user-provided stack size &lt;0-250&gt;</span></div>
<div class="line"><span class="comment">// &lt;i&gt; Defines the number of threads with user-provided stack size.</span></div>
<div class="line"><span class="comment">// &lt;i&gt; Default: 0</span></div>
<div class="line"><span class="preprocessor">#ifndef OS_PRIVCNT</span></div>
<div class="line"><span class="preprocessor"></span><span class="preprocessor"> #define OS_PRIVCNT 0</span></div>
<div class="line"><span class="preprocessor"></span><span class="preprocessor">#endif</span></div>
<div class="line"><span class="preprocessor"></span> </div>
<div class="line"><span class="comment">// &lt;o&gt;Total stack size [bytes] for threads with user-provided stack size &lt;0-1048576:8&gt;&lt;#/4&gt;</span></div>
<div class="line"><span class="comment">// &lt;i&gt; Defines the combined stack size for threads with user-provided stack size.</span></div>
<div class="line"><span class="comment">// &lt;i&gt; Default: 0</span></div>
<div class="line"><span class="preprocessor">#ifndef OS_PRIVSTKSIZE</span></div>
<div class="line"><span class="preprocessor"></span><span class="preprocessor"> #define OS_PRIVSTKSIZE 0 // this stack size value is in words</span></div>
<div class="line"><span class="preprocessor"></span><span class="preprocessor">#endif</span></div>
<div class="line"><span class="preprocessor"></span> </div>
<div class="line"><span class="comment">// &lt;q&gt;Stack overflow checking</span></div>
<div class="line"><span class="comment">// &lt;i&gt; Enable stack overflow checks at thread switch.</span></div>
<div class="line"><span class="comment">// &lt;i&gt; Enabling this option increases slightly the execution time of a thread switch.</span></div>
<div class="line"><span class="preprocessor">#ifndef OS_STKCHECK</span></div>
<div class="line"><span class="preprocessor"></span><span class="preprocessor"> #define OS_STKCHECK 1</span></div>
<div class="line"><span class="preprocessor"></span><span class="preprocessor">#endif</span></div>
<div class="line"><span class="preprocessor"></span> </div>
<div class="line"><span class="comment">// &lt;q&gt;Stack usage watermark</span></div>
<div class="line"><span class="comment">// &lt;i&gt; Initialize thread stack with watermark pattern for analyzing stack usage (current/maximum) in System and Thread Viewer.</span></div>
<div class="line"><span class="comment">// &lt;i&gt; Enabling this option increases significantly the execution time of osThreadCreate.</span></div>
<div class="line"><span class="preprocessor">#ifndef OS_STKINIT</span></div>
<div class="line"><span class="preprocessor"></span><span class="preprocessor">#define OS_STKINIT 0</span></div>
<div class="line"><span class="preprocessor"></span><span class="preprocessor">#endif</span></div>
<div class="line"><span class="preprocessor"></span> </div>
<div class="line"><span class="comment">// &lt;o&gt;Processor mode for thread execution </span></div>
<div class="line"><span class="comment">// &lt;0=&gt; Unprivileged mode </span></div>
<div class="line"><span class="comment">// &lt;1=&gt; Privileged mode</span></div>
<div class="line"><span class="comment">// &lt;i&gt; Default: Privileged mode</span></div>
<div class="line"><span class="preprocessor">#ifndef OS_RUNPRIV</span></div>
<div class="line"><span class="preprocessor"></span><span class="preprocessor"> #define OS_RUNPRIV 1</span></div>
<div class="line"><span class="preprocessor"></span><span class="preprocessor">#endif</span></div>
<div class="line"><span class="preprocessor"></span> </div>
<div class="line"><span class="comment">// &lt;/h&gt;</span></div>
<div class="line"> </div>
<div class="line"><span class="comment">// &lt;h&gt;RTX Kernel Timer Tick Configuration</span></div>
<div class="line"><span class="comment">// ======================================</span></div>
<div class="line"><span class="comment">// &lt;q&gt; Use Cortex-M SysTick timer as RTX Kernel Timer</span></div>
<div class="line"><span class="comment">// &lt;i&gt; Cortex-M processors provide in most cases a SysTick timer that can be used as </span></div>
<div class="line"><span class="comment">// &lt;i&gt; as time-base for RTX.</span></div>
<div class="line"><span class="preprocessor">#ifndef OS_SYSTICK</span></div>
<div class="line"><span class="preprocessor"></span><span class="preprocessor"> #define OS_SYSTICK 1</span></div>
<div class="line"><span class="preprocessor"></span><span class="preprocessor">#endif</span></div>
<div class="line"><span class="preprocessor"></span><span class="comment">//</span></div>
<div class="line"><span class="comment">// &lt;o&gt;RTOS Kernel Timer input clock frequency [Hz] &lt;1-1000000000&gt;</span></div>
<div class="line"><span class="comment">// &lt;i&gt; Defines the input frequency of the RTOS Kernel Timer. </span></div>
<div class="line"><span class="comment">// &lt;i&gt; When the Cortex-M SysTick timer is used, the input clock </span></div>
<div class="line"><span class="comment">// &lt;i&gt; is on most systems identical with the core clock.</span></div>
<div class="line"><span class="preprocessor">#ifndef OS_CLOCK</span></div>
<div class="line"><span class="preprocessor"></span><span class="preprocessor"> #define OS_CLOCK 12000000</span></div>
<div class="line"><span class="preprocessor"></span><span class="preprocessor">#endif</span></div>
<div class="line"><span class="preprocessor"></span> </div>
<div class="line"><span class="comment">// &lt;o&gt;RTX Timer tick interval value [us] &lt;1-1000000&gt;</span></div>
<div class="line"><span class="comment">// &lt;i&gt; The RTX Timer tick interval value is used to calculate timeout values.</span></div>
<div class="line"><span class="comment">// &lt;i&gt; When the Cortex-M SysTick timer is enabled, the value also configures the SysTick timer.</span></div>
<div class="line"><span class="comment">// &lt;i&gt; Default: 1000 (1ms)</span></div>
<div class="line"><span class="preprocessor">#ifndef OS_TICK</span></div>
<div class="line"><span class="preprocessor"></span><span class="preprocessor"> #define OS_TICK 1000</span></div>
<div class="line"><span class="preprocessor"></span><span class="preprocessor">#endif</span></div>
<div class="line"><span class="preprocessor"></span> </div>
<div class="line"><span class="comment">// &lt;/h&gt;</span></div>
<div class="line"> </div>
<div class="line"><span class="comment">// &lt;h&gt;System Configuration</span></div>
<div class="line"><span class="comment">// =======================</span></div>
<div class="line"><span class="comment">//</span></div>
<div class="line"><span class="comment">// &lt;e&gt;Round-Robin Thread switching</span></div>
<div class="line"><span class="comment">// ===============================</span></div>
<div class="line"><span class="comment">//</span></div>
<div class="line"><span class="comment">// &lt;i&gt; Enables Round-Robin Thread switching.</span></div>
<div class="line"><span class="preprocessor">#ifndef OS_ROBIN</span></div>
<div class="line"><span class="preprocessor"></span><span class="preprocessor"> #define OS_ROBIN 1</span></div>
<div class="line"><span class="preprocessor"></span><span class="preprocessor">#endif</span></div>
<div class="line"><span class="preprocessor"></span> </div>
<div class="line"><span class="comment">// &lt;o&gt;Round-Robin Timeout [ticks] &lt;1-1000&gt;</span></div>
<div class="line"><span class="comment">// &lt;i&gt; Defines how long a thread will execute before a thread switch.</span></div>
<div class="line"><span class="comment">// &lt;i&gt; Default: 5</span></div>
<div class="line"><span class="preprocessor">#ifndef OS_ROBINTOUT</span></div>
<div class="line"><span class="preprocessor"></span><span class="preprocessor"> #define OS_ROBINTOUT 5</span></div>
<div class="line"><span class="preprocessor"></span><span class="preprocessor">#endif</span></div>
<div class="line"><span class="preprocessor"></span> </div>
<div class="line"><span class="comment">// &lt;/e&gt;</span></div>
<div class="line"> </div>
<div class="line"><span class="comment">// &lt;e&gt;User Timers</span></div>
<div class="line"><span class="comment">// ==============</span></div>
<div class="line"><span class="comment">// &lt;i&gt; Enables user Timers</span></div>
<div class="line"><span class="preprocessor">#ifndef OS_TIMERS</span></div>
<div class="line"><span class="preprocessor"></span><span class="preprocessor"> #define OS_TIMERS 1</span></div>
<div class="line"><span class="preprocessor"></span><span class="preprocessor">#endif</span></div>
<div class="line"><span class="preprocessor"></span> </div>
<div class="line"><span class="comment">// &lt;o&gt;Timer Thread Priority</span></div>
<div class="line"><span class="comment">// &lt;1=&gt; Low</span></div>
<div class="line"><span class="comment">// &lt;2=&gt; Below Normal &lt;3=&gt; Normal &lt;4=&gt; Above Normal</span></div>
<div class="line"><span class="comment">// &lt;5=&gt; High</span></div>
<div class="line"><span class="comment">// &lt;6=&gt; Realtime (highest)</span></div>
<div class="line"><span class="comment">// &lt;i&gt; Defines priority for Timer Thread</span></div>
<div class="line"><span class="comment">// &lt;i&gt; Default: High</span></div>
<div class="line"><span class="preprocessor">#ifndef OS_TIMERPRIO</span></div>
<div class="line"><span class="preprocessor"></span><span class="preprocessor"> #define OS_TIMERPRIO 5</span></div>
<div class="line"><span class="preprocessor"></span><span class="preprocessor">#endif</span></div>
<div class="line"><span class="preprocessor"></span> </div>
<div class="line"><span class="comment">// &lt;o&gt;Timer Thread stack size [bytes] &lt;64-4096:8&gt;&lt;#/4&gt;</span></div>
<div class="line"><span class="comment">// &lt;i&gt; Defines stack size for Timer thread.</span></div>
<div class="line"><span class="comment">// &lt;i&gt; Default: 200</span></div>
<div class="line"><span class="preprocessor">#ifndef OS_TIMERSTKSZ</span></div>
<div class="line"><span class="preprocessor"></span><span class="preprocessor"> #define OS_TIMERSTKSZ 50 // this stack size value is in words</span></div>
<div class="line"><span class="preprocessor"></span><span class="preprocessor">#endif</span></div>
<div class="line"><span class="preprocessor"></span> </div>
<div class="line"><span class="comment">// &lt;o&gt;Timer Callback Queue size &lt;1-32&gt;</span></div>
<div class="line"><span class="comment">// &lt;i&gt; Number of concurrent active timer callback functions.</span></div>
<div class="line"><span class="comment">// &lt;i&gt; Default: 4</span></div>
<div class="line"><span class="preprocessor">#ifndef OS_TIMERCBQS</span></div>
<div class="line"><span class="preprocessor"></span><span class="preprocessor"> #define OS_TIMERCBQS 4</span></div>
<div class="line"><span class="preprocessor"></span><span class="preprocessor">#endif</span></div>
<div class="line"><span class="preprocessor"></span> </div>
<div class="line"><span class="comment">// &lt;/e&gt;</span></div>
<div class="line"> </div>
<div class="line"><span class="comment">// &lt;o&gt;ISR FIFO Queue size&lt;4=&gt; 4 entries &lt;8=&gt; 8 entries</span></div>
<div class="line"><span class="comment">// &lt;12=&gt; 12 entries &lt;16=&gt; 16 entries</span></div>
<div class="line"><span class="comment">// &lt;24=&gt; 24 entries &lt;32=&gt; 32 entries</span></div>
<div class="line"><span class="comment">// &lt;48=&gt; 48 entries &lt;64=&gt; 64 entries</span></div>
<div class="line"><span class="comment">// &lt;96=&gt; 96 entries</span></div>
<div class="line"><span class="comment">// &lt;i&gt; ISR functions store requests to this buffer,</span></div>
<div class="line"><span class="comment">// &lt;i&gt; when they are called from the interrupt handler.</span></div>
<div class="line"><span class="comment">// &lt;i&gt; Default: 16 entries</span></div>
<div class="line"><span class="preprocessor">#ifndef OS_FIFOSZ</span></div>
<div class="line"><span class="preprocessor"></span><span class="preprocessor"> #define OS_FIFOSZ 16</span></div>
<div class="line"><span class="preprocessor"></span><span class="preprocessor">#endif</span></div>
<div class="line"><span class="preprocessor"></span> </div>
<div class="line"><span class="comment">// &lt;/h&gt;</span></div>
<div class="line"> </div>
<div class="line"><span class="comment">//------------- &lt;&lt;&lt; end of configuration section &gt;&gt;&gt; -----------------------</span></div>
<div class="line"> </div>
<div class="line"><span class="comment">// Standard library system mutexes</span></div>
<div class="line"><span class="comment">// ===============================</span></div>
<div class="line"><span class="comment">// Define max. number system mutexes that are used to protect </span></div>
<div class="line"><span class="comment">// the arm standard runtime library. For microlib they are not used.</span></div>
<div class="line"><span class="preprocessor">#ifndef OS_MUTEXCNT</span></div>
<div class="line"><span class="preprocessor"></span><span class="preprocessor"> #define OS_MUTEXCNT 8</span></div>
<div class="line"><span class="preprocessor"></span><span class="preprocessor">#endif</span></div>
<div class="line"><span class="preprocessor"></span> </div>
<div class="line"><span class="comment">/*----------------------------------------------------------------------------</span></div>
<div class="line"><span class="comment"> * RTX User configuration part END</span></div>
<div class="line"><span class="comment"> *---------------------------------------------------------------------------*/</span></div>
<div class="line"> </div>
<div class="line"><span class="preprocessor">#define OS_TRV ((uint32_t)(((double)OS_CLOCK*(double)OS_TICK)/1E6)-1)</span></div>
<div class="line"><span class="preprocessor"></span> </div>
<div class="line"></div>
<div class="line"><span class="comment">/*----------------------------------------------------------------------------</span></div>
<div class="line"><span class="comment"> * Global Functions</span></div>
<div class="line"><span class="comment"> *---------------------------------------------------------------------------*/</span></div>
<div class="line"> </div>
<div class="line"><span class="comment">/*--------------------------- os_idle_demon ---------------------------------*/</span></div>
<div class="line"><span class="comment"></span></div>
<div class="line"><span class="comment">/// \brief The idle demon is running when no other thread is ready to run</span></div>
<div class="line"><span class="comment"></span><span class="keywordtype">void</span> <a class="code" href="group__RTX__Global__Functions.html#gafb4dc4d3dff8343a393726d2860282e4">os_idle_demon</a> (<span class="keywordtype">void</span>) {</div>
<div class="line"> </div>
<div class="line"> <span class="keywordflow">for</span> (;;) {</div>
<div class="line"> <span class="comment">/* HERE: include optional user code to be executed when no thread runs.*/</span></div>
<div class="line"> }</div>
<div class="line">}</div>
<div class="line"> </div>
<div class="line"><span class="preprocessor">#if (OS_SYSTICK == 0) // Functions for alternative timer as RTX kernel timer</span></div>
<div class="line"><span class="preprocessor"></span> </div>
<div class="line"><span class="comment">/*--------------------------- os_tick_init ----------------------------------*/</span></div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// \brief Initializes an alternative hardware timer as RTX kernel timer</span></div>
<div class="line"><span class="comment">/// \return IRQ number of the alternative hardware timer</span></div>
<div class="line"><span class="comment"></span><span class="keywordtype">int</span> <a class="code" href="group__RTX__Global__Functions.html#ga145e7eafdd042bb522020cbb3b469d9c">os_tick_init</a> (<span class="keywordtype">void</span>) {</div>
<div class="line"> <span class="keywordflow">return</span> (-1); <span class="comment">/* Return IRQ number of timer (0..239) */</span></div>
<div class="line">}</div>
<div class="line"> </div>
<div class="line"><span class="comment">/*--------------------------- os_tick_val -----------------------------------*/</span></div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// \brief Get alternative hardware timer&#39;s current value (0 .. OS_TRV)</span></div>
<div class="line"><span class="comment">/// \return Current value of the alternative hardware timer</span></div>
<div class="line"><span class="comment"></span>uint32_t <a class="code" href="group__RTX__Global__Functions.html#ga567543bf38239a91f09751686c23017b">os_tick_val</a> (<span class="keywordtype">void</span>) {</div>
<div class="line"> <span class="keywordflow">return</span> (0);</div>
<div class="line">}</div>
<div class="line"> </div>
<div class="line"><span class="comment">/*--------------------------- os_tick_ovf -----------------------------------*/</span></div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// \brief Get alternative hardware timer&#39;s overflow flag</span></div>
<div class="line"><span class="comment">/// \return Overflow flag\n</span></div>
<div class="line"><span class="comment">/// - 1 : overflow</span></div>
<div class="line"><span class="comment">/// - 0 : no overflow</span></div>
<div class="line"><span class="comment"></span>uint32_t <a class="code" href="group__RTX__Global__Functions.html#gad5deddec3fea0fb31798f571afc3c692">os_tick_ovf</a> (<span class="keywordtype">void</span>) {</div>
<div class="line"> <span class="keywordflow">return</span> (0);</div>
<div class="line">}</div>
<div class="line"> </div>
<div class="line"><span class="comment">/*--------------------------- os_tick_irqack --------------------------------*/</span></div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// \brief Acknowledge alternative hardware timer interrupt</span></div>
<div class="line"><span class="comment"></span><span class="keywordtype">void</span> <a class="code" href="group__RTX__Global__Functions.html#ga85dab8408f27236c7341a69feb6258c7">os_tick_irqack</a> (<span class="keywordtype">void</span>) {</div>
<div class="line"> <span class="comment">/* ... */</span></div>
<div class="line">}</div>
<div class="line"> </div>
<div class="line"><span class="preprocessor">#endif // (OS_SYSTICK == 0)</span></div>
<div class="line"><span class="preprocessor"></span> </div>
<div class="line"><span class="comment">/*--------------------------- os_error --------------------------------------*/</span></div>
<div class="line"> </div>
<div class="line"><span class="comment">/* OS Error Codes */</span></div>
<div class="line"><span class="preprocessor">#define OS_ERROR_STACK_OVF 1</span></div>
<div class="line"><span class="preprocessor"></span><span class="preprocessor">#define OS_ERROR_FIFO_OVF 2</span></div>
<div class="line"><span class="preprocessor"></span><span class="preprocessor">#define OS_ERROR_MBX_OVF 3</span></div>
<div class="line"><span class="preprocessor"></span><span class="preprocessor">#define OS_ERROR_TIMER_OVF 4</span></div>
<div class="line"><span class="preprocessor"></span> </div>
<div class="line"><span class="keyword">extern</span> <a class="code" href="cmsis__os_8h.html#adfeb153a84a81309e2d958268197617f">osThreadId</a> <a class="code" href="RTX__Conf__CM_8c.html#a395cca131b7746fc43c104a3485b77f7">svcThreadGetId</a> (<span class="keywordtype">void</span>);</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// \brief Called when a runtime error is detected</span></div>
<div class="line"><span class="comment">/// \param[in] error_code actual error code that has been detected</span></div>
<div class="line"><span class="comment"></span><span class="keywordtype">void</span> <a class="code" href="group__RTX__Global__Functions.html#ga651ae76b3acf45f80bf0e0487b51d6e6">os_error</a> (uint32_t error_code) {</div>
<div class="line"> </div>
<div class="line"> <span class="comment">/* HERE: include optional code to be executed on runtime error. */</span></div>
<div class="line"> <span class="keywordflow">switch</span> (error_code) {</div>
<div class="line"> <span class="keywordflow">case</span> <a class="code" href="RTX__Conf__CM_8c.html#abf8311a7a239ec56c6d725f926ba766d">OS_ERROR_STACK_OVF</a>:</div>
<div class="line"> <span class="comment">/* Stack overflow detected for the currently running task. */</span></div>
<div class="line"> <span class="comment">/* Thread can be identified by calling svcThreadGetId(). */</span></div>
<div class="line"> <span class="keywordflow">break</span>;</div>
<div class="line"> <span class="keywordflow">case</span> <a class="code" href="RTX__Conf__CM_8c.html#a075d54df14c85a6afe32b7f5c99c9c29">OS_ERROR_FIFO_OVF</a>:</div>
<div class="line"> <span class="comment">/* ISR FIFO Queue buffer overflow detected. */</span></div>
<div class="line"> <span class="keywordflow">break</span>;</div>
<div class="line"> <span class="keywordflow">case</span> <a class="code" href="RTX__Conf__CM_8c.html#ab715d7d66c341c067ef0a97b55db8a10">OS_ERROR_MBX_OVF</a>:</div>
<div class="line"> <span class="comment">/* Mailbox overflow detected. */</span></div>
<div class="line"> <span class="keywordflow">break</span>;</div>
<div class="line"> <span class="keywordflow">case</span> <a class="code" href="RTX__Conf__CM_8c.html#a79d7e388d951f11bd0dabd13f722cea8">OS_ERROR_TIMER_OVF</a>:</div>
<div class="line"> <span class="comment">/* User Timer Callback Queue overflow detected. */</span></div>
<div class="line"> <span class="keywordflow">break</span>;</div>
<div class="line"> <span class="keywordflow">default</span>:</div>
<div class="line"> <span class="keywordflow">break</span>;</div>
<div class="line"> }</div>
<div class="line"> <span class="keywordflow">for</span> (;;);</div>
<div class="line">}</div>
<div class="line"> </div>
<div class="line"></div>
<div class="line"><span class="comment">/*----------------------------------------------------------------------------</span></div>
<div class="line"><span class="comment"> * RTX Configuration Functions</span></div>
<div class="line"><span class="comment"> *---------------------------------------------------------------------------*/</span></div>
<div class="line"> </div>
<div class="line"><span class="preprocessor">#include &quot;RTX_CM_lib.h&quot;</span></div>
<div class="line"> </div>
<div class="line"><span class="comment">/*----------------------------------------------------------------------------</span></div>
<div class="line"><span class="comment"> * end of file</span></div>
<div class="line"><span class="comment"> *---------------------------------------------------------------------------*/</span></div>
</div><!-- fragment --> </div></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="index.html">index</a></li><li class="navelem"><a class="el" href="rtxImplementation.html">RTX Implementation</a></li>
<li class="footer">Generated on Wed Feb 8 2017 10:21:02 for CMSIS-RTOS by ARM Ltd. All rights reserved.
<!--
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.6
-->
</li>
</ul>
</div>
</body>
</html>