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/28 22:25:15 UTC

[1/3] incubator-mynewt-site git commit: MYNEWT-145

Repository: incubator-mynewt-site
Updated Branches:
  refs/heads/master 54acee1f9 -> 3b429b6c9


MYNEWT-145

added documentation for os_time.  Also moved the time.md file to os_time.md to be consistent with the nomenclature


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/04d242e2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/tree/04d242e2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/diff/04d242e2

Branch: refs/heads/master
Commit: 04d242e23703e9345a5d68690f844221ffa2c95a
Parents: 82d6d2c
Author: Paul Dietrich <pa...@yahoo.com>
Authored: Fri Feb 26 13:51:07 2016 -0800
Committer: Paul Dietrich <pa...@yahoo.com>
Committed: Fri Feb 26 13:51:07 2016 -0800

----------------------------------------------------------------------
 docs/os/core_os/time/os_time.md       | 44 ++++++++++++++++++++++++++++++
 docs/os/core_os/time/os_time_delay.md | 30 ++++++++++++++++++++
 docs/os/core_os/time/os_time_get.md   | 28 +++++++++++++++++++
 docs/os/core_os/time/os_time_tick.md  | 29 ++++++++++++++++++++
 docs/os/core_os/time/time.md          | 21 --------------
 mkdocs.yml                            |  2 +-
 6 files changed, 132 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/04d242e2/docs/os/core_os/time/os_time.md
