506 lines
		
	
	
		
			41 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			506 lines
		
	
	
		
			41 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 RTX: 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);
 | |
| </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>
 | |
| <link href="stylsheetf" rel="stylesheet" type="text/css" />
 | |
| </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 RTX
 | |
|     <span id="projectnumber">Version 4.80</span>
 | |
|    </div>
 | |
|    <div id="projectbrief">CMSIS-RTOS RTX: Real-Time Operating System for Cortex-M processor-based devices</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.2 -->
 | |
| <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 Page</span></a></li>
 | |
|       <li class="current"><a href="pages.html"><span>Usage and 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('_files.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"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark"> </span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark"> </span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark"> </span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark"> </span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark"> </span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark"> </span>Macros</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark"> </span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark"> </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="_files.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 "AS IS" </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 "<a class="code" href="cmsis__os_8h.html">cmsis_os.h</a>"</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">//-------- <<< Use Configuration Wizard in Context Menu >>> -----------------</span></div>
 | |
| <div class="line"><span class="comment">//</span></div>
 | |
| <div class="line"><span class="comment">// <h>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">//   <o>Number of concurrent running user threads <1-250></span></div>
 | |
| <div class="line"><span class="comment">//   <i> Defines max. number of user threads that will run at the same time.</span></div>
 | |
| <div class="line"><span class="comment">//   <i> 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">//   <o>Default Thread stack size [bytes] <64-4096:8><#/4></span></div>
 | |
| <div class="line"><span class="comment">//   <i> Defines default stack size for threads with osThreadDef stacksz = 0</span></div>
 | |
| <div class="line"><span class="comment">//   <i> 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">//   <o>Main Thread stack size [bytes] <64-32768:8><#/4></span></div>
 | |
| <div class="line"><span class="comment">//   <i> Defines stack size for main thread.</span></div>
 | |
| <div class="line"><span class="comment">//   <i> 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">//   <o>Number of threads with user-provided stack size <0-250></span></div>
 | |
| <div class="line"><span class="comment">//   <i> Defines the number of threads with user-provided stack size.</span></div>
 | |
| <div class="line"><span class="comment">//   <i> 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">//   <o>Total stack size [bytes] for threads with user-provided stack size <0-1048576:8><#/4></span></div>
 | |
| <div class="line"><span class="comment">//   <i> Defines the combined stack size for threads with user-provided stack size.</span></div>
 | |
| <div class="line"><span class="comment">//   <i> 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">//   <q>Stack overflow checking</span></div>
 | |
| <div class="line"><span class="comment">//   <i> Enable stack overflow checks at thread switch.</span></div>
 | |
| <div class="line"><span class="comment">//   <i> 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">//   <q>Stack usage watermark</span></div>
 | |
| <div class="line"><span class="comment">//   <i> 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">//   <i> 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">//   <o>Processor mode for thread execution </span></div>
 | |
| <div class="line"><span class="comment">//     <0=> Unprivileged mode </span></div>
 | |
| <div class="line"><span class="comment">//     <1=> Privileged mode</span></div>
 | |
| <div class="line"><span class="comment">//   <i> 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">// </h></span></div>
 | |
| <div class="line"> </div>
 | |
| <div class="line"><span class="comment">// <h>RTX Kernel Timer Tick Configuration</span></div>
 | |
| <div class="line"><span class="comment">// ======================================</span></div>
 | |
| <div class="line"><span class="comment">//   <q> Use Cortex-M SysTick timer as RTX Kernel Timer</span></div>
 | |
| <div class="line"><span class="comment">//   <i> Cortex-M processors provide in most cases a SysTick timer that can be used as </span></div>
 | |
| <div class="line"><span class="comment">//   <i> 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">//   <o>RTOS Kernel Timer input clock frequency [Hz] <1-1000000000></span></div>
 | |
| <div class="line"><span class="comment">//   <i> Defines the input frequency of the RTOS Kernel Timer.  </span></div>
 | |
| <div class="line"><span class="comment">//   <i> When the Cortex-M SysTick timer is used, the input clock </span></div>
 | |
| <div class="line"><span class="comment">//   <i> 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">//   <o>RTX Timer tick interval value [us] <1-1000000></span></div>
 | |
| <div class="line"><span class="comment">//   <i> The RTX Timer tick interval value is used to calculate timeout values.</span></div>
 | |
| <div class="line"><span class="comment">//   <i> When the Cortex-M SysTick timer is enabled, the value also configures the SysTick timer.</span></div>
 | |
| <div class="line"><span class="comment">//   <i> 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">// </h></span></div>
 | |
| <div class="line"> </div>
 | |
| <div class="line"><span class="comment">// <h>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">// <e>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">// <i> 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">//   <o>Round-Robin Timeout [ticks] <1-1000></span></div>
 | |
| <div class="line"><span class="comment">//   <i> Defines how long a thread will execute before a thread switch.</span></div>
 | |
| <div class="line"><span class="comment">//   <i> 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">// </e></span></div>
 | |
| <div class="line"> </div>
 | |
| <div class="line"><span class="comment">// <e>User Timers</span></div>
 | |
| <div class="line"><span class="comment">// ==============</span></div>
 | |
| <div class="line"><span class="comment">//   <i> 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">//   <o>Timer Thread Priority</span></div>
 | |
| <div class="line"><span class="comment">//                        <1=> Low</span></div>
 | |
| <div class="line"><span class="comment">//     <2=> Below Normal  <3=> Normal  <4=> Above Normal</span></div>
 | |
| <div class="line"><span class="comment">//                        <5=> High</span></div>
 | |
| <div class="line"><span class="comment">//                        <6=> Realtime (highest)</span></div>
 | |
| <div class="line"><span class="comment">//   <i> Defines priority for Timer Thread</span></div>
 | |
| <div class="line"><span class="comment">//   <i> 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">//   <o>Timer Thread stack size [bytes] <64-4096:8><#/4></span></div>
 | |
| <div class="line"><span class="comment">//   <i> Defines stack size for Timer thread.</span></div>
 | |
| <div class="line"><span class="comment">//   <i> 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">//   <o>Timer Callback Queue size <1-32></span></div>
 | |
| <div class="line"><span class="comment">//   <i> Number of concurrent active timer callback functions.</span></div>
 | |
| <div class="line"><span class="comment">//   <i> 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">// </e></span></div>
 | |
| <div class="line"> </div>
 | |
| <div class="line"><span class="comment">//   <o>ISR FIFO Queue size<4=>   4 entries  <8=>   8 entries</span></div>
 | |
| <div class="line"><span class="comment">//                         <12=> 12 entries  <16=> 16 entries</span></div>
 | |
| <div class="line"><span class="comment">//                         <24=> 24 entries  <32=> 32 entries</span></div>
 | |
| <div class="line"><span class="comment">//                         <48=> 48 entries  <64=> 64 entries</span></div>
 | |
| <div class="line"><span class="comment">//                         <96=> 96 entries</span></div>
 | |
| <div class="line"><span class="comment">//   <i> ISR functions store requests to this buffer,</span></div>
 | |
| <div class="line"><span class="comment">//   <i> when they are called from the interrupt handler.</span></div>
 | |
| <div class="line"><span class="comment">//   <i> 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">// </h></span></div>
 | |
| <div class="line"> </div>
 | |
| <div class="line"><span class="comment">//------------- <<< end of configuration section >>> -----------------------</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___r_t_x___global___functions.html#gafb4dc4d3dff8343a393726d2860282e4" title="The idle demon is running when no other thread is ready to run.">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___r_t_x___global___functions.html#ga145e7eafdd042bb522020cbb3b469d9c" title="Initializes an alternative hardware timer as RTX kernel timer.">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'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___r_t_x___global___functions.html#ga567543bf38239a91f09751686c23017b" title="Get alternative hardware timer's current value (0 .. OS_TRV)">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'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___r_t_x___global___functions.html#gad5deddec3fea0fb31798f571afc3c692" title="Get alternative hardware timer's overflow flag.">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___r_t_x___global___functions.html#ga85dab8408f27236c7341a69feb6258c7" title="Acknowledge alternative hardware timer interrupt.">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" title="Thread ID identifies the thread (pointer to a thread control block).">osThreadId</a> <a class="code" href="_r_t_x___conf___c_m_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___r_t_x___global___functions.html#ga651ae76b3acf45f80bf0e0487b51d6e6" title="Called when a runtime error is detected.">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="_r_t_x___conf___c_m_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="_r_t_x___conf___c_m_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="_r_t_x___conf___c_m_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="_r_t_x___conf___c_m_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 "RTX_CM_lib.h"</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="_overview.html">Overview</a></li>
 | |
|     <li class="footer">Generated on Tue Oct 27 2015 14:35:45 for CMSIS-RTOS RTX 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.2 
 | |
| 	-->
 | |
| 	</li>
 | |
|   </ul>
 | |
| </div>
 | |
| </body>
 | |
| </html>
 | 
