You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by ad...@apache.org on 2016/02/26 18:53:50 UTC
[1/2] incubator-mynewt-site git commit: MYNEWT-146: add task
documentation to core os manual - pull request#9 closed
Repository: incubator-mynewt-site
Updated Branches:
refs/heads/asf-site 274381469 -> 3c01204d2
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/3c01204d/os/core_os/task/os_task_next_id/index.html
----------------------------------------------------------------------
diff --git a/os/core_os/task/os_task_next_id/index.html b/os/core_os/task/os_task_next_id/index.html
deleted file mode 100644
index 87f30ce..0000000
--- a/os/core_os/task/os_task_next_id/index.html
+++ /dev/null
@@ -1,565 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
- <head>
- <meta charset="utf-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
-
-
- <link rel="canonical" href="http://mynewt.apache.org/os/core_os/task/os_task_next_id/">
- <link rel="shortcut icon" href="../../../../img/favicon.ico">
-
- <title>os_task_next_id - Apache Mynewt</title>
-
- <link href="../../../../css/bootstrap-3.0.3.min.css" rel="stylesheet">
- <link href="../../../../css/font-awesome-4.0.3.css" rel="stylesheet">
- <link rel="stylesheet" href="../../../../css/highlight.css">
- <link href="../../../../css/base.css" rel="stylesheet">
- <link href="../../../../css/custom.css" rel="stylesheet">
- <link href='https://fonts.googleapis.com/css?family=Roboto:400,500,700,900,300,100' rel='stylesheet' type='text/css'>
- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
- <link href="../../../../extra.css" rel="stylesheet">
-
- <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
- <!--[if lt IE 9]>
- <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
- <script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
- <![endif]-->
-
-
- <script>
- (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
- (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
- m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
- })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
-
- ga('create', 'UA-72162311-1', 'mynewt.incubator.apache.org');
- ga('send', 'pageview');
- </script>
-
- </head>
-
-
- <body class="os_task_next_id">
-
-
- <div class="navbar navbar-default navbar-fixed-top" role="navigation">
- <div class="logo-container">
- <img src="/img/logo.svg">
- </div>
- <div class="container-fluid">
- <!-- Collapsed navigation -->
- <div class="navbar-header">
- <!-- Expander button -->
- <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
- <span class="sr-only">Toggle navigation</span>
- <span class="icon-bar"></span>
- <span class="icon-bar"></span>
- <span class="icon-bar"></span>
- </button>
-
- </div>
-
- <!-- Expanded navigation -->
- <div class="navbar-collapse collapse">
- <!-- Main navigation -->
- <ul class="nav navbar-nav navbar-right">
- <li>
- <a href="/">Home</a>
- </li>
- <li>
- <a href="/documentation/">Docs</a>
- </li>
- <li>
- <a href="/download/">Download</a>
- </li>
- <li>
- <a href="/community/">Community</a>
- </li>
- <li>
- <a href="/events/">Events</a>
- </li>
- </ul>
-
- <!-- Search, Navigation and Repo links -->
- <ul class="nav navbar-nav navbar-right">
-
- </ul>
- </div>
- </div>
-</div>
-
- <div class="container-fluid">
-
- <div class="row sm-extra-padding">
- <div class="col-md-3 bg-grey sidebar-container"><div class="bs-sidebar hidden-print" role="complementary">
- <div class="sidebar-top">
- <img class="hidden-xs hidden-sm logo-small" src="/img/logo.svg" alt="MyNewt" title="MyNewt">
- <div class="small" role="search">
- <form id ="rtd-search-form" class="wy-form" action="../../../../search.html" method="get">
- <div class="form-group">
- <input type="text" name="q" placeholder="Search documentation" />
- <button class="search-button" type="submit"><i class="fa fa-search"></i></button>
- </div>
- </form>
- </div>
- </div>
- <ul class="nav bs-sidenav">
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- <li><a href="
- ../../../get_started/introduction/
-">Apache Mynewt Manual</a>
-
- <ul class="current-toc">
-
-
-
- <li>
- <a href="../../../get_started/introduction/">Introduction</a>
- </li>
-
-
-
-
-
- <li><a href="
- ../../../get_started/project1/
-">Get Started</a>
-
- </li>
-
-
-
-
- <li><a href="
- ../../../get_acclimated/project2/
-">Tutorials</a>
-
- </li>
-
-
-
-
- <li><a href="
-
-
-
-
- ../../mynewt_os/
-
-
-">Manual</a>
-
- <ul class="current-toc">
-
-
-
- <li><a href="
-
-
- ../../mynewt_os/
-
-">OS Core</a>
-
- <ul class="current-toc">
-
-
-
- <li><a href="
- ../../mynewt_os/
-">OS Fundamentals</a>
-
- </li>
-
-
-
-
- <li><a href="
- ../../context_switch/context_switch/
-">Scheduler</a>
-
- </li>
-
-
-
-
- <li><a href="
- ../../time/time/
-">Time</a>
-
- </li>
-
-
-
-
- <li><a href="
- ../task/
-">Tasks</a>
-
- <ul class="current-toc">
-
-
-
- <li>
- <a href="../task/">Overview</a>
- </li>
-
-
-
-
-
- <li><a href="
- ../_clear_stack/
-">Functions</a>
-
- <ul class="current-toc">
-
-
-
- <li>
- <a href="../_clear_stack/">_clear_stack</a>
- </li>
-
-
-
-
-
- <li>
- <a href="../os_task_count/">os_task_count</a>
- </li>
-
-
-
-
-
- <li>
- <a href="../os_task_info_get_next/">os_task_info_get_next</a>
- </li>
-
-
-
-
-
- <li>
- <a href="../os_task_init/">os_task_init</a>
- </li>
-
-
-
-
-
- <li class="active">
- os_task_next_id
- </li>
-
-
-
-
-
- <li>
- <a href="../os_task_sanity_checkin/">os_task_sanity_checkin</a>
- </li>
-
-
-
- </ul>
-
- </li>
-
-
- </ul>
-
- </li>
-
-
-
-
- <li><a href="
- ../../event_queue/event_queue/
-">Event Queues</a>
-
- </li>
-
-
-
-
- <li><a href="
- ../../semaphore/semaphore/
-">Semaphores</a>
-
- </li>
-
-
-
-
- <li><a href="
- ../../mutex/mutex/
-">Mutexes</a>
-
- </li>
-
-
-
-
- <li><a href="
- ../../memory_pool/memory_pool/
-">Memory Pools</a>
-
- </li>
-
-
-
-
- <li><a href="
- ../../heap/heap/
-">Heap</a>
-
- </li>
-
-
-
-
- <li><a href="
- ../../mbuf/mbuf/
-">Mbufs</a>
-
- </li>
-
-
-
-
- <li><a href="
- ../../sanity/sanity/
-">Sanity</a>
-
- </li>
-
-
-
-
- <li><a href="
- ../../callout/callout/
-">Callouts</a>
-
- </li>
-
-
-
-
- <li>
- <a href="../../port_os/">Porting to other Platforms</a>
- </li>
-
-
-
- </ul>
-
- </li>
-
-
-
-
- <li><a href="
- ../../../modules/console/console/
-">Console</a>
-
- </li>
-
-
-
-
- <li><a href="
- ../../../modules/shell/shell/
-">Shell</a>
-
- </li>
-
-
-
-
- <li><a href="
- ../../../modules/bootloader/bootloader/
-">Bootloader</a>
-
- </li>
-
-
-
-
- <li>
- <a href="../../../modules/filesystem/">File System Abstraction</a>
- </li>
-
-
-
-
-
- <li>
- <a href="../../../modules/nffs/">Newtron Flash File System</a>
- </li>
-
-
-
-
-
- <li><a href="
- ../../../modules/testutil/testutil/
-">Test Utilities</a>
-
- </li>
-
-
-
-
- <li><a href="
- ../../../modules/imgmgr/imgmgr/
-">Image Manager</a>
-
- </li>
-
-
-
-
- <li>
- <a href="../../../modules/baselibc/">Baselibc library</a>
- </li>
-
-
-
-
-
- <li><a href="
- ../../../modules/elua/elua/
-">Embedded Lua</a>
-
- </li>
-
-
-
-
- <li><a href="
- ../../../modules/json/json/
-">JSON</a>
-
- </li>
-
-
- </ul>
-
- </li>
-
-
- </ul>
-
- </li>
-
-
-
-
-
-
- <li><a href="
- ../../../../newt/newt_intro/
-">Newt Tool Manual</a>
-
- </li>
-
-
-
-
-
-
- <li><a href="
- ../../../../newtmgr/overview/
-">Newt Manager Manual</a>
-
- </li>
-
-
-
- </ul>
-</div></div>
-
- <div class="show-sidebar-container">
- <button class="show-sidebar">Docs Menu</button>
- </div>
-
- <div class="col-md-9 documentation-viewer" role="main">
- <div role="navigation" aria-label="breadcrumbs navigation">
- <ul class="wy-breadcrumbs">
- <li><a href="../../../..">Docs</a> »</li>
-
-
-
- <li>Tasks »</li>
-
-
-
- <li>Functions »</li>
-
-
-
- <li>os_task_next_id</li>
- <li class="wy-breadcrumbs-aside">
-
- </li>
- </ul>
- <hr/>
-</div>
-
-
-
- </div>
- </div>
-
- <div class="row">
- <footer>
- <div class="row">
- <div class="col-md-12">
-
- <p class="copyright">Copyright © 2015 The Apache Software Foundation, Licensed under the Apache License, Version 2.0 Apache and the Apache feather logo are trademarks of The Apache Software Foundation.<br>The Apache Software Foundation Apache Incubator</p>
-
- </div>
- </div>
- <div class="copyright-logos">
- <div class="row">
- <div class="col-xs-6 text-right">
- <img src="/img/apache-feather.png" alt="Apache" title="Apache">
- </div>
- <div class="col-xs-6 text-left">
- <img src="/img/apache-logo.png" alt="Apache Incubator" title="Apache Incubator">
- </div>
- </div>
- </div>
- <div class="row">
- <div class="col-md-12">
- <small class="footnote">
- MyNewt is an effort undergoing incubation at The Apache Software Foundation (ASF), sponsored by the Apache Incubator. Incubation is required of all newly accepted projects until a further review indicates that the infrastructure, communications, and decision making process have stabilized in a manner consistent with other successful ASF projects. While incubation status is not necessarily a reflection of the completeness or stability of the code, it does indicate that the project has yet to be fully endorsed by the ASF.
- </small>
- </div>
- </div>
-</footer>
- </div>
- </div>
-
- <script src="../../../../js/jquery-1.10.2.min.js"></script>
- <script src="../../../../js/bootstrap-3.0.3.min.js"></script>
- <script src="../../../../js/highlight.pack.js"></script>
- <script src="../../../../js/base.js"></script>
- <script src="../../../../js/custom.js"></script>
-
- </body>
-</html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/3c01204d/os/core_os/task/os_task_sanity_checkin/index.html
----------------------------------------------------------------------
diff --git a/os/core_os/task/os_task_sanity_checkin/index.html b/os/core_os/task/os_task_sanity_checkin/index.html
index 7dc37e5..c17ccfb 100644
--- a/os/core_os/task/os_task_sanity_checkin/index.html
+++ b/os/core_os/task/os_task_sanity_checkin/index.html
@@ -222,7 +222,7 @@
<li><a href="
- ../_clear_stack/
+ ../os_task_count/
">Functions</a>
<ul class="current-toc">
@@ -230,14 +230,6 @@
<li>
- <a href="../_clear_stack/">_clear_stack</a>
- </li>
-
-
-
-
-
- <li>
<a href="../os_task_count/">os_task_count</a>
</li>
@@ -261,14 +253,6 @@
- <li>
- <a href="../os_task_next_id/">os_task_next_id</a>
- </li>
-
-
-
-
-
<li class="active">
os_task_sanity_checkin
</li>
@@ -520,7 +504,42 @@
<hr/>
</div>
-
+ <h2 id="os_task_sanity_checkin"><font color="F2853F" style="font-size:24pt"> os_task_sanity_checkin</font><a class="headerlink" href="#os_task_sanity_checkin" title="Permanent link">¶</a></h2>
+<pre><code class="no-highlight">int os_task_sanity_checkin(struct os_task *t)
+</code></pre>
+
+<p>Used by a task to check in to the sanity task. This informs the sanity task that
+<em>task</em> is still alive and working normally.</p>
+<p><br></p>
+<h4 id="arguments">Arguments<a class="headerlink" href="#arguments" title="Permanent link">¶</a></h4>
+<table>
+<thead>
+<tr>
+<th>Arguments</th>
+<th>Description</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td>t</td>
+<td>Pointer to task</td>
+</tr>
+</tbody>
+</table>
+<p><br></p>
+<h4 id="returned-values">Returned values<a class="headerlink" href="#returned-values" title="Permanent link">¶</a></h4>
+<p>OS_OK: sanity check-in successful</p>
+<p>All other error codes indicate an error.</p>
+<p><br></p>
+<h4 id="example">Example<a class="headerlink" href="#example" title="Permanent link">¶</a></h4>
+<pre><code class="no-highlight"> int rc;
+
+ rc = os_task_sanity_checkin(&my_task);
+ assert(rc == OS_OK);
+
+</code></pre>
+
+<hr />
</div>
</div>
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/3c01204d/os/core_os/task/task/index.html
----------------------------------------------------------------------
diff --git a/os/core_os/task/task/index.html b/os/core_os/task/task/index.html
index fce9ad7..1f79b37 100644
--- a/os/core_os/task/task/index.html
+++ b/os/core_os/task/task/index.html
@@ -222,7 +222,7 @@
<li><a href="
- ../_clear_stack/
+ ../os_task_count/
">Functions</a>
</li>
@@ -469,19 +469,316 @@
</div>
<h1 id="task">Task<a class="headerlink" href="#task" title="Permanent link">¶</a></h1>
-<p>Insert synopsis here</p>
+<p>A task, along with the scheduler, forms the basis of the Mynewt OS. A task
+consists of two basic elements: a task stack and a task function. The task
+function is basically a forever loop, waiting for some "event" to wake it up.
+There are two methods used to signal a task that it has work to do: event queues
+and semaphores (see the appropriate manual sections for descriptions of these
+features).</p>
+<p>The Mynewt OS is a multi-tasking, preemptive OS. Every task is assigned a task
+priority (from 0 to 255), with 0 being the highest priority task. If a higher
+priority task than the current task wants to run, the scheduler preempts the
+currently running task and switches context to the higher priority task. This is
+just a fancy way of saying that the processor stack pointer now points to the
+stack of the higher priority task and the task resumes execution where it left
+off.</p>
+<p>Tasks run to completion unless they are preempted by a higher priority task. The
+developer must insure that tasks eventually "sleep"; otherwise lower priority
+tasks will never get a chance to run (actually, any task lower in priority than
+the task that never sleeps). A task will be put to sleep in the following cases:
+it puts itself to sleep using <code>os_time_delay()</code>, it waits on an event queue
+which is empty or attempts to obtain a mutex or a semaphore that is currently
+owned by another task.</p>
+<p>Note that other sections of the manual describe these OS features in more
+detail.</p>
<h2 id="description">Description<a class="headerlink" href="#description" title="Permanent link">¶</a></h2>
-<p>Describe OS feature here </p>
+<p>In order to create a task two data structures need to be defined: the task
+object (struct os_task) and its associated stack. Determining the stack size can
+be a bit tricky; generally developers should not declare large local variables
+on the stack so that task stacks can be of limited size. However, all
+applications are different and the developer must choose the stack size
+accordingly. NOTE: be careful when declaring your stack! The stack is in units
+of <code>os_stack_t</code> sized elements (generally 32-bits). Looking at the example given
+below and assuming <code>os_stack_t</code> is defined to be a 32-bit unsigned value,
+"my_task_stack" will use 256 bytes. </p>
+<p>A task must also have an associated "task function". This is the function that
+will be called when the task is first run. This task function should never
+return!</p>
+<p>In order to inform the Mynewt OS of the new task and to have it added to the
+scheduler, the <code>os_task_init()</code> function is called. Once <code>os_task_init()</code> is
+called, the task is made ready to run and is added to the active task list. Note
+that a task can be initialized (started) before or after the os has started
+(i.e. before <code>os_start()</code> is called) but must be initialized after the os has
+been initialized (i.e. 'os_init' has been called). In most of the examples and
+current Mynewt projects, the os is initialized, tasks are initialized, and the
+the os is started. Once the os has started, the highest priority task will be
+the first task set to run.</p>
+<p>Information about a task can be obtained using the <code>os_task_info_get_next()</code>
+API. Developers can walk the list of tasks to obtain information on all created
+tasks. This information is of type <code>os_task_info</code> and is described below.</p>
+<p>The following is a very simple example showing a single application task. This
+task simply toggles an LED at a one second interval.</p>
+<pre><code class="no-highlight">/* Create a simple "project" with a task that blinks a LED every second */
+
+/* Define task stack and task object */
+#define MY_TASK_PRI (OS_TASK_PRI_HIGHEST)
+#define MY_STACK_SIZE (64)
+struct os_task my_task;
+os_stack_t my_task_stack[MY_STACK_SIZE];
+
+/* This is the task function */
+void my_task_func(void *arg) {
+ /* Set the led pin as an output */
+ hal_gpio_init_out(LED_BLINK_PIN, 1);
+
+ /* The task is a forever loop that does not return */
+ while (1) {
+ /* Wait one second */
+ os_time_delay(1000);
+
+ /* Toggle the LED */
+ hal_gpio_toggle(LED_BLINK_PIN);
+ }
+}
+
+/* This is the main function for the project */
+int main(void) {
+ int rc;
+
+ /* Initialize OS */
+ os_init();
+
+ /* Initialize the task */
+ os_task_init(&my_task, "my_task", my_task_func, NULL, MY_TASK_PRIO,
+ OS_WAIT_FOREVER, my_task_stack, MY_STACK_SIZE);
+
+ /* Start the OS */
+ os_start();
+
+ /* os start should never return. If it does, this should be an error */
+ assert(0);
+
+ return rc;
+}
+</code></pre>
+
<h2 id="data-structures">Data structures<a class="headerlink" href="#data-structures" title="Permanent link">¶</a></h2>
-<p>Replace this with the list of data structures used, why, any neat features</p>
+<pre><code class="no-highlight">/* The highest and lowest task priorities */
+#define OS_TASK_PRI_HIGHEST (0)
+#define OS_TASK_PRI_LOWEST (0xff)
+
+/* Task states */
+typedef enum os_task_state {
+ OS_TASK_READY = 1,
+ OS_TASK_SLEEP = 2
+} os_task_state_t;
+
+/* Task flags */
+#define OS_TASK_FLAG_NO_TIMEOUT (0x0001U)
+#define OS_TASK_FLAG_SEM_WAIT (0x0002U)
+#define OS_TASK_FLAG_MUTEX_WAIT (0x0004U)
+
+typedef void (*os_task_func_t)(void *);
+
+#define OS_TASK_MAX_NAME_LEN (32)
+</code></pre>
+
+<p><br></p>
+<pre><code class="no-highlight">struct os_task {
+ os_stack_t *t_stackptr;
+ os_stack_t *t_stacktop;
+
+ uint16_t t_stacksize;
+ uint16_t t_flags;
+
+ uint8_t t_taskid;
+ uint8_t t_prio;
+ uint8_t t_state;
+ uint8_t t_pad;
+
+ char *t_name;
+ os_task_func_t t_func;
+ void *t_arg;
+
+ void *t_obj;
+
+ struct os_sanity_check t_sanity_check;
+
+ os_time_t t_next_wakeup;
+ os_time_t t_run_time;
+ uint32_t t_ctx_sw_cnt;
+
+ /* Global list of all tasks, irrespective of run or sleep lists */
+ STAILQ_ENTRY(os_task) t_os_task_list;
+
+ /* Used to chain task to either the run or sleep list */
+ TAILQ_ENTRY(os_task) t_os_list;
+
+ /* Used to chain task to an object such as a semaphore or mutex */
+ SLIST_ENTRY(os_task) t_obj_list;
+};
+</code></pre>
+
+<table>
+<thead>
+<tr>
+<th><strong>Element</strong></th>
+<th><strong>Description</strong></th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td>t_stackptr</td>
+<td>Current stack pointer</td>
+</tr>
+<tr>
+<td>t_stacktop</td>
+<td>The address of the top of the task stack. The stack grows downward</td>
+</tr>
+<tr>
+<td>t_stacksize</td>
+<td>The size of the stack, in units of os_stack_t (not bytes!)</td>
+</tr>
+<tr>
+<td>t_flags</td>
+<td>Task flags (see flag definitions)</td>
+</tr>
+<tr>
+<td>t_taskid</td>
+<td>A numeric id assigned to each task</td>
+</tr>
+<tr>
+<td>t_prio</td>
+<td>The priority of the task. The lower the number, the higher the priority</td>
+</tr>
+<tr>
+<td>t_state</td>
+<td>The task state (see state definitions)</td>
+</tr>
+<tr>
+<td>t_pad</td>
+<td>padding (for alignment)</td>
+</tr>
+<tr>
+<td>t_name</td>
+<td>Name of task</td>
+</tr>
+<tr>
+<td>t_func</td>
+<td>Pointer to task function</td>
+</tr>
+<tr>
+<td>t_obj</td>
+<td>Generic object used by mutexes and semaphores when the task is waiting on a mutex or semaphore</td>
+</tr>
+<tr>
+<td>t_sanity_check</td>
+<td>Sanity task data structure</td>
+</tr>
+<tr>
+<td>t_next_wakeup</td>
+<td>OS time when task is next scheduled to wake up</td>
+</tr>
+<tr>
+<td>t_run_time</td>
+<td>The amount of os time ticks this task has been running</td>
+</tr>
+<tr>
+<td>t_ctx_sw_cnt</td>
+<td>The number of times that this task has been run</td>
+</tr>
+<tr>
+<td>t_os_task_list</td>
+<td>List pointer for global task list. All tasks are placed on this list</td>
+</tr>
+<tr>
+<td>t_os_list</td>
+<td>List pointer used by either the active task list or the sleeping task list</td>
+</tr>
+<tr>
+<td>t_obj_list</td>
+<td>List pointer for tasks waiting on a semaphore or mutex</td>
+</tr>
+</tbody>
+</table>
+<p><br></p>
+<pre><code class="no-highlight">struct os_task_info {
+ uint8_t oti_prio;
+ uint8_t oti_taskid;
+ uint8_t oti_state;
+ uint8_t oti_flags;
+ uint16_t oti_stkusage;
+ uint16_t oti_stksize;
+ uint32_t oti_cswcnt;
+ uint32_t oti_runtime;
+ os_time_t oti_last_checkin;
+ os_time_t oti_next_checkin;
+
+ char oti_name[OS_TASK_MAX_NAME_LEN];
+};
+</code></pre>
+
+<table>
+<thead>
+<tr>
+<th><strong>Element</strong></th>
+<th><strong>Description</strong></th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td>oti_prio</td>
+<td>Task priority</td>
+</tr>
+<tr>
+<td>oti_taskid</td>
+<td>Task id</td>
+</tr>
+<tr>
+<td>oti_state</td>
+<td>Task state</td>
+</tr>
+<tr>
+<td>oti_flags</td>
+<td>Task flags</td>
+</tr>
+<tr>
+<td>oti_stkusage</td>
+<td>Amount of stack used by the task (in os_stack_t units)</td>
+</tr>
+<tr>
+<td>oti_stksize</td>
+<td>The size of the stack (in os_stack_t units)</td>
+</tr>
+<tr>
+<td>oti_cswcnt</td>
+<td>The context switch count</td>
+</tr>
+<tr>
+<td>oti_runtime</td>
+<td>The amount of time that the task has run (in os time ticks)</td>
+</tr>
+<tr>
+<td>oti_last_checkin</td>
+<td>The time (os time) at which this task last checked in to the sanity task</td>
+</tr>
+<tr>
+<td>oti_next_checkin</td>
+<td>The time (os time) at which this task last checked in to the sanity task</td>
+</tr>
+<tr>
+<td>oti_name</td>
+<td>Name of the task</td>
+</tr>
+</tbody>
+</table>
+<p><br></p>
<h2 id="list-of-functions">List of Functions<a class="headerlink" href="#list-of-functions" title="Permanent link">¶</a></h2>
<p>The functions available in task are:</p>
<ul>
-<li><a href="../_clear_stack/">_clear_stack</a></li>
+<li><a href="../os_task_init/">os_task_init</a></li>
<li><a href="../os_task_count/">os_task_count</a></li>
<li><a href="../os_task_info_get_next/">os_task_info_get_next</a></li>
-<li><a href="../os_task_init/">os_task_init</a></li>
-<li><a href="../os_task_next_id/">os_task_next_id</a></li>
<li><a href="../os_task_sanity_checkin/">os_task_sanity_checkin</a></li>
</ul>
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/3c01204d/os/get_started/vocabulary/index.html
----------------------------------------------------------------------
diff --git a/os/get_started/vocabulary/index.html b/os/get_started/vocabulary/index.html
index 2ff5d29..3c77d6c 100644
--- a/os/get_started/vocabulary/index.html
+++ b/os/get_started/vocabulary/index.html
@@ -244,7 +244,7 @@
<hr/>
</div>
- <h2 id="understanding-newt-terms">Understanding Newt Terms<a class="headerlink" href="#understanding-newt-terms" title="Permanent link">¶</a></h2>
+ <h2 id="glossary">Glossary<a class="headerlink" href="#glossary" title="Permanent link">¶</a></h2>
<h3 id="application-repository-or-app">Application repository or app<a class="headerlink" href="#application-repository-or-app" title="Permanent link">¶</a></h3>
<p>The application repository (app) is the base directory of your embedded software. It is meant to be the workspace containing a logical collection of the source code for one or more of your projects. An app can contain multiple projects, and reflect multiple end products. </p>
<p>As the base repository of your source code, the app has a master branch and several other branches off it. The <code>master</code> is typically what developers commit to. When it is time to get the code ready for a release, a code freeze occurs on the <code>master</code> branch. A temporary <code>develop</code> branch is opened up for contributors to continue committing their code to. After the release is tagged off the <code>master</code>, the <code>develop</code> branch is merged into <code>master</code>. Developers can thereafter go back to commiting changes to <code>master</code>. The <code>develop</code> branch is subsequently deleted. You may also choose to create your own branch and work there.</p>
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/3c01204d/sitemap.xml
----------------------------------------------------------------------
diff --git a/sitemap.xml b/sitemap.xml
index cc07aca..847339c 100644
--- a/sitemap.xml
+++ b/sitemap.xml
@@ -4,7 +4,7 @@
<url>
<loc>http://mynewt.apache.org/</loc>
- <lastmod>2016-02-25</lastmod>
+ <lastmod>2016-02-26</lastmod>
<changefreq>daily</changefreq>
</url>
@@ -12,7 +12,7 @@
<url>
<loc>http://mynewt.apache.org/documentation/</loc>
- <lastmod>2016-02-25</lastmod>
+ <lastmod>2016-02-26</lastmod>
<changefreq>daily</changefreq>
</url>
@@ -20,7 +20,7 @@
<url>
<loc>http://mynewt.apache.org/download/</loc>
- <lastmod>2016-02-25</lastmod>
+ <lastmod>2016-02-26</lastmod>
<changefreq>daily</changefreq>
</url>
@@ -28,7 +28,7 @@
<url>
<loc>http://mynewt.apache.org/community/</loc>
- <lastmod>2016-02-25</lastmod>
+ <lastmod>2016-02-26</lastmod>
<changefreq>daily</changefreq>
</url>
@@ -36,7 +36,7 @@
<url>
<loc>http://mynewt.apache.org/events/</loc>
- <lastmod>2016-02-25</lastmod>
+ <lastmod>2016-02-26</lastmod>
<changefreq>daily</changefreq>
</url>
@@ -45,7 +45,7 @@
<url>
<loc>http://mynewt.apache.org/os/get_started/introduction/</loc>
- <lastmod>2016-02-25</lastmod>
+ <lastmod>2016-02-26</lastmod>
<changefreq>daily</changefreq>
</url>
@@ -73,7 +73,7 @@
<url>
<loc>http://mynewt.apache.org/newt/newt_intro/</loc>
- <lastmod>2016-02-25</lastmod>
+ <lastmod>2016-02-26</lastmod>
<changefreq>daily</changefreq>
</url>
@@ -95,7 +95,7 @@
<url>
<loc>http://mynewt.apache.org/newtmgr/overview/</loc>
- <lastmod>2016-02-25</lastmod>
+ <lastmod>2016-02-26</lastmod>
<changefreq>daily</changefreq>
</url>
[2/2] incubator-mynewt-site git commit: MYNEWT-146: add task
documentation to core os manual - pull request#9 closed
Posted by ad...@apache.org.
MYNEWT-146: add task documentation to core os manual - pull request#9 closed
Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/commit/3c01204d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/tree/3c01204d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/diff/3c01204d
Branch: refs/heads/asf-site
Commit: 3c01204d2c4e8970ed16bc6a7a0b3f6e6eeb8d07
Parents: 2743814
Author: aditihilbert <ad...@runtime.io>
Authored: Fri Feb 26 09:53:37 2016 -0800
Committer: aditihilbert <ad...@runtime.io>
Committed: Fri Feb 26 09:53:37 2016 -0800
----------------------------------------------------------------------
mkdocs/search_index.json | 110 +++-
os/core_os/task/_clear_stack/index.html | 565 -------------------
os/core_os/task/os_task_count/index.html | 39 +-
.../task/os_task_info_get_next/index.html | 85 ++-
os/core_os/task/os_task_init/index.html | 89 ++-
os/core_os/task/os_task_next_id/index.html | 565 -------------------
.../task/os_task_sanity_checkin/index.html | 55 +-
os/core_os/task/task/index.html | 311 +++++++++-
os/get_started/vocabulary/index.html | 2 +-
sitemap.xml | 16 +-
10 files changed, 599 insertions(+), 1238 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/3c01204d/mkdocs/search_index.json
----------------------------------------------------------------------
diff --git a/mkdocs/search_index.json b/mkdocs/search_index.json
index 4a34336..0b88de3 100644
--- a/mkdocs/search_index.json
+++ b/mkdocs/search_index.json
@@ -127,13 +127,13 @@
},
{
"location": "/os/get_started/vocabulary/",
- "text": "Understanding Newt Terms\n\n\nApplication repository or app\n\n\nThe application repository (app) is the base directory of your embedded software. It is meant to be the workspace containing a logical collection of the source code for one or more of your projects. An app can contain multiple projects, and reflect multiple end products. \n\n\nAs the base repository of your source code, the app has a master branch and several other branches off it. The \nmaster\n is typically what developers commit to. When it is time to get the code ready for a release, a code freeze occurs on the \nmaster\n branch. A temporary \ndevelop\n branch is opened up for contributors to continue committing their code to. After the release is tagged off the \nmaster\n, the \ndevelop\n branch is merged into \nmaster\n. Developers can thereafter go back to commiting changes to \nmaster\n. The \ndevelop\n branch is subsequently deleted. You may also choose to create your own branch and work t
here.\n\n\nYou can have several \nprojects\n in your app repository since an application can be used in several projects. Each project in your app will, in turn, consist of several \npackages\n. A project could be a package itself as well. In addition to packages, your app repository will contain additional items such as \ntarget\n or build definitions, \npackage list\n description files, scripts etc.\n\n\nFor example, a walk through the \"larva\" nest at \nhttps://github.com/mynewt/larva.git\n shows the following structure. The nest.yml file in the larva directory indicates that it is a nest. An egg will have the egg.yml file in it as shown below. By this nomenclature, each board support package for a particular chip is an egg, the API for the hardware abstraction layer is an egg, and so on. \n\n\nlarva\n |- nest.yml \n |- compiler\n |- arm-none-eabi-m4\n |- sim\n |- hw (hardware)\n |- bsp (board support package)\n |- nrf52pdk (Nordic nRF52 se
ries chip)\n |- egg.yml\n |- ...\n |- olimex_stm32-e407_devboard (used in Project Blinky)\n |- egg.yml\n |- ...\n |- stm32f3discovery (another board with stm32f3 mcu)\n |- egg.yml\n |- ...\n |- yet another board\n |- egg.yml\n |- ...\n |- hal (hardware abstraction layer APIs)\n |- egg.yml\n |- include\n |- hal_cputime.h\n |- hal_flash.h\n |- hal_gpio.h\n |- ... (header files for other peripherals)\n |- mcu (microcontroller)\n |- stm (STMicro family)\n |- stm32f3xx (STM32f3 series, 32-bit ARM Cortex-M4 core)\n |- egg.yml\n |- src\n
|- hal_gpio.c (specific to the STM32f3 mcu)\n |- hal_cputime.c\n |- ... (code for other peripherals)\n |- nordic (Nordic Semiconductor family)\n |- nrf52xxx (nRF52 Series SoC, Cortex-M4F core)\n |- egg.yml\n |- src\n |- hal_gpio.c (specific to the nRF52 mcu )\n |- hal_cputime.c\n |- ... (code for other peripherals)\n |- yet another family of mcu\n |- ...\n |- libs\n |- bootutil (hw architecture independent boot loader library)\n |- egg.yml\n |- src\n |- loader.c\n |- ... (related source code files)\n |- nffs (hw architecture independent Newtron Flash File System)\n |- egg.yml\n |- src\n |- nffs.c
\n |- ... (related source code files)\n |- another library \n |- egg.yml\n |- src\n |- ... (related source code files)\n |- project\n |- scripts\n\n\n\n\n\n\nThe newt tool offers the \nnest\n command to create and manage nests. In general, commands represent actions and flags are modifiers for those actions. A command can have children commands and optionally run an action. A full description of the \nnest\n command can be found in the newt tool reference in Chapter 3.\n\n\n newt nest [flags]\n newt nest [child-commands] \n\n\n\n\nA complete list of all the nest commands can be found in the newt tool reference in \nNewt Tool\n.\n\n\nProject\n\n\nProjects represent the individual build configurations of your embedded system and essentially defines your application. The project files are what dictate the resulting binary that is generated. \n\n\nLayout-wise, a project is a directory inside an app and co
ntains packages required for a certain application. For example, the \nblinky\n egg sits in \nproject/blinky\n directory of the \nlarva\n nest. This egg is used in the blinky project (application) outlined in \nGet Started\n. \nNote: This Will Change\n\n\nA project has the following concepts or properties associated with it. You can find them in the \nproject-name\n.yml\n file in the project directory. For example, the \nproject/blinky\n directory has the \nblinky.yml\n file indicating some or all of the properties below. Only the name of a project is required for the project to exist, however additional properties may need to be specified for the eggs in it to compile properly and produce an executable. \n\n\n\n\nProject name\n\n\nBase path of the project (nest/project/project-name by default)\n\n\nEggs belonging to the project\n\n\nCapabilities\n that are required for the project or target \n\n\nIdentity\n to classify the type of project or target\n\n\nCompiler flags to call out a
ny specific compiler requirement\n\n\n\n\nA project could itself be an egg if it is a distributable package for a specific application. \n\n\nThe newt tool offers various commands that you can use with a project. For example, if your project is an egg, you can use the following command to install a project from a nest.\n\n\n newt egg install [flags] \nproject egg name\n\n\n\n\n\nPackage or pkg\n\n\nA package (pkg) is a distributable bundle of libraries. Just as an egg in nature has various parts each of which serves a certain purpose, the Mynewt egg consists of software parcels or modules that have different functions. However, unlike the egg in nature these software modules can exist by itself and may be distributed; therefore, they too are essentially eggs. Once this concept is grasped it is easy to see how an egg may consist of other eggs.\n\n\nThe two main directories in an egg are \n/include\n and \n/src\n.\n\n\nThe newt tool offers several egg commands to list, inspect, ins
tall, and do other operations on eggs. For example, the following command\n\n\n newt egg list \n\n\n\n\noutputs all the eggs in the current nest where each egg has details on its version, path, and dependencies. A sample output for an egg is given below.\n\n\n Egg libs/os, version 0.1.0\n path: /Users/aditihilbert/dev/test_project/libs/os\n deps: libs/testutil@none#stable \n\n\n\n\nA complete list of all the egg commands can be found in the newt tool reference in \nNewt Tool\n.\n\n\nPackage list or pkg-list\n\n\nA clutch is a snapshot of all eggs in a remote nest at any point in time. On any given github branch, a nest with a clutch of eggs will contain a \nclutch.yml\n file that specifies the version number, dependencies, and hash value for each constituent egg as well as the name of the entire clutch and the github url for it. [Note: Currently ]\n\n\nYou may download multiple clutches into your local nest as long as the names of the clutches are different. This allows
you to mix and match various features and functionality coming from different clutches of eggs. You can see all the clutches in the \n.nest/clutches\n directory in your nest.\n\n\nThe newt tool offers clutch management commands within the \nnewt nest\n command. For example, the following command creates a new clutch using all the eggs in the current directory. It requires that a clutch name be specified and the url for the location of that clutch in the online repository. These two inputs go into the \nclutch.yml\n file in the nest.\n\n\n newt nest generate-clutch \nname\n \nurl\n\n\n\n\n\nNote that a clutch merely defines the eggs belonging together and requires the eggs to be installed (hatched) for the source code to be populated in the project. \n\n\nEggshell\n\n\nThe term eggshell is used to refer to the eggs of a clutch in a remote repository. They are not useful on your local machine until you actually install them. So they are mere shells of themselves while sitting on th
e online repository. When you enter the following command outputs the total number of shells in each remote clutch.\n\n\n newt nest list-clutches\n\n\n\n\nSo, if you had two clutches installed, the output could be:\n\n\n Remote clutch larva (eggshells: 19)\n Remote clutch ble_test (eggshells: 15)\n\n\n\n\nTarget\n\n\nA target is the hardware build or its software equivalent (e.g. test, simulator) set for a project. It tells the newt tool how to build the source code within a given nest. Once a new target is created, its architecture and other details needs to be defined. An example of a defined target named \"blink_f3disc\" is given below.\n\n\n blink_f3disc\n compiler_def: debug\n compiler: arm-none-eabi-m4\n name: blink_f3disc\n arch: cortex_m4\n project: blinky\n bsp: hw/bsp/stm32f3discovery\n\n\n\n\nThe newt tool offers commands to create, set up and manipulate targets. For example, the create co
mmand below creates an empty target named \nmy_target1\n and the set command sets one detail of its definition, namely the architecture.\n\n\n newt target create my_target1\n newt target set my_target1 arch=cortex_m4\n\n\n\n\nCapability\n\n\nCapability is functionality that is exposed by an egg. A capability is tracked by its name and version. An egg may require capabilities exposed by another egg, thus establishing a dependency tracked through the egg.yml files. \n\n\nThe newt tool can ascertain a map of all the egg capabilities and use it to check dependencies and make sure all the necessary eggs are in a project for a particular target.\n\n\nIdentity\n\n\nIdentity is a property of a target or project in the newt world. A target may inherit it from a project or vice versa. It may be used to determine what eggs to include or how an egg code should behave in a build or which linkerscripts to use. For example, the identity of a lock is different from the identity of a wearable
monitor. Even if they were to be built on the same hardware target, different features and behavior are required. Their different identities result in differing sets of eggs in the projects and/or the same egg behaving differently depending on the identity.",
+ "text": "Glossary\n\n\nApplication repository or app\n\n\nThe application repository (app) is the base directory of your embedded software. It is meant to be the workspace containing a logical collection of the source code for one or more of your projects. An app can contain multiple projects, and reflect multiple end products. \n\n\nAs the base repository of your source code, the app has a master branch and several other branches off it. The \nmaster\n is typically what developers commit to. When it is time to get the code ready for a release, a code freeze occurs on the \nmaster\n branch. A temporary \ndevelop\n branch is opened up for contributors to continue committing their code to. After the release is tagged off the \nmaster\n, the \ndevelop\n branch is merged into \nmaster\n. Developers can thereafter go back to commiting changes to \nmaster\n. The \ndevelop\n branch is subsequently deleted. You may also choose to create your own branch and work there.\n\n\nYou c
an have several \nprojects\n in your app repository since an application can be used in several projects. Each project in your app will, in turn, consist of several \npackages\n. A project could be a package itself as well. In addition to packages, your app repository will contain additional items such as \ntarget\n or build definitions, \npackage list\n description files, scripts etc.\n\n\nFor example, a walk through the \"larva\" nest at \nhttps://github.com/mynewt/larva.git\n shows the following structure. The nest.yml file in the larva directory indicates that it is a nest. An egg will have the egg.yml file in it as shown below. By this nomenclature, each board support package for a particular chip is an egg, the API for the hardware abstraction layer is an egg, and so on. \n\n\nlarva\n |- nest.yml \n |- compiler\n |- arm-none-eabi-m4\n |- sim\n |- hw (hardware)\n |- bsp (board support package)\n |- nrf52pdk (Nordic nRF52 series chip)\n
|- egg.yml\n |- ...\n |- olimex_stm32-e407_devboard (used in Project Blinky)\n |- egg.yml\n |- ...\n |- stm32f3discovery (another board with stm32f3 mcu)\n |- egg.yml\n |- ...\n |- yet another board\n |- egg.yml\n |- ...\n |- hal (hardware abstraction layer APIs)\n |- egg.yml\n |- include\n |- hal_cputime.h\n |- hal_flash.h\n |- hal_gpio.h\n |- ... (header files for other peripherals)\n |- mcu (microcontroller)\n |- stm (STMicro family)\n |- stm32f3xx (STM32f3 series, 32-bit ARM Cortex-M4 core)\n |- egg.yml\n |- src\n |-
hal_gpio.c (specific to the STM32f3 mcu)\n |- hal_cputime.c\n |- ... (code for other peripherals)\n |- nordic (Nordic Semiconductor family)\n |- nrf52xxx (nRF52 Series SoC, Cortex-M4F core)\n |- egg.yml\n |- src\n |- hal_gpio.c (specific to the nRF52 mcu )\n |- hal_cputime.c\n |- ... (code for other peripherals)\n |- yet another family of mcu\n |- ...\n |- libs\n |- bootutil (hw architecture independent boot loader library)\n |- egg.yml\n |- src\n |- loader.c\n |- ... (related source code files)\n |- nffs (hw architecture independent Newtron Flash File System)\n |- egg.yml\n |- src\n |- nffs.c\n
|- ... (related source code files)\n |- another library \n |- egg.yml\n |- src\n |- ... (related source code files)\n |- project\n |- scripts\n\n\n\n\n\n\nThe newt tool offers the \nnest\n command to create and manage nests. In general, commands represent actions and flags are modifiers for those actions. A command can have children commands and optionally run an action. A full description of the \nnest\n command can be found in the newt tool reference in Chapter 3.\n\n\n newt nest [flags]\n newt nest [child-commands] \n\n\n\n\nA complete list of all the nest commands can be found in the newt tool reference in \nNewt Tool\n.\n\n\nProject\n\n\nProjects represent the individual build configurations of your embedded system and essentially defines your application. The project files are what dictate the resulting binary that is generated. \n\n\nLayout-wise, a project is a directory inside an app and contains packages
required for a certain application. For example, the \nblinky\n egg sits in \nproject/blinky\n directory of the \nlarva\n nest. This egg is used in the blinky project (application) outlined in \nGet Started\n. \nNote: This Will Change\n\n\nA project has the following concepts or properties associated with it. You can find them in the \nproject-name\n.yml\n file in the project directory. For example, the \nproject/blinky\n directory has the \nblinky.yml\n file indicating some or all of the properties below. Only the name of a project is required for the project to exist, however additional properties may need to be specified for the eggs in it to compile properly and produce an executable. \n\n\n\n\nProject name\n\n\nBase path of the project (nest/project/project-name by default)\n\n\nEggs belonging to the project\n\n\nCapabilities\n that are required for the project or target \n\n\nIdentity\n to classify the type of project or target\n\n\nCompiler flags to call out any specific comp
iler requirement\n\n\n\n\nA project could itself be an egg if it is a distributable package for a specific application. \n\n\nThe newt tool offers various commands that you can use with a project. For example, if your project is an egg, you can use the following command to install a project from a nest.\n\n\n newt egg install [flags] \nproject egg name\n\n\n\n\n\nPackage or pkg\n\n\nA package (pkg) is a distributable bundle of libraries. Just as an egg in nature has various parts each of which serves a certain purpose, the Mynewt egg consists of software parcels or modules that have different functions. However, unlike the egg in nature these software modules can exist by itself and may be distributed; therefore, they too are essentially eggs. Once this concept is grasped it is easy to see how an egg may consist of other eggs.\n\n\nThe two main directories in an egg are \n/include\n and \n/src\n.\n\n\nThe newt tool offers several egg commands to list, inspect, install, and do oth
er operations on eggs. For example, the following command\n\n\n newt egg list \n\n\n\n\noutputs all the eggs in the current nest where each egg has details on its version, path, and dependencies. A sample output for an egg is given below.\n\n\n Egg libs/os, version 0.1.0\n path: /Users/aditihilbert/dev/test_project/libs/os\n deps: libs/testutil@none#stable \n\n\n\n\nA complete list of all the egg commands can be found in the newt tool reference in \nNewt Tool\n.\n\n\nPackage list or pkg-list\n\n\nA clutch is a snapshot of all eggs in a remote nest at any point in time. On any given github branch, a nest with a clutch of eggs will contain a \nclutch.yml\n file that specifies the version number, dependencies, and hash value for each constituent egg as well as the name of the entire clutch and the github url for it. [Note: Currently ]\n\n\nYou may download multiple clutches into your local nest as long as the names of the clutches are different. This allows you to mix and m
atch various features and functionality coming from different clutches of eggs. You can see all the clutches in the \n.nest/clutches\n directory in your nest.\n\n\nThe newt tool offers clutch management commands within the \nnewt nest\n command. For example, the following command creates a new clutch using all the eggs in the current directory. It requires that a clutch name be specified and the url for the location of that clutch in the online repository. These two inputs go into the \nclutch.yml\n file in the nest.\n\n\n newt nest generate-clutch \nname\n \nurl\n\n\n\n\n\nNote that a clutch merely defines the eggs belonging together and requires the eggs to be installed (hatched) for the source code to be populated in the project. \n\n\nEggshell\n\n\nThe term eggshell is used to refer to the eggs of a clutch in a remote repository. They are not useful on your local machine until you actually install them. So they are mere shells of themselves while sitting on the online reposit
ory. When you enter the following command outputs the total number of shells in each remote clutch.\n\n\n newt nest list-clutches\n\n\n\n\nSo, if you had two clutches installed, the output could be:\n\n\n Remote clutch larva (eggshells: 19)\n Remote clutch ble_test (eggshells: 15)\n\n\n\n\nTarget\n\n\nA target is the hardware build or its software equivalent (e.g. test, simulator) set for a project. It tells the newt tool how to build the source code within a given nest. Once a new target is created, its architecture and other details needs to be defined. An example of a defined target named \"blink_f3disc\" is given below.\n\n\n blink_f3disc\n compiler_def: debug\n compiler: arm-none-eabi-m4\n name: blink_f3disc\n arch: cortex_m4\n project: blinky\n bsp: hw/bsp/stm32f3discovery\n\n\n\n\nThe newt tool offers commands to create, set up and manipulate targets. For example, the create command below crea
tes an empty target named \nmy_target1\n and the set command sets one detail of its definition, namely the architecture.\n\n\n newt target create my_target1\n newt target set my_target1 arch=cortex_m4\n\n\n\n\nCapability\n\n\nCapability is functionality that is exposed by an egg. A capability is tracked by its name and version. An egg may require capabilities exposed by another egg, thus establishing a dependency tracked through the egg.yml files. \n\n\nThe newt tool can ascertain a map of all the egg capabilities and use it to check dependencies and make sure all the necessary eggs are in a project for a particular target.\n\n\nIdentity\n\n\nIdentity is a property of a target or project in the newt world. A target may inherit it from a project or vice versa. It may be used to determine what eggs to include or how an egg code should behave in a build or which linkerscripts to use. For example, the identity of a lock is different from the identity of a wearable monitor. Even if
they were to be built on the same hardware target, different features and behavior are required. Their different identities result in differing sets of eggs in the projects and/or the same egg behaving differently depending on the identity.",
"title": "Understanding Newt Terms"
},
{
- "location": "/os/get_started/vocabulary/#understanding-newt-terms",
+ "location": "/os/get_started/vocabulary/#glossary",
"text": "",
- "title": "Understanding Newt Terms"
+ "title": "Glossary"
},
{
"location": "/os/get_started/vocabulary/#application-repository-or-app",
@@ -462,60 +462,130 @@
},
{
"location": "/os/core_os/task/task/",
- "text": "Task\n\n\nInsert synopsis here\n\n\nDescription\n\n\nDescribe OS feature here \n\n\nData structures\n\n\nReplace this with the list of data structures used, why, any neat features\n\n\nList of Functions\n\n\nThe functions available in task are:\n\n\n\n\n_clear_stack\n\n\nos_task_count\n\n\nos_task_info_get_next\n\n\nos_task_init\n\n\nos_task_next_id\n\n\nos_task_sanity_checkin",
+ "text": "Task\n\n\nA task, along with the scheduler, forms the basis of the Mynewt OS. A task \nconsists of two basic elements: a task stack and a task function. The task \nfunction is basically a forever loop, waiting for some \"event\" to wake it up. \nThere are two methods used to signal a task that it has work to do: event queues \nand semaphores (see the appropriate manual sections for descriptions of these \nfeatures).\n\n\nThe Mynewt OS is a multi-tasking, preemptive OS. Every task is assigned a task \npriority (from 0 to 255), with 0 being the highest priority task. If a higher \npriority task than the current task wants to run, the scheduler preempts the \ncurrently running task and switches context to the higher priority task. This is \njust a fancy way of saying that the processor stack pointer now points to the \nstack of the higher priority task and the task resumes execution where it left \noff.\n\n\nTasks run to completion unless they are preempted by a hi
gher priority task. The \ndeveloper must insure that tasks eventually \"sleep\"; otherwise lower priority \ntasks will never get a chance to run (actually, any task lower in priority than \nthe task that never sleeps). A task will be put to sleep in the following cases: \nit puts itself to sleep using \nos_time_delay()\n, it waits on an event queue \nwhich is empty or attempts to obtain a mutex or a semaphore that is currently \nowned by another task.\n\n\nNote that other sections of the manual describe these OS features in more \ndetail.\n\n\nDescription\n\n\nIn order to create a task two data structures need to be defined: the task \nobject (struct os_task) and its associated stack. Determining the stack size can \nbe a bit tricky; generally developers should not declare large local variables \non the stack so that task stacks can be of limited size. However, all \napplications are different and the developer must choose the stack size \naccordingly. NOTE: be careful when declarin
g your stack! The stack is in units \nof \nos_stack_t\n sized elements (generally 32-bits). Looking at the example given \nbelow and assuming \nos_stack_t\n is defined to be a 32-bit unsigned value, \n\"my_task_stack\" will use 256 bytes. \n\n\nA task must also have an associated \"task function\". This is the function that \nwill be called when the task is first run. This task function should never \nreturn!\n\n\nIn order to inform the Mynewt OS of the new task and to have it added to the \nscheduler, the \nos_task_init()\n function is called. Once \nos_task_init()\n is \ncalled, the task is made ready to run and is added to the active task list. Note \nthat a task can be initialized (started) before or after the os has started \n(i.e. before \nos_start()\n is called) but must be initialized after the os has \nbeen initialized (i.e. 'os_init' has been called). In most of the examples and \ncurrent Mynewt projects, the os is initialized, tasks are initialized, and the \nthe os is st
arted. Once the os has started, the highest priority task will be \nthe first task set to run.\n\n\nInformation about a task can be obtained using the \nos_task_info_get_next()\n \nAPI. Developers can walk the list of tasks to obtain information on all created \ntasks. This information is of type \nos_task_info\n and is described below.\n\n\nThe following is a very simple example showing a single application task. This \ntask simply toggles an LED at a one second interval.\n\n\n/* Create a simple \nproject\n with a task that blinks a LED every second */\n\n/* Define task stack and task object */\n#define MY_TASK_PRI (OS_TASK_PRI_HIGHEST) \n#define MY_STACK_SIZE (64) \nstruct os_task my_task; \nos_stack_t my_task_stack[MY_STACK_SIZE]; \n\n/* This is the task function */\nvoid my_task_func(void *arg) {\n /* Set the led pin as an output */\n hal_gpio_init_out(LED_BLINK_PIN, 1);\n\n /* The task is a forever loop that does not return */\n while (1) {\n /*
Wait one second */ \n os_time_delay(1000);\n\n /* Toggle the LED */ \n hal_gpio_toggle(LED_BLINK_PIN);\n }\n}\n\n/* This is the main function for the project */\nint main(void) {\n int rc;\n\n /* Initialize OS */\n os_init();\n\n /* Initialize the task */\n os_task_init(\nmy_task, \nmy_task\n, my_task_func, NULL, MY_TASK_PRIO, \n OS_WAIT_FOREVER, my_task_stack, MY_STACK_SIZE);\n\n /* Start the OS */\n os_start();\n\n /* os start should never return. If it does, this should be an error */\n assert(0);\n\n return rc;\n}\n\n\n\n\nData structures\n\n\n/* The highest and lowest task priorities */\n#define OS_TASK_PRI_HIGHEST (0)\n#define OS_TASK_PRI_LOWEST (0xff)\n\n/* Task states */\ntypedef enum os_task_state {\n OS_TASK_READY = 1, \n OS_TASK_SLEEP = 2\n} os_task_state_t;\n\n/* Task flags */\n#define OS_TASK_FLAG_NO_TIMEOUT (0x0001U)\n#define OS_TASK_FLAG_SEM_WAIT (0x0002U)\n#define
OS_TASK_FLAG_MUTEX_WAIT (0x0004U)\n\ntypedef void (*os_task_func_t)(void *);\n\n#define OS_TASK_MAX_NAME_LEN (32)\n\n\n\n\n\n\nstruct os_task {\n os_stack_t *t_stackptr;\n os_stack_t *t_stacktop;\n\n uint16_t t_stacksize;\n uint16_t t_flags;\n\n uint8_t t_taskid;\n uint8_t t_prio;\n uint8_t t_state;\n uint8_t t_pad;\n\n char *t_name;\n os_task_func_t t_func;\n void *t_arg;\n\n void *t_obj;\n\n struct os_sanity_check t_sanity_check; \n\n os_time_t t_next_wakeup;\n os_time_t t_run_time;\n uint32_t t_ctx_sw_cnt;\n\n /* Global list of all tasks, irrespective of run or sleep lists */\n STAILQ_ENTRY(os_task) t_os_task_list;\n\n /* Used to chain task to either the run or sleep list */ \n TAILQ_ENTRY(os_task) t_os_list;\n\n /* Used to chain task to an object such as a semaphore or mutex */\n SLIST_ENTRY(os_task) t_obj_list;\n};\n\n\n\n\n\n\n\n\n\n\nElement\n\n\nDescription\n\n\n\n\n\n\n\n\n\n\nt_stackptr\n\n\nCurrent stac
k pointer\n\n\n\n\n\n\nt_stacktop\n\n\nThe address of the top of the task stack. The stack grows downward\n\n\n\n\n\n\nt_stacksize\n\n\nThe size of the stack, in units of os_stack_t (not bytes!)\n\n\n\n\n\n\nt_flags\n\n\nTask flags (see flag definitions)\n\n\n\n\n\n\nt_taskid\n\n\nA numeric id assigned to each task\n\n\n\n\n\n\nt_prio\n\n\nThe priority of the task. The lower the number, the higher the priority\n\n\n\n\n\n\nt_state\n\n\nThe task state (see state definitions)\n\n\n\n\n\n\nt_pad\n\n\npadding (for alignment)\n\n\n\n\n\n\nt_name\n\n\nName of task\n\n\n\n\n\n\nt_func\n\n\nPointer to task function\n\n\n\n\n\n\nt_obj\n\n\nGeneric object used by mutexes and semaphores when the task is waiting on a mutex or semaphore\n\n\n\n\n\n\nt_sanity_check\n\n\nSanity task data structure\n\n\n\n\n\n\nt_next_wakeup\n\n\nOS time when task is next scheduled to wake up\n\n\n\n\n\n\nt_run_time\n\n\nThe amount of os time ticks this task has been running\n\n\n\n\n\n\nt_ctx_sw_cnt\n\n\nThe numbe
r of times that this task has been run\n\n\n\n\n\n\nt_os_task_list\n\n\nList pointer for global task list. All tasks are placed on this list\n\n\n\n\n\n\nt_os_list\n\n\nList pointer used by either the active task list or the sleeping task list\n\n\n\n\n\n\nt_obj_list\n\n\nList pointer for tasks waiting on a semaphore or mutex\n\n\n\n\n\n\n\n\n\n\nstruct os_task_info {\n uint8_t oti_prio;\n uint8_t oti_taskid;\n uint8_t oti_state;\n uint8_t oti_flags;\n uint16_t oti_stkusage;\n uint16_t oti_stksize;\n uint32_t oti_cswcnt;\n uint32_t oti_runtime;\n os_time_t oti_last_checkin;\n os_time_t oti_next_checkin;\n\n char oti_name[OS_TASK_MAX_NAME_LEN];\n};\n\n\n\n\n\n\n\n\n\n\nElement\n\n\nDescription\n\n\n\n\n\n\n\n\n\n\noti_prio\n\n\nTask priority\n\n\n\n\n\n\noti_taskid\n\n\nTask id\n\n\n\n\n\n\noti_state\n\n\nTask state\n\n\n\n\n\n\noti_flags\n\n\nTask flags\n\n\n\n\n\n\noti_stkusage\n\n\nAmount of stack used by the task (in os_stack_t units)\n\n\n\n\n\n\
noti_stksize\n\n\nThe size of the stack (in os_stack_t units)\n\n\n\n\n\n\noti_cswcnt\n\n\nThe context switch count\n\n\n\n\n\n\noti_runtime\n\n\nThe amount of time that the task has run (in os time ticks)\n\n\n\n\n\n\noti_last_checkin\n\n\nThe time (os time) at which this task last checked in to the sanity task\n\n\n\n\n\n\noti_next_checkin\n\n\nThe time (os time) at which this task last checked in to the sanity task\n\n\n\n\n\n\noti_name\n\n\nName of the task\n\n\n\n\n\n\n\n\n\n\nList of Functions\n\n\nThe functions available in task are:\n\n\n\n\nos_task_init\n\n\nos_task_count\n\n\nos_task_info_get_next\n\n\nos_task_sanity_checkin",
"title": "Overview"
},
{
"location": "/os/core_os/task/task/#task",
- "text": "Insert synopsis here",
+ "text": "A task, along with the scheduler, forms the basis of the Mynewt OS. A task \nconsists of two basic elements: a task stack and a task function. The task \nfunction is basically a forever loop, waiting for some \"event\" to wake it up. \nThere are two methods used to signal a task that it has work to do: event queues \nand semaphores (see the appropriate manual sections for descriptions of these \nfeatures). The Mynewt OS is a multi-tasking, preemptive OS. Every task is assigned a task \npriority (from 0 to 255), with 0 being the highest priority task. If a higher \npriority task than the current task wants to run, the scheduler preempts the \ncurrently running task and switches context to the higher priority task. This is \njust a fancy way of saying that the processor stack pointer now points to the \nstack of the higher priority task and the task resumes execution where it left \noff. Tasks run to completion unless they are preempted by a higher priority task
. The \ndeveloper must insure that tasks eventually \"sleep\"; otherwise lower priority \ntasks will never get a chance to run (actually, any task lower in priority than \nthe task that never sleeps). A task will be put to sleep in the following cases: \nit puts itself to sleep using os_time_delay() , it waits on an event queue \nwhich is empty or attempts to obtain a mutex or a semaphore that is currently \nowned by another task. Note that other sections of the manual describe these OS features in more \ndetail.",
"title": "Task"
},
{
"location": "/os/core_os/task/task/#description",
- "text": "Describe OS feature here",
+ "text": "In order to create a task two data structures need to be defined: the task \nobject (struct os_task) and its associated stack. Determining the stack size can \nbe a bit tricky; generally developers should not declare large local variables \non the stack so that task stacks can be of limited size. However, all \napplications are different and the developer must choose the stack size \naccordingly. NOTE: be careful when declaring your stack! The stack is in units \nof os_stack_t sized elements (generally 32-bits). Looking at the example given \nbelow and assuming os_stack_t is defined to be a 32-bit unsigned value, \n\"my_task_stack\" will use 256 bytes. A task must also have an associated \"task function\". This is the function that \nwill be called when the task is first run. This task function should never \nreturn! In order to inform the Mynewt OS of the new task and to have it added to the \nscheduler, the os_task_init() function is called. Once os_
task_init() is \ncalled, the task is made ready to run and is added to the active task list. Note \nthat a task can be initialized (started) before or after the os has started \n(i.e. before os_start() is called) but must be initialized after the os has \nbeen initialized (i.e. 'os_init' has been called). In most of the examples and \ncurrent Mynewt projects, the os is initialized, tasks are initialized, and the \nthe os is started. Once the os has started, the highest priority task will be \nthe first task set to run. Information about a task can be obtained using the os_task_info_get_next() \nAPI. Developers can walk the list of tasks to obtain information on all created \ntasks. This information is of type os_task_info and is described below. The following is a very simple example showing a single application task. This \ntask simply toggles an LED at a one second interval. /* Create a simple project with a task that blinks a LED every second */\n\n/* Define task stac
k and task object */\n#define MY_TASK_PRI (OS_TASK_PRI_HIGHEST) \n#define MY_STACK_SIZE (64) \nstruct os_task my_task; \nos_stack_t my_task_stack[MY_STACK_SIZE]; \n\n/* This is the task function */\nvoid my_task_func(void *arg) {\n /* Set the led pin as an output */\n hal_gpio_init_out(LED_BLINK_PIN, 1);\n\n /* The task is a forever loop that does not return */\n while (1) {\n /* Wait one second */ \n os_time_delay(1000);\n\n /* Toggle the LED */ \n hal_gpio_toggle(LED_BLINK_PIN);\n }\n}\n\n/* This is the main function for the project */\nint main(void) {\n int rc;\n\n /* Initialize OS */\n os_init();\n\n /* Initialize the task */\n os_task_init( my_task, my_task , my_task_func, NULL, MY_TASK_PRIO, \n OS_WAIT_FOREVER, my_task_stack, MY_STACK_SIZE);\n\n /* Start the OS */\n os_start();\n\n /* os start should never return. If it does, this should be an error */\n assert(0);\n\n retu
rn rc;\n}",
"title": "Description"
},
{
"location": "/os/core_os/task/task/#data-structures",
- "text": "Replace this with the list of data structures used, why, any neat features",
+ "text": "/* The highest and lowest task priorities */\n#define OS_TASK_PRI_HIGHEST (0)\n#define OS_TASK_PRI_LOWEST (0xff)\n\n/* Task states */\ntypedef enum os_task_state {\n OS_TASK_READY = 1, \n OS_TASK_SLEEP = 2\n} os_task_state_t;\n\n/* Task flags */\n#define OS_TASK_FLAG_NO_TIMEOUT (0x0001U)\n#define OS_TASK_FLAG_SEM_WAIT (0x0002U)\n#define OS_TASK_FLAG_MUTEX_WAIT (0x0004U)\n\ntypedef void (*os_task_func_t)(void *);\n\n#define OS_TASK_MAX_NAME_LEN (32) struct os_task {\n os_stack_t *t_stackptr;\n os_stack_t *t_stacktop;\n\n uint16_t t_stacksize;\n uint16_t t_flags;\n\n uint8_t t_taskid;\n uint8_t t_prio;\n uint8_t t_state;\n uint8_t t_pad;\n\n char *t_name;\n os_task_func_t t_func;\n void *t_arg;\n\n void *t_obj;\n\n struct os_sanity_check t_sanity_check; \n\n os_time_t t_next_wakeup;\n os_time_t t_run_time;\n uint32_t t_ctx_sw_cnt;\n\n /* Global list of all tasks, irrespective
of run or sleep lists */\n STAILQ_ENTRY(os_task) t_os_task_list;\n\n /* Used to chain task to either the run or sleep list */ \n TAILQ_ENTRY(os_task) t_os_list;\n\n /* Used to chain task to an object such as a semaphore or mutex */\n SLIST_ENTRY(os_task) t_obj_list;\n}; Element Description t_stackptr Current stack pointer t_stacktop The address of the top of the task stack. The stack grows downward t_stacksize The size of the stack, in units of os_stack_t (not bytes!) t_flags Task flags (see flag definitions) t_taskid A numeric id assigned to each task t_prio The priority of the task. The lower the number, the higher the priority t_state The task state (see state definitions) t_pad padding (for alignment) t_name Name of task t_func Pointer to task function t_obj Generic object used by mutexes and semaphores when the task is waiting on a mutex or semaphore t_sanity_check Sanity task data structure t_next_wakeup
OS time when task is next scheduled to wake up t_run_time The amount of os time ticks this task has been running t_ctx_sw_cnt The number of times that this task has been run t_os_task_list List pointer for global task list. All tasks are placed on this list t_os_list List pointer used by either the active task list or the sleeping task list t_obj_list List pointer for tasks waiting on a semaphore or mutex struct os_task_info {\n uint8_t oti_prio;\n uint8_t oti_taskid;\n uint8_t oti_state;\n uint8_t oti_flags;\n uint16_t oti_stkusage;\n uint16_t oti_stksize;\n uint32_t oti_cswcnt;\n uint32_t oti_runtime;\n os_time_t oti_last_checkin;\n os_time_t oti_next_checkin;\n\n char oti_name[OS_TASK_MAX_NAME_LEN];\n}; Element Description oti_prio Task priority oti_taskid Task id oti_state Task state oti_flags Task flags oti_stkusage Amount of stack used by the task (in os_stack_t units) oti_stksize The si
ze of the stack (in os_stack_t units) oti_cswcnt The context switch count oti_runtime The amount of time that the task has run (in os time ticks) oti_last_checkin The time (os time) at which this task last checked in to the sanity task oti_next_checkin The time (os time) at which this task last checked in to the sanity task oti_name Name of the task",
"title": "Data structures"
},
{
"location": "/os/core_os/task/task/#list-of-functions",
- "text": "The functions available in task are: _clear_stack os_task_count os_task_info_get_next os_task_init os_task_next_id os_task_sanity_checkin",
+ "text": "The functions available in task are: os_task_init os_task_count os_task_info_get_next os_task_sanity_checkin",
"title": "List of Functions"
},
{
- "location": "/os/core_os/task/_clear_stack/",
- "text": "",
- "title": "_clear_stack"
- },
- {
"location": "/os/core_os/task/os_task_count/",
- "text": "",
+ "text": "os_task_count\n\n\nuint8_t os_task_count(void);\n\n\n\n\nReturns the number of tasks that have been created. \n\n\n\n\nArguments\n\n\nNone\n\n\n\n\nReturned values\n\n\nunsigned 8-bit integer representing number of tasks created\n\n\n\n\nExample\n\n\n\n uint8_t num_tasks;\n\n num_tasks = os_task_count();",
"title": "os_task_count"
},
{
+ "location": "/os/core_os/task/os_task_count/#os_task_count",
+ "text": "uint8_t os_task_count(void); Returns the number of tasks that have been created.",
+ "title": " os_task_count"
+ },
+ {
+ "location": "/os/core_os/task/os_task_count/#arguments",
+ "text": "None",
+ "title": "Arguments"
+ },
+ {
+ "location": "/os/core_os/task/os_task_count/#returned-values",
+ "text": "unsigned 8-bit integer representing number of tasks created",
+ "title": "Returned values"
+ },
+ {
+ "location": "/os/core_os/task/os_task_count/#example",
+ "text": "uint8_t num_tasks;\n\n num_tasks = os_task_count();",
+ "title": "Example"
+ },
+ {
"location": "/os/core_os/task/os_task_info_get_next/",
- "text": "",
+ "text": "os_task_info_get_next\n\n\nstruct os_task *os_task_info_get_next(const struct os_task *prev, struct os_task_info *oti);\n\n\n\n\nPopulates the os task info structure pointed to by \noti\n with task information. \nThe task populating the \noti\n structure is either the first task on the task \nlist if \nprev\n is NULL, or the next task in the task list (the next pointer of \n\nprev\n).\n\n\nIf there are no tasks initialized, NULL is returned. Otherwise, the task \nstructure used to populate \noti\n is returned.\n\n\n\n\nArguments\n\n\n\n\n\n\n\n\nArguments\n\n\nDescription\n\n\n\n\n\n\n\n\n\n\nprev\n\n\nPointer to previous task in task list. If NULL, use first task on list\n\n\n\n\n\n\noti\n\n\nPointer to \nos_task_info\n structure where task information will be stored\n\n\n\n\n\n\n\n\n\n\nReturned values\n\n\nReturns a pointer to the os task structure that was used to populate the task \ninformation structure. NULL means that no tasks were created.\n\n\n\n\nExam
ple\n\n\n\nvoid \nget_task_info(void)\n{\n struct os_task *prev_task; \n struct os_task_info oti; \n\n console_printf(\nTasks: \\n\n);\n prev_task = NULL;\n while (1) {\n prev_task = os_task_info_get_next(prev_task, \noti);\n if (prev_task == NULL) {\n break;\n }\n\n console_printf(\n %s (prio: %u, tid: %u, lcheck: %lu, ncheck: %lu, \n\n \nflags: 0x%x, ssize: %u, susage: %u, cswcnt: %lu, \n\n \ntot_run_time: %lums)\\n\n,\n oti.oti_name, oti.oti_prio, oti.oti_taskid, \n (unsigned long)oti.oti_last_checkin,\n (unsigned long)oti.oti_next_checkin, oti.oti_flags,\n oti.oti_stksize, oti.oti_stkusage, (unsigned long)oti.oti_cswcnt,\n (unsigned long)oti.oti_runtime);\n\n }\n}",
"title": "os_task_info_get_next"
},
{
+ "location": "/os/core_os/task/os_task_info_get_next/#os_task_info_get_next",
+ "text": "struct os_task *os_task_info_get_next(const struct os_task *prev, struct os_task_info *oti); Populates the os task info structure pointed to by oti with task information. \nThe task populating the oti structure is either the first task on the task \nlist if prev is NULL, or the next task in the task list (the next pointer of prev ). If there are no tasks initialized, NULL is returned. Otherwise, the task \nstructure used to populate oti is returned.",
+ "title": " os_task_info_get_next"
+ },
+ {
+ "location": "/os/core_os/task/os_task_info_get_next/#arguments",
+ "text": "Arguments Description prev Pointer to previous task in task list. If NULL, use first task on list oti Pointer to os_task_info structure where task information will be stored",
+ "title": "Arguments"
+ },
+ {
+ "location": "/os/core_os/task/os_task_info_get_next/#returned-values",
+ "text": "Returns a pointer to the os task structure that was used to populate the task \ninformation structure. NULL means that no tasks were created.",
+ "title": "Returned values"
+ },
+ {
+ "location": "/os/core_os/task/os_task_info_get_next/#example",
+ "text": "void \nget_task_info(void)\n{\n struct os_task *prev_task; \n struct os_task_info oti; \n\n console_printf( Tasks: \\n );\n prev_task = NULL;\n while (1) {\n prev_task = os_task_info_get_next(prev_task, oti);\n if (prev_task == NULL) {\n break;\n }\n\n console_printf( %s (prio: %u, tid: %u, lcheck: %lu, ncheck: %lu, \n flags: 0x%x, ssize: %u, susage: %u, cswcnt: %lu, \n tot_run_time: %lums)\\n ,\n oti.oti_name, oti.oti_prio, oti.oti_taskid, \n (unsigned long)oti.oti_last_checkin,\n (unsigned long)oti.oti_next_checkin, oti.oti_flags,\n oti.oti_stksize, oti.oti_stkusage, (unsigned long)oti.oti_cswcnt,\n (unsigned long)oti.oti_runtime);\n\n }\n}",
+ "title": "Example"
+ },
+ {
"location": "/os/core_os/task/os_task_init/",
- "text": "",
+ "text": "os_task_init\n\n\nint os_task_init(struct os_task *t, char *name, os_task_func_t func, void *arg, \n uint8_t prio, os_time_t sanity_itvl, os_stack_t *stack_bottom, \n uint16_t stack_size)\n\n\n\n\nCalled to create a task. This adds the task object to the list of ready to run \ntasks.\n\n\n\n\nArguments\n\n\n\n\n\n\n\n\nArguments\n\n\nDescription\n\n\n\n\n\n\n\n\n\n\nt\n\n\nPointer to task\n\n\n\n\n\n\nname\n\n\nTask name\n\n\n\n\n\n\nfunc\n\n\nTask function\n\n\n\n\n\n\narg\n\n\nGeneric argument to pass to task\n\n\n\n\n\n\nprio\n\n\nPriority of task\n\n\n\n\n\n\nsanity_itvl\n\n\nThe interval at which the sanity task will check to see if this task is sill alive\n\n\n\n\n\n\nstack_bottom\n\n\nPointer to bottom of stack.\n\n\n\n\n\n\nstack_size\n\n\nThe size of the stack. NOTE: this is not in bytes! It is the number of \nos_stack_t\n elements allocated (generally 32-bits each)\n\n\n\n\n\n\n\n\n\n\nReturned values\n\n\nOS_OK: task in
itialization successful.\n\n\nAll other error codes indicate an internal error.\n\n\n\n\nExample\n\n\n\n /* Create the task */ \n int rc;\n\n os_stack_t my_task_stack[MY_STACK_SIZE];\n\n rc = os_task_init(\nmy_task, \nmy_task\n, my_task_func, NULL, MY_TASK_PRIO, \n OS_WAIT_FOREVER, my_task_stack, MY_STACK_SIZE);\n assert(rc == OS_OK);",
"title": "os_task_init"
},
{
- "location": "/os/core_os/task/os_task_next_id/",
- "text": "",
- "title": "os_task_next_id"
+ "location": "/os/core_os/task/os_task_init/#os_task_init",
+ "text": "int os_task_init(struct os_task *t, char *name, os_task_func_t func, void *arg, \n uint8_t prio, os_time_t sanity_itvl, os_stack_t *stack_bottom, \n uint16_t stack_size) Called to create a task. This adds the task object to the list of ready to run \ntasks.",
+ "title": " os_task_init"
+ },
+ {
+ "location": "/os/core_os/task/os_task_init/#arguments",
+ "text": "Arguments Description t Pointer to task name Task name func Task function arg Generic argument to pass to task prio Priority of task sanity_itvl The interval at which the sanity task will check to see if this task is sill alive stack_bottom Pointer to bottom of stack. stack_size The size of the stack. NOTE: this is not in bytes! It is the number of os_stack_t elements allocated (generally 32-bits each)",
+ "title": "Arguments"
+ },
+ {
+ "location": "/os/core_os/task/os_task_init/#returned-values",
+ "text": "OS_OK: task initialization successful. All other error codes indicate an internal error.",
+ "title": "Returned values"
+ },
+ {
+ "location": "/os/core_os/task/os_task_init/#example",
+ "text": "/* Create the task */ \n int rc;\n\n os_stack_t my_task_stack[MY_STACK_SIZE];\n\n rc = os_task_init( my_task, my_task , my_task_func, NULL, MY_TASK_PRIO, \n OS_WAIT_FOREVER, my_task_stack, MY_STACK_SIZE);\n assert(rc == OS_OK);",
+ "title": "Example"
},
{
"location": "/os/core_os/task/os_task_sanity_checkin/",
- "text": "",
+ "text": "os_task_sanity_checkin\n\n\nint os_task_sanity_checkin(struct os_task *t)\n\n\n\n\nUsed by a task to check in to the sanity task. This informs the sanity task that \n\ntask\n is still alive and working normally.\n\n\n\n\nArguments\n\n\n\n\n\n\n\n\nArguments\n\n\nDescription\n\n\n\n\n\n\n\n\n\n\nt\n\n\nPointer to task\n\n\n\n\n\n\n\n\n\n\nReturned values\n\n\nOS_OK: sanity check-in successful\n\n\nAll other error codes indicate an error.\n\n\n\n\nExample\n\n\n int rc;\n\n rc = os_task_sanity_checkin(\nmy_task); \n assert(rc == OS_OK);",
"title": "os_task_sanity_checkin"
},
{
+ "location": "/os/core_os/task/os_task_sanity_checkin/#os_task_sanity_checkin",
+ "text": "int os_task_sanity_checkin(struct os_task *t) Used by a task to check in to the sanity task. This informs the sanity task that task is still alive and working normally.",
+ "title": " os_task_sanity_checkin"
+ },
+ {
+ "location": "/os/core_os/task/os_task_sanity_checkin/#arguments",
+ "text": "Arguments Description t Pointer to task",
+ "title": "Arguments"
+ },
+ {
+ "location": "/os/core_os/task/os_task_sanity_checkin/#returned-values",
+ "text": "OS_OK: sanity check-in successful All other error codes indicate an error.",
+ "title": "Returned values"
+ },
+ {
+ "location": "/os/core_os/task/os_task_sanity_checkin/#example",
+ "text": "int rc;\n\n rc = os_task_sanity_checkin( my_task); \n assert(rc == OS_OK);",
+ "title": "Example"
+ },
+ {
"location": "/os/core_os/event_queue/event_queue/",
"text": "Event Queues\n\n\nEvent queue is a way of serializing events arring to a task. This makes it easy to queue processing to happen inside task's context. This would be done either from an interrupt handler, or from another task.\n\n\nEvents arrive in a form of a data structure \nstruct os_event\n.\n\n\nDescription\n\n\nEvents are in form of a data structure \nstruct os_event\n, and they are queued to data structure \nstruct os_eventq\n.\n\n\nQueue must be initialized before trying to add events to it. This is done using \nos_eventq_init()\n.\n\n\nCommon way of using event queues is to have a task loop while calling \nos_eventq_get()\n, waiting for work to do.\nOther tasks (or interrupts) then call \nos_eventq_put()\n to wake it up. Once event has been queued task waiting on that queue is woken up, and will get a pointer to queued event structure.\nProcessing task would then act according to event type.\n\n\nWhen \nos_event\n is queued, it should not be freed until
processing task is done with it.\n\n\nIt is assumed that there is only one task consuming events from an event queue. Only one task should be sleeping on a particular \nos_eventq\n at a time.\n\n\nNote that os_callout subsystem assumes that event queue is used as the wakeup mechanism.\n\n\nData structures\n\n\nstruct os_event {\n uint8_t ev_queued;\n uint8_t ev_type;\n void *ev_arg;\n STAILQ_ENTRY(os_event) ev_next;\n};\n\n\n\n\n\n\n\n\n\n\nElement\n\n\nDescription\n\n\n\n\n\n\n\n\n\n\nev_queued\n\n\nInternal field, which tells whether event is linked into an \nos_eventq\n already\n\n\n\n\n\n\nev_type\n\n\nType of an event. This should be unique, as it should be used by processing task to figure out what the event means\n\n\n\n\n\n\nev_arg\n\n\nCan be used further as input to task processing this event\n\n\n\n\n\n\nev_next\n\n\nLinkage attaching this event to an event queue\n\n\n\n\n\n\n\n\nstruct os_eventq {\n struct os_task *evq_task;\n STAILQ_HEAD(, os_event) ev
q_list;\n};\n\n\n\n\n\n\n\n\n\n\nElement\n\n\nDescription\n\n\n\n\n\n\n\n\n\n\nevq_task\n\n\nPointer to task if there is task sleeping on \nos_eventq_get()\n\n\n\n\n\n\nevq_list\n\n\nQueue head for list of events in this queue\n\n\n\n\n\n\n\n\nList of Functions\n\n\nThe functions available in event queue feature are:\n\n\n\n\nos_eventq_get\n\n\nos_eventq_init\n\n\nos_eventq_put\n\n\nos_eventq_put2\n\n\nos_eventq_remove",
"title": "Overview"
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/3c01204d/os/core_os/task/_clear_stack/index.html
----------------------------------------------------------------------
diff --git a/os/core_os/task/_clear_stack/index.html b/os/core_os/task/_clear_stack/index.html
deleted file mode 100644
index e6f54c1..0000000
--- a/os/core_os/task/_clear_stack/index.html
+++ /dev/null
@@ -1,565 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
- <head>
- <meta charset="utf-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
-
-
- <link rel="canonical" href="http://mynewt.apache.org/os/core_os/task/_clear_stack/">
- <link rel="shortcut icon" href="../../../../img/favicon.ico">
-
- <title>_clear_stack - Apache Mynewt</title>
-
- <link href="../../../../css/bootstrap-3.0.3.min.css" rel="stylesheet">
- <link href="../../../../css/font-awesome-4.0.3.css" rel="stylesheet">
- <link rel="stylesheet" href="../../../../css/highlight.css">
- <link href="../../../../css/base.css" rel="stylesheet">
- <link href="../../../../css/custom.css" rel="stylesheet">
- <link href='https://fonts.googleapis.com/css?family=Roboto:400,500,700,900,300,100' rel='stylesheet' type='text/css'>
- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
- <link href="../../../../extra.css" rel="stylesheet">
-
- <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
- <!--[if lt IE 9]>
- <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
- <script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
- <![endif]-->
-
-
- <script>
- (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
- (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
- m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
- })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
-
- ga('create', 'UA-72162311-1', 'mynewt.incubator.apache.org');
- ga('send', 'pageview');
- </script>
-
- </head>
-
-
- <body class="_clear_stack">
-
-
- <div class="navbar navbar-default navbar-fixed-top" role="navigation">
- <div class="logo-container">
- <img src="/img/logo.svg">
- </div>
- <div class="container-fluid">
- <!-- Collapsed navigation -->
- <div class="navbar-header">
- <!-- Expander button -->
- <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
- <span class="sr-only">Toggle navigation</span>
- <span class="icon-bar"></span>
- <span class="icon-bar"></span>
- <span class="icon-bar"></span>
- </button>
-
- </div>
-
- <!-- Expanded navigation -->
- <div class="navbar-collapse collapse">
- <!-- Main navigation -->
- <ul class="nav navbar-nav navbar-right">
- <li>
- <a href="/">Home</a>
- </li>
- <li>
- <a href="/documentation/">Docs</a>
- </li>
- <li>
- <a href="/download/">Download</a>
- </li>
- <li>
- <a href="/community/">Community</a>
- </li>
- <li>
- <a href="/events/">Events</a>
- </li>
- </ul>
-
- <!-- Search, Navigation and Repo links -->
- <ul class="nav navbar-nav navbar-right">
-
- </ul>
- </div>
- </div>
-</div>
-
- <div class="container-fluid">
-
- <div class="row sm-extra-padding">
- <div class="col-md-3 bg-grey sidebar-container"><div class="bs-sidebar hidden-print" role="complementary">
- <div class="sidebar-top">
- <img class="hidden-xs hidden-sm logo-small" src="/img/logo.svg" alt="MyNewt" title="MyNewt">
- <div class="small" role="search">
- <form id ="rtd-search-form" class="wy-form" action="../../../../search.html" method="get">
- <div class="form-group">
- <input type="text" name="q" placeholder="Search documentation" />
- <button class="search-button" type="submit"><i class="fa fa-search"></i></button>
- </div>
- </form>
- </div>
- </div>
- <ul class="nav bs-sidenav">
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- <li><a href="
- ../../../get_started/introduction/
-">Apache Mynewt Manual</a>
-
- <ul class="current-toc">
-
-
-
- <li>
- <a href="../../../get_started/introduction/">Introduction</a>
- </li>
-
-
-
-
-
- <li><a href="
- ../../../get_started/project1/
-">Get Started</a>
-
- </li>
-
-
-
-
- <li><a href="
- ../../../get_acclimated/project2/
-">Tutorials</a>
-
- </li>
-
-
-
-
- <li><a href="
-
-
-
-
- ../../mynewt_os/
-
-
-">Manual</a>
-
- <ul class="current-toc">
-
-
-
- <li><a href="
-
-
- ../../mynewt_os/
-
-">OS Core</a>
-
- <ul class="current-toc">
-
-
-
- <li><a href="
- ../../mynewt_os/
-">OS Fundamentals</a>
-
- </li>
-
-
-
-
- <li><a href="
- ../../context_switch/context_switch/
-">Scheduler</a>
-
- </li>
-
-
-
-
- <li><a href="
- ../../time/time/
-">Time</a>
-
- </li>
-
-
-
-
- <li><a href="
- ../task/
-">Tasks</a>
-
- <ul class="current-toc">
-
-
-
- <li>
- <a href="../task/">Overview</a>
- </li>
-
-
-
-
-
- <li><a href="
- ./
-">Functions</a>
-
- <ul class="current-toc">
-
-
-
- <li class="active">
- _clear_stack
- </li>
-
-
-
-
-
- <li>
- <a href="../os_task_count/">os_task_count</a>
- </li>
-
-
-
-
-
- <li>
- <a href="../os_task_info_get_next/">os_task_info_get_next</a>
- </li>
-
-
-
-
-
- <li>
- <a href="../os_task_init/">os_task_init</a>
- </li>
-
-
-
-
-
- <li>
- <a href="../os_task_next_id/">os_task_next_id</a>
- </li>
-
-
-
-
-
- <li>
- <a href="../os_task_sanity_checkin/">os_task_sanity_checkin</a>
- </li>
-
-
-
- </ul>
-
- </li>
-
-
- </ul>
-
- </li>
-
-
-
-
- <li><a href="
- ../../event_queue/event_queue/
-">Event Queues</a>
-
- </li>
-
-
-
-
- <li><a href="
- ../../semaphore/semaphore/
-">Semaphores</a>
-
- </li>
-
-
-
-
- <li><a href="
- ../../mutex/mutex/
-">Mutexes</a>
-
- </li>
-
-
-
-
- <li><a href="
- ../../memory_pool/memory_pool/
-">Memory Pools</a>
-
- </li>
-
-
-
-
- <li><a href="
- ../../heap/heap/
-">Heap</a>
-
- </li>
-
-
-
-
- <li><a href="
- ../../mbuf/mbuf/
-">Mbufs</a>
-
- </li>
-
-
-
-
- <li><a href="
- ../../sanity/sanity/
-">Sanity</a>
-
- </li>
-
-
-
-
- <li><a href="
- ../../callout/callout/
-">Callouts</a>
-
- </li>
-
-
-
-
- <li>
- <a href="../../port_os/">Porting to other Platforms</a>
- </li>
-
-
-
- </ul>
-
- </li>
-
-
-
-
- <li><a href="
- ../../../modules/console/console/
-">Console</a>
-
- </li>
-
-
-
-
- <li><a href="
- ../../../modules/shell/shell/
-">Shell</a>
-
- </li>
-
-
-
-
- <li><a href="
- ../../../modules/bootloader/bootloader/
-">Bootloader</a>
-
- </li>
-
-
-
-
- <li>
- <a href="../../../modules/filesystem/">File System Abstraction</a>
- </li>
-
-
-
-
-
- <li>
- <a href="../../../modules/nffs/">Newtron Flash File System</a>
- </li>
-
-
-
-
-
- <li><a href="
- ../../../modules/testutil/testutil/
-">Test Utilities</a>
-
- </li>
-
-
-
-
- <li><a href="
- ../../../modules/imgmgr/imgmgr/
-">Image Manager</a>
-
- </li>
-
-
-
-
- <li>
- <a href="../../../modules/baselibc/">Baselibc library</a>
- </li>
-
-
-
-
-
- <li><a href="
- ../../../modules/elua/elua/
-">Embedded Lua</a>
-
- </li>
-
-
-
-
- <li><a href="
- ../../../modules/json/json/
-">JSON</a>
-
- </li>
-
-
- </ul>
-
- </li>
-
-
- </ul>
-
- </li>
-
-
-
-
-
-
- <li><a href="
- ../../../../newt/newt_intro/
-">Newt Tool Manual</a>
-
- </li>
-
-
-
-
-
-
- <li><a href="
- ../../../../newtmgr/overview/
-">Newt Manager Manual</a>
-
- </li>
-
-
-
- </ul>
-</div></div>
-
- <div class="show-sidebar-container">
- <button class="show-sidebar">Docs Menu</button>
- </div>
-
- <div class="col-md-9 documentation-viewer" role="main">
- <div role="navigation" aria-label="breadcrumbs navigation">
- <ul class="wy-breadcrumbs">
- <li><a href="../../../..">Docs</a> »</li>
-
-
-
- <li>Tasks »</li>
-
-
-
- <li>Functions »</li>
-
-
-
- <li>_clear_stack</li>
- <li class="wy-breadcrumbs-aside">
-
- </li>
- </ul>
- <hr/>
-</div>
-
-
-
- </div>
- </div>
-
- <div class="row">
- <footer>
- <div class="row">
- <div class="col-md-12">
-
- <p class="copyright">Copyright © 2015 The Apache Software Foundation, Licensed under the Apache License, Version 2.0 Apache and the Apache feather logo are trademarks of The Apache Software Foundation.<br>The Apache Software Foundation Apache Incubator</p>
-
- </div>
- </div>
- <div class="copyright-logos">
- <div class="row">
- <div class="col-xs-6 text-right">
- <img src="/img/apache-feather.png" alt="Apache" title="Apache">
- </div>
- <div class="col-xs-6 text-left">
- <img src="/img/apache-logo.png" alt="Apache Incubator" title="Apache Incubator">
- </div>
- </div>
- </div>
- <div class="row">
- <div class="col-md-12">
- <small class="footnote">
- MyNewt is an effort undergoing incubation at The Apache Software Foundation (ASF), sponsored by the Apache Incubator. Incubation is required of all newly accepted projects until a further review indicates that the infrastructure, communications, and decision making process have stabilized in a manner consistent with other successful ASF projects. While incubation status is not necessarily a reflection of the completeness or stability of the code, it does indicate that the project has yet to be fully endorsed by the ASF.
- </small>
- </div>
- </div>
-</footer>
- </div>
- </div>
-
- <script src="../../../../js/jquery-1.10.2.min.js"></script>
- <script src="../../../../js/bootstrap-3.0.3.min.js"></script>
- <script src="../../../../js/highlight.pack.js"></script>
- <script src="../../../../js/base.js"></script>
- <script src="../../../../js/custom.js"></script>
-
- </body>
-</html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/3c01204d/os/core_os/task/os_task_count/index.html
----------------------------------------------------------------------
diff --git a/os/core_os/task/os_task_count/index.html b/os/core_os/task/os_task_count/index.html
index 3180d2e..2e5209c 100644
--- a/os/core_os/task/os_task_count/index.html
+++ b/os/core_os/task/os_task_count/index.html
@@ -222,21 +222,13 @@
<li><a href="
- ../_clear_stack/
+ ./
">Functions</a>
<ul class="current-toc">
- <li>
- <a href="../_clear_stack/">_clear_stack</a>
- </li>
-
-
-
-
-
<li class="active">
os_task_count
</li>
@@ -262,14 +254,6 @@
<li>
- <a href="../os_task_next_id/">os_task_next_id</a>
- </li>
-
-
-
-
-
- <li>
<a href="../os_task_sanity_checkin/">os_task_sanity_checkin</a>
</li>
@@ -520,7 +504,26 @@
<hr/>
</div>
-
+ <h2 id="os_task_count"><font color="F2853F" style="font-size:24pt"> os_task_count</font><a class="headerlink" href="#os_task_count" title="Permanent link">¶</a></h2>
+<pre><code class="no-highlight">uint8_t os_task_count(void);
+</code></pre>
+
+<p>Returns the number of tasks that have been created. </p>
+<p><br></p>
+<h4 id="arguments">Arguments<a class="headerlink" href="#arguments" title="Permanent link">¶</a></h4>
+<p>None</p>
+<p><br></p>
+<h4 id="returned-values">Returned values<a class="headerlink" href="#returned-values" title="Permanent link">¶</a></h4>
+<p>unsigned 8-bit integer representing number of tasks created</p>
+<p><br></p>
+<h4 id="example">Example<a class="headerlink" href="#example" title="Permanent link">¶</a></h4>
+<pre><code class="no-highlight">
+ uint8_t num_tasks;
+
+ num_tasks = os_task_count();
+</code></pre>
+
+<hr />
</div>
</div>
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/3c01204d/os/core_os/task/os_task_info_get_next/index.html
----------------------------------------------------------------------
diff --git a/os/core_os/task/os_task_info_get_next/index.html b/os/core_os/task/os_task_info_get_next/index.html
index 386e8a6..b5ad2c6 100644
--- a/os/core_os/task/os_task_info_get_next/index.html
+++ b/os/core_os/task/os_task_info_get_next/index.html
@@ -222,7 +222,7 @@
<li><a href="
- ../_clear_stack/
+ ../os_task_count/
">Functions</a>
<ul class="current-toc">
@@ -230,14 +230,6 @@
<li>
- <a href="../_clear_stack/">_clear_stack</a>
- </li>
-
-
-
-
-
- <li>
<a href="../os_task_count/">os_task_count</a>
</li>
@@ -262,14 +254,6 @@
<li>
- <a href="../os_task_next_id/">os_task_next_id</a>
- </li>
-
-
-
-
-
- <li>
<a href="../os_task_sanity_checkin/">os_task_sanity_checkin</a>
</li>
@@ -520,7 +504,72 @@
<hr/>
</div>
-
+ <h2 id="os_task_info_get_next"><font color="F2853F" style="font-size:24pt"> os_task_info_get_next</font><a class="headerlink" href="#os_task_info_get_next" title="Permanent link">¶</a></h2>
+<pre><code class="no-highlight">struct os_task *os_task_info_get_next(const struct os_task *prev, struct os_task_info *oti);
+</code></pre>
+
+<p>Populates the os task info structure pointed to by <em>oti</em> with task information.
+The task populating the <em>oti</em> structure is either the first task on the task
+list if <em>prev</em> is NULL, or the next task in the task list (the next pointer of
+<em>prev</em>).</p>
+<p>If there are no tasks initialized, NULL is returned. Otherwise, the task
+structure used to populate <em>oti</em> is returned.</p>
+<p><br></p>
+<h4 id="arguments">Arguments<a class="headerlink" href="#arguments" title="Permanent link">¶</a></h4>
+<table>
+<thead>
+<tr>
+<th>Arguments</th>
+<th>Description</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td>prev</td>
+<td>Pointer to previous task in task list. If NULL, use first task on list</td>
+</tr>
+<tr>
+<td>oti</td>
+<td>Pointer to <code>os_task_info</code> structure where task information will be stored</td>
+</tr>
+</tbody>
+</table>
+<p><br></p>
+<h4 id="returned-values">Returned values<a class="headerlink" href="#returned-values" title="Permanent link">¶</a></h4>
+<p>Returns a pointer to the os task structure that was used to populate the task
+information structure. NULL means that no tasks were created.</p>
+<p><br></p>
+<h4 id="example">Example<a class="headerlink" href="#example" title="Permanent link">¶</a></h4>
+<pre><code class="no-highlight">
+void
+get_task_info(void)
+{
+ struct os_task *prev_task;
+ struct os_task_info oti;
+
+ console_printf("Tasks: \n");
+ prev_task = NULL;
+ while (1) {
+ prev_task = os_task_info_get_next(prev_task, &oti);
+ if (prev_task == NULL) {
+ break;
+ }
+
+ console_printf(" %s (prio: %u, tid: %u, lcheck: %lu, ncheck: %lu, "
+ "flags: 0x%x, ssize: %u, susage: %u, cswcnt: %lu, "
+ "tot_run_time: %lums)\n",
+ oti.oti_name, oti.oti_prio, oti.oti_taskid,
+ (unsigned long)oti.oti_last_checkin,
+ (unsigned long)oti.oti_next_checkin, oti.oti_flags,
+ oti.oti_stksize, oti.oti_stkusage, (unsigned long)oti.oti_cswcnt,
+ (unsigned long)oti.oti_runtime);
+
+ }
+}
+
+</code></pre>
+
+<hr />
</div>
</div>
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/3c01204d/os/core_os/task/os_task_init/index.html
----------------------------------------------------------------------
diff --git a/os/core_os/task/os_task_init/index.html b/os/core_os/task/os_task_init/index.html
index 07ef832..cd51d80 100644
--- a/os/core_os/task/os_task_init/index.html
+++ b/os/core_os/task/os_task_init/index.html
@@ -222,7 +222,7 @@
<li><a href="
- ../_clear_stack/
+ ../os_task_count/
">Functions</a>
<ul class="current-toc">
@@ -230,14 +230,6 @@
<li>
- <a href="../_clear_stack/">_clear_stack</a>
- </li>
-
-
-
-
-
- <li>
<a href="../os_task_count/">os_task_count</a>
</li>
@@ -262,14 +254,6 @@
<li>
- <a href="../os_task_next_id/">os_task_next_id</a>
- </li>
-
-
-
-
-
- <li>
<a href="../os_task_sanity_checkin/">os_task_sanity_checkin</a>
</li>
@@ -520,7 +504,76 @@
<hr/>
</div>
-
+ <h2 id="os_task_init"><font color="F2853F" style="font-size:24pt"> os_task_init</font><a class="headerlink" href="#os_task_init" title="Permanent link">¶</a></h2>
+<pre><code class="no-highlight">int os_task_init(struct os_task *t, char *name, os_task_func_t func, void *arg,
+ uint8_t prio, os_time_t sanity_itvl, os_stack_t *stack_bottom,
+ uint16_t stack_size)
+</code></pre>
+
+<p>Called to create a task. This adds the task object to the list of ready to run
+tasks.</p>
+<p><br></p>
+<h4 id="arguments">Arguments<a class="headerlink" href="#arguments" title="Permanent link">¶</a></h4>
+<table>
+<thead>
+<tr>
+<th>Arguments</th>
+<th>Description</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td>t</td>
+<td>Pointer to task</td>
+</tr>
+<tr>
+<td>name</td>
+<td>Task name</td>
+</tr>
+<tr>
+<td>func</td>
+<td>Task function</td>
+</tr>
+<tr>
+<td>arg</td>
+<td>Generic argument to pass to task</td>
+</tr>
+<tr>
+<td>prio</td>
+<td>Priority of task</td>
+</tr>
+<tr>
+<td>sanity_itvl</td>
+<td>The interval at which the sanity task will check to see if this task is sill alive</td>
+</tr>
+<tr>
+<td>stack_bottom</td>
+<td>Pointer to bottom of stack.</td>
+</tr>
+<tr>
+<td>stack_size</td>
+<td>The size of the stack. NOTE: this is not in bytes! It is the number of <code>os_stack_t</code> elements allocated (generally 32-bits each)</td>
+</tr>
+</tbody>
+</table>
+<p><br></p>
+<h4 id="returned-values">Returned values<a class="headerlink" href="#returned-values" title="Permanent link">¶</a></h4>
+<p>OS_OK: task initialization successful.</p>
+<p>All other error codes indicate an internal error.</p>
+<p><br></p>
+<h4 id="example">Example<a class="headerlink" href="#example" title="Permanent link">¶</a></h4>
+<pre><code class="no-highlight">
+ /* Create the task */
+ int rc;
+
+ os_stack_t my_task_stack[MY_STACK_SIZE];
+
+ rc = os_task_init(&my_task, "my_task", my_task_func, NULL, MY_TASK_PRIO,
+ OS_WAIT_FOREVER, my_task_stack, MY_STACK_SIZE);
+ assert(rc == OS_OK);
+</code></pre>
+
+<hr />
</div>
</div>