----------------------------------------------------------------------
diff --git a/docs/os/core_os/time/os_time.md b/docs/os/core_os/time/os_time.md
new file mode 100644
index 0000000..1e5fd39
--- /dev/null
+++ b/docs/os/core_os/time/os_time.md
@@ -0,0 +1,44 @@
+# OS_Time
+
+
+The system time for ther Mynewt OS.
+
+## Description
+
+The Mynewt OS contains an incrementing time that drives the OS scheduler and time delays. The time is a fixed size (e.g. 32 bits) and will eventually wrap back to zero. The time to wrap from zero back to zero is called the **OS time epoch**. 
+
+The frequency of the OS time tick is specicied in the architecture-specific OS code `os_arch.h` and is named `OS_TICKS_PER_SEC`.
+
+## Data Structures
+
+Time is stored in Mynewt as an `os_time_t` value. 
+
+
+## List of Functions
+
+The functions available in time are:
+
+* [os_time_delay](os_time_delay.md)
+* [os_time_get](os_time_get.md)
+* [os_time_tick](os_time_tick.md)
+
+## List of Macros
+
+Several macros help with the evalution of times with respect to each other.
+
+* `OS_TIME_TICK_LT(t1,t2)` -- evaluates to true if t1 is before t2 in time.
+* `OS_TIME_TICK_GT(t1,t2)` -- evaluates to true if t1 is after t2 in time 
+* `OS_TIME_TICK_GEQ(t1,t2)` -- evaluates to true if t1 is on or after t2 in time.
+
+NOTE:  For all of these macros the calculations are done modulo 'os_time_t'.  
+
+Ensure that comparison of OS time always uses the macros above (to compensate for the possible wrap of OS time)
+
+##Special Notes
+
+Its important to understand how quickly the time wraps especailly when doing time comparison using the macros above (or by any other means). 
+
+For example, if a tick is 1 millisecond and `os_time_t` is 32-bits the OS time will wrap back to zero in about 49.7 days or stated another way, the OS time epoch is 49.7 days.
+
+If two times are more than 1/2 the OS time epoch apart, any time comparison will be incorrect.  Ensure at design time that comparisons will not occur between times that are more than half the OS time epoch
+

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/04d242e2/docs/os/core_os/time/os_time_delay.md
----------------------------------------------------------------------
diff --git a/docs/os/core_os/time/os_time_delay.md b/docs/os/core_os/time/os_time_delay.md
index e69de29..35deb7d 100644
--- a/docs/os/core_os/time/os_time_delay.md
+++ b/docs/os/core_os/time/os_time_delay.md
@@ -0,0 +1,30 @@
+## <font color="F2853F" style="font-size:24pt">os_time_delay</font>
+
+```no-highlight
+void os_time_delay(int32_t ticks) 
+```
+
+#### Arguments
+
+| Arguments | Description |
+|-----------|-------------|
+| ticks |  Number of ticks to delay. Less than or equal to zero means no delay  |
+
+#### Returned values
+
+N/A
+
+#### Notes 
+
+Passing `OS_TIMEOUT_NEVER` to this function will not block indefinitely but will return immediately.  Passing delays larger than 1/2 the OS time epoch should be avoided; behavior is unpredictable.
+
+#### Example
+
+<Add text to set up the context for the example here>
+
+```no-highlight
+    /* delay 3 seconds */
+    int32_t delay = OS_TICKS_PER_SEC * 3;
+    os_time_delay(delay);
+```
+---------------------

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/04d242e2/docs/os/core_os/time/os_time_get.md
----------------------------------------------------------------------
diff --git a/docs/os/core_os/time/os_time_get.md b/docs/os/core_os/time/os_time_get.md
index e69de29..d496325 100644
--- a/docs/os/core_os/time/os_time_get.md
+++ b/docs/os/core_os/time/os_time_get.md
@@ -0,0 +1,28 @@
+## <font color="F2853F" style="font-size:24pt">os_time_get</font>
+
+```no-highlight
+os_time_t os_time_get(void) 
+```
+
+
+#### Arguments
+
+N/A
+
+#### Returned values
+
+The current value of the OS time
+
+#### Notes 
+
+See the [Special Notes](os_time) on OS time epoch and comparison
+
+#### Example
+
+<Add text to set up the context for the example here>
+
+```no-highlight
+   os_time_t now = os_time_get();
+```
+
+---------------------

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/04d242e2/docs/os/core_os/time/os_time_tick.md
----------------------------------------------------------------------
diff --git a/docs/os/core_os/time/os_time_tick.md b/docs/os/core_os/time/os_time_tick.md
index e69de29..c0cc0e1 100644
--- a/docs/os/core_os/time/os_time_tick.md
+++ b/docs/os/core_os/time/os_time_tick.md
@@ -0,0 +1,29 @@
+## <font color="F2853F" style="font-size:24pt">os_time_tick</font>
+
+```no-highlight
+void os_time_tick(void) 
+```
+
+Increments the OS time tick for the system.  Typically, this is called in one place by the architecture specific OS code (`libs/os/arch`) `timer_handler` which is in turn called by the BSP specific code assgined to drive the OS timer tick. See [Porting Mynewt OS](../port_os) for details.
+
+#### Arguments
+
+N/A
+
+#### Returned values
+
+N/A
+
+#### Notes 
+
+Called for every single tick by the architecture specific functions.
+
+#### Example
+
+<Add text to set up the context for the example here>
+
+```no-highlight
+   os_time_tick();
+```
+
+---------------------

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/04d242e2/docs/os/core_os/time/time.md
----------------------------------------------------------------------
diff --git a/docs/os/core_os/time/time.md b/docs/os/core_os/time/time.md
deleted file mode 100644
index 7de2b6a..0000000
--- a/docs/os/core_os/time/time.md
+++ /dev/null
@@ -1,21 +0,0 @@
-# Time
-
-
-Insert synopsis here
-
-
-## Description
-
-Describe OS feature here 
-
-## Data structures
-
-Replace this with the list of data structures used, why, any neat features
-
-## List of Functions
-
-The functions available in time are:
-
-* [os_time_delay](os_time_delay.md)
-* [os_time_get](os_time_get.md)
-* [os_time_tick](os_time_tick.md)

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/04d242e2/mkdocs.yml
----------------------------------------------------------------------
diff --git a/mkdocs.yml b/mkdocs.yml
index dd291b9..e59b069 100644
--- a/mkdocs.yml
+++ b/mkdocs.yml
@@ -40,7 +40,7 @@ pages:
                     - 'os_sched_sleep': 'os/core_os/context_switch/os_sched_sleep.md'
                     - 'os_sched_wakeup': 'os/core_os/context_switch/os_sched_wakeup.md'
             - Time: 
-                - 'Overview': 'os/core_os/time/time.md'
+                - 'Overview': 'os/core_os/time/os_time.md'
                 - 'Functions':
                     - 'os_time_delay': 'os/core_os/time/os_time_delay.md'
                     - 'os_time_get': 'os/core_os/time/os_time_get.md'


[3/3] incubator-mynewt-site git commit: Documentation for system time. minor typo edits. This closes #13 .

Posted by ad...@apache.org.
Documentation for system time. minor  typo edits. This closes #13 .


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/3b429b6c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/tree/3b429b6c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/diff/3b429b6c

Branch: refs/heads/master
Commit: 3b429b6c9b22e508b7ee5790d9907622797acf5a
Parents: aa303f2
Author: aditihilbert <ad...@runtime.io>
Authored: Sun Feb 28 13:24:45 2016 -0800
Committer: aditihilbert <ad...@runtime.io>
Committed: Sun Feb 28 13:24:45 2016 -0800

----------------------------------------------------------------------
 docs/os/core_os/port_os.md           | 2 +-
 docs/os/core_os/time/os_time.md      | 8 ++++----
 docs/os/core_os/time/os_time_tick.md | 2 +-
 3 files changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/3b429b6c/docs/os/core_os/port_os.md
----------------------------------------------------------------------
diff --git a/docs/os/core_os/port_os.md b/docs/os/core_os/port_os.md
index 32b8972..63c3ecb 100644
--- a/docs/os/core_os/port_os.md
+++ b/docs/os/core_os/port_os.md
@@ -1,7 +1,7 @@
 # Porting Mynewt OS
 
 
-This chapter describes how to adapt Newt OS to different processors. 
+This chapter describes how to adapt the Mynewt OS to different processors. 
 
 
 ## Description

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/3b429b6c/docs/os/core_os/time/os_time.md
----------------------------------------------------------------------
diff --git a/docs/os/core_os/time/os_time.md b/docs/os/core_os/time/os_time.md
index 1e5fd39..d11a6fe 100644
--- a/docs/os/core_os/time/os_time.md
+++ b/docs/os/core_os/time/os_time.md
@@ -7,7 +7,7 @@ The system time for ther Mynewt OS.
 
 The Mynewt OS contains an incrementing time that drives the OS scheduler and time delays. The time is a fixed size (e.g. 32 bits) and will eventually wrap back to zero. The time to wrap from zero back to zero is called the **OS time epoch**. 
 
-The frequency of the OS time tick is specicied in the architecture-specific OS code `os_arch.h` and is named `OS_TICKS_PER_SEC`.
+The frequency of the OS time tick is specified in the architecture-specific OS code `os_arch.h` and is named `OS_TICKS_PER_SEC`.
 
 ## Data Structures
 
@@ -34,11 +34,11 @@ NOTE:  For all of these macros the calculations are done modulo 'os_time_t'.
 
 Ensure that comparison of OS time always uses the macros above (to compensate for the possible wrap of OS time)
 
-##Special Notes
+## Special Notes
 
-Its important to understand how quickly the time wraps especailly when doing time comparison using the macros above (or by any other means). 
+Its important to understand how quickly the time wraps especially when doing time comparison using the macros above (or by any other means). 
 
 For example, if a tick is 1 millisecond and `os_time_t` is 32-bits the OS time will wrap back to zero in about 49.7 days or stated another way, the OS time epoch is 49.7 days.
 
-If two times are more than 1/2 the OS time epoch apart, any time comparison will be incorrect.  Ensure at design time that comparisons will not occur between times that are more than half the OS time epoch
+If two times are more than 1/2 the OS time epoch apart, any time comparison will be incorrect.  Ensure at design time that comparisons will not occur between times that are more than half the OS time epoch.
 

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/3b429b6c/docs/os/core_os/time/os_time_tick.md
----------------------------------------------------------------------
diff --git a/docs/os/core_os/time/os_time_tick.md b/docs/os/core_os/time/os_time_tick.md
index c0cc0e1..011f3d1 100644
--- a/docs/os/core_os/time/os_time_tick.md
+++ b/docs/os/core_os/time/os_time_tick.md
@@ -4,7 +4,7 @@
 void os_time_tick(void) 
 ```
 
-Increments the OS time tick for the system.  Typically, this is called in one place by the architecture specific OS code (`libs/os/arch`) `timer_handler` which is in turn called by the BSP specific code assgined to drive the OS timer tick. See [Porting Mynewt OS](../port_os) for details.
+Increments the OS time tick for the system.  Typically, this is called in one place by the architecture specific OS code (`libs/os/arch`) `timer_handler` which is in turn called by the BSP specific code assigned to drive the OS timer tick. See [Porting Mynewt OS](../port_os) for details.
 
 #### Arguments
 


[2/3] incubator-mynewt-site git commit: Merge branch 'MYNEWT-145' of https://github.com/paulfdietrich/incubator-mynewt-site

Posted by ad...@apache.org.
Merge branch 'MYNEWT-145' of https://github.com/paulfdietrich/incubator-mynewt-site


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/aa303f24
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/tree/aa303f24
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/diff/aa303f24

Branch: refs/heads/master
Commit: aa303f240404668e165ffcef5be2c89f6fbcfee2
Parents: 54acee1 04d242e
Author: aditihilbert <ad...@runtime.io>
Authored: Sun Feb 28 13:03:41 2016 -0800
Committer: aditihilbert <ad...@runtime.io>
Committed: Sun Feb 28 13:03:41 2016 -0800

----------------------------------------------------------------------
 docs/os/core_os/time/os_time.md       | 44 ++++++++++++++++++++++++++++++
 docs/os/core_os/time/os_time_delay.md | 30 ++++++++++++++++++++
 docs/os/core_os/time/os_time_get.md   | 28 +++++++++++++++++++
 docs/os/core_os/time/os_time_tick.md  | 29 ++++++++++++++++++++
 docs/os/core_os/time/time.md          | 21 --------------
 mkdocs.yml                            |  2 +-
 6 files changed, 132 insertions(+), 22 deletions(-)
----------------------------------------------------------------------