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 2017/02/01 06:49:26 UTC

[1/5] incubator-mynewt-site git commit: Updated Air Qiuality Tutorial

Repository: incubator-mynewt-site
Updated Branches:
  refs/heads/develop b6a327e50 -> 003ca1961


Updated Air Qiuality Tutorial


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

Branch: refs/heads/develop
Commit: 443b202af55efc1569611f54301abee2eda35897
Parents: b6a327e
Author: David G. Simmons <sa...@mac.com>
Authored: Tue Jan 31 12:31:36 2017 -0500
Committer: David G. Simmons <sa...@mac.com>
Committed: Tue Jan 31 12:32:00 2017 -0500

----------------------------------------------------------------------
 docs/os/tutorials/air_quality_ble.md    | 45 ++++++++++++++--------------
 docs/os/tutorials/air_quality_sensor.md | 26 ++++++++++------
 2 files changed, 40 insertions(+), 31 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/443b202a/docs/os/tutorials/air_quality_ble.md
----------------------------------------------------------------------
diff --git a/docs/os/tutorials/air_quality_ble.md b/docs/os/tutorials/air_quality_ble.md
index 7497d19..5d4c8f2 100644
--- a/docs/os/tutorials/air_quality_ble.md
+++ b/docs/os/tutorials/air_quality_ble.md
@@ -18,19 +18,19 @@ First, we'll define the GATT Services in `apps/air_quality/src/bleprph.h`.
 ```c
 /* Sensor Data */
 /* e761d2af-1c15-4fa7-af80-b5729002b340 */
-static const uint8_t gatt_svr_svc_co2_uuid[16] = {
-    0x40, 0xb3, 0x20, 0x90, 0x72, 0xb5, 0x80, 0xaf,
-    0xa7, 0x4f, 0x15, 0x1c, 0xaf, 0xd2, 0x61, 0xe7 };
+static const ble_uuid128_t gatt_svr_svc_co2_uuid =
+    BLE_UUID128_INIT(0x40, 0xb3, 0x20, 0x90, 0x72, 0xb5, 0x80, 0xaf,
+                     0xa7, 0x4f, 0x15, 0x1c, 0xaf, 0xd2, 0x61, 0xe7);
 #define CO2_SNS_TYPE          0xDEAD
 #define CO2_SNS_STRING "SenseAir K30 CO2 Sensor"
-#define CO2_SNS_VAL               0xBEAD
+#define CO2_SNS_VAL           0xBEAD
 
 uint16_t gatt_co2_val; 
 ```
 
 You can use any hex values you choose for the sensor type and sensor values, and you can 
 even forget the sensor type and sensor string definitions altogether but they make
-the results look nice in our Bleutooth App.
+the results look nice in our Bluetooth App for Mac OS X and iOS.
 
 Next we'll add those services to `apps/air_quality/src/gatt_svr.c`.
 
@@ -51,15 +51,15 @@ static const struct ble_gatt_svc_def gatt_svr_svcs[] = {
     {
         /*** Service: Security test. */
         .type = BLE_GATT_SVC_TYPE_PRIMARY,
-        .uuid128 = gatt_svr_svc_sec_test_uuid,
+        .uuid = &gatt_svr_svc_sec_test_uuid.u,
         .characteristics = (struct ble_gatt_chr_def[]) { {
             /*** Characteristic: Random number generator. */
-            .uuid128 = gatt_svr_chr_sec_test_rand_uuid,
+            .uuid = &gatt_svr_chr_sec_test_rand_uuid.u,
             .access_cb = gatt_svr_chr_access_sec_test,
             .flags = BLE_GATT_CHR_F_READ | BLE_GATT_CHR_F_READ_ENC,
         }, {
             /*** Characteristic: Static value. */
-            .uuid128 = gatt_svr_chr_sec_test_static_uuid,
+            .uuid = &gatt_svr_chr_sec_test_static_uuid,.u
             .access_cb = gatt_svr_chr_access_sec_test,
             .flags = BLE_GATT_CHR_F_READ |
                      BLE_GATT_CHR_F_WRITE | BLE_GATT_CHR_F_WRITE_ENC,
@@ -70,29 +70,31 @@ static const struct ble_gatt_svc_def gatt_svr_svcs[] = {
         {
             /*** CO2 Level Notification Service. */
             .type = BLE_GATT_SVC_TYPE_PRIMARY,
-            .uuid128 = gatt_svr_svc_co2_uuid,
+            .uuid = &gatt_svr_svc_co2_uuid.u,
             .characteristics = (struct ble_gatt_chr_def[]) { {
-                .uuid128 = BLE_UUID16(CO2_SNS_TYPE),
+                .uuid = BLE_UUID16_DECLARE(CO2_SNS_TYPE),
                 .access_cb = gatt_svr_sns_access,
                 .flags = BLE_GATT_CHR_F_READ,
             }, {
-                .uuid128 = BLE_UUID16(CO2_SNS_VAL),
+                .uuid = BLE_UUID16_DECLARE(CO2_SNS_VAL),
                 .access_cb = gatt_svr_sns_access,
                 .flags = BLE_GATT_CHR_F_NOTIFY,
             }, {
                 0, /* No more characteristics in this service. */
             } },
         },
-    {
-        0, /* No more services. */
-    },
-};
+
+        {
+            0, /* No more services. */
+        },
+    };
+            
 ```
 
 Next we need to tell the GATT Server how to handle requests for CO<sub>2</sub> readings :
 
 ```c
-static int
+sstatic int
 gatt_svr_sns_access(uint16_t conn_handle, uint16_t attr_handle,
                           struct ble_gatt_access_ctxt *ctxt,
                           void *arg)
@@ -100,8 +102,7 @@ gatt_svr_sns_access(uint16_t conn_handle, uint16_t attr_handle,
     uint16_t uuid16;
     int rc;
 
-    uuid16 = ble_uuid_128_to_16(ctxt->chr->uuid128);
-    assert(uuid16 != 0);
+    uuid16 = ble_uuid_u16(ctxt->chr->uuid);
 
     switch (uuid16) {
     case CO2_SNS_TYPE:
@@ -109,7 +110,7 @@ gatt_svr_sns_access(uint16_t conn_handle, uint16_t attr_handle,
         rc = os_mbuf_append(ctxt->om, CO2_SNS_STRING, sizeof CO2_SNS_STRING);
         BLEPRPH_LOG(INFO, "CO2 SENSOR TYPE READ: %s\n", CO2_SNS_STRING);
         return rc == 0 ? 0 : BLE_ATT_ERR_INSUFFICIENT_RES;
-    
+
     case CO2_SNS_VAL:
         if (ctxt->op == BLE_GATT_ACCESS_OP_WRITE_CHR) {
             rc = gatt_svr_chr_write(ctxt->om, 0,
@@ -122,11 +123,11 @@ gatt_svr_sns_access(uint16_t conn_handle, uint16_t attr_handle,
                                 sizeof gatt_co2_val);
             return rc == 0 ? 0 : BLE_ATT_ERR_INSUFFICIENT_RES;
         }
-    
+
     default:
         assert(0);
         return BLE_ATT_ERR_UNLIKELY;
-    }                              
+    }
 }
 ```
 
@@ -197,7 +198,7 @@ co2_read_event(void)
         goto err;
     }
     gatt_co2_val = value;
-    rc = ble_gatts_find_chr(gatt_svr_svc_co2_uuid, BLE_UUID16(CO2_SNS_VAL), NULL, &chr_val_handle);
+    rc = ble_gatts_find_chr(&gatt_svr_svc_co2_uuid.u, BLE_UUID16_DECLARE(CO2_SNS_VAL), NULL, &chr_val_handle);
     assert(rc == 0);
     ble_gatts_chr_updated(chr_val_handle);
     return (0);

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/443b202a/docs/os/tutorials/air_quality_sensor.md
----------------------------------------------------------------------
diff --git a/docs/os/tutorials/air_quality_sensor.md b/docs/os/tutorials/air_quality_sensor.md
index 3e94a7e..72bc561 100644
--- a/docs/os/tutorials/air_quality_sensor.md
+++ b/docs/os/tutorials/air_quality_sensor.md
@@ -172,9 +172,11 @@ pkg.author: "Apache Mynewt <de...@mynewt.incubator.apache.org>"
 pkg.homepage: "http://mynewt.apache.org/"
 pkg.keywords:
 
-pkg.deps:
+pkg.deps: 
     - "@apache-mynewt-core/kernel/os"
-    - "@apache-mynewt-core/sys/log"
+    - "@apache-mynewt-core/sys/shell"
+    - "@apache-mynewt-core/sys/stats/full"
+    - "@apache-mynewt-core/sys/log/full"
     - "@apache-mynewt-core/mgmt/newtmgr"
     - "@apache-mynewt-core/mgmt/newtmgr/transport/ble"
     - "@apache-mynewt-core/net/nimble/controller"
@@ -185,7 +187,6 @@ pkg.deps:
     - "@apache-mynewt-core/net/nimble/host/store/ram"
     - "@apache-mynewt-core/net/nimble/transport/ram"
     - "@apache-mynewt-core/sys/console/full"
-    - "@apache-mynewt-core/libc/baselibc"
     - "@apache-mynewt-core/sys/sysinit"
     - "@apache-mynewt-core/sys/id"
 ```
@@ -244,8 +245,15 @@ Now you can add the files you need. You'll need a pkg.yml to describe the driver
 # under the License.
 #
 pkg.name: libs/my_drivers/senseair
+pkg.description: Host side of the nimble Bluetooth Smart stack.
+pkg.author: "Apache Mynewt <de...@mynewt.incubator.apache.org>"
+pkg.homepage: "http://mynewt.apache.org/"
+pkg.keywords:
+    - ble
+    - bluetooth
+
 pkg.deps:
-    - "@apache-mynewt-core/hw/hal"
+    - "@apache-mynewt-core/kernel/os"
 ```
 
 ```no-highlight
@@ -325,8 +333,8 @@ pkg.deps:
     - "@apache-mynewt-core/libs/os"
     - "@apache-mynewt-core/libs/shell"
     - "@apache-mynewt-core/sys/config"
-    - "@apache-mynewt-core/sys/log"
-    - "@apache-mynewt-core/sys/stats"
+    - "@apache-mynewt-core/sys/log/full"
+    - "@apache-mynewt-core/sys/stats/full"
     - "@apache-mynewt-core/libs/baselibc"
     - libs/my_drivers/senseair
 ```
@@ -772,7 +780,7 @@ senseair_init(int uartno)
 }
 ```
 
-And your modified your main() for senseair driver init.
+And your modified main() for senseair driver init.
 
 ```c
 int
@@ -802,8 +810,8 @@ Here's what your SenseAir board should look like once it's wired up:
 
 Now that you have that wired up, let's get the Arduino Primo wired up. A couple of things to note:
 
-* The Arduino Primo's 'console' UART is actually UART1. The secondary (bit-banged) UART is 
-UART0, so that's where we'll have to hook up the SenseAir.
+* The Arduino Primo's 'console' UART is actually UART1. 
+* The secondary (bit-banged) UART is UART0, so that's where we'll have to hook up the SenseAir.
 
 Here's what your Arduino Primo should now look like with everything wired in:
 


[3/5] incubator-mynewt-site git commit: Merge branch 'air_q_ble' of https://github.com/davidgs/incubator-mynewt-site into develop

Posted by ad...@apache.org.
Merge branch 'air_q_ble' of https://github.com/davidgs/incubator-mynewt-site into develop

This closes #146. This closes #147.


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

Branch: refs/heads/develop
Commit: 28b0e4289141034b5f35c680ace46494c924708d
Parents: def3e5d 443b202
Author: aditihilbert <ad...@runtime.io>
Authored: Tue Jan 31 22:29:14 2017 -0800
Committer: aditihilbert <ad...@runtime.io>
Committed: Tue Jan 31 22:29:14 2017 -0800

----------------------------------------------------------------------
 docs/os/tutorials/air_quality_ble.md    | 45 ++++++++++++++--------------
 docs/os/tutorials/air_quality_sensor.md | 26 ++++++++++------
 2 files changed, 40 insertions(+), 31 deletions(-)
----------------------------------------------------------------------



[2/5] incubator-mynewt-site git commit: Update Docs for new system start up and initialization implementation. 1) Updated System Configuration and Initialization Document for new system initialization implementation. 2) Updated Validation and Error Messa

Posted by ad...@apache.org.
Update Docs for new system start up and initialization implementation.
1) Updated System Configuration and Initialization Document for new system initialization implementation.
2) Updated Validation and Error Messages page to use Priority Violation Error Message.
3) Updated Enable Newtmgr in any app to reflect new system initialization implementation and in the code change for bletiny app.
4) Updated examples that use sys/log to sys/log/full.


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

Branch: refs/heads/develop
Commit: def3e5db56672079b5f03427c2560f4387b109a1
Parents: b6a327e
Author: cwanda <wa...@happycity.com>
Authored: Tue Jan 31 08:04:58 2017 -0800
Committer: cwanda <wa...@happycity.com>
Committed: Tue Jan 31 16:52:28 2017 -0800

----------------------------------------------------------------------
 .../os/modules/sysinitconfig/sysconfig_error.md |  23 +--
 docs/os/modules/sysinitconfig/sysinitconfig.md  | 166 +++++++++++++------
 docs/os/tutorials/add_newtmgr.md                |  24 +--
 3 files changed, 140 insertions(+), 73 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/def3e5db/docs/os/modules/sysinitconfig/sysconfig_error.md
----------------------------------------------------------------------
diff --git a/docs/os/modules/sysinitconfig/sysconfig_error.md b/docs/os/modules/sysinitconfig/sysconfig_error.md
index 68b5afe..f475226 100644
--- a/docs/os/modules/sysinitconfig/sysconfig_error.md
+++ b/docs/os/modules/sysinitconfig/sysconfig_error.md
@@ -26,7 +26,7 @@ override violations:
 * Ambiguity Violation - Two packages of the same priority override a setting with 
 different values. And no higher priority package overrides the setting.
 * Priority Violation - A package overrides a setting defined by a package with higher or 
-equal priority (TODO: Change error message to indicate a more general priority violation instead of only lateral overrides)
+equal priority. 
 
 ####Example: Ambiguity Violation Error Message
 
@@ -37,13 +37,13 @@ The following example shows the error message that newt outputs for an ambiguity
 Error: Syscfg ambiguities detected:
     Setting: LOG_NEWTMGR, Packages: [apps/slinky, apps/splitty]
 Setting history (newest -> oldest):
-    LOG_NEWTMGR: [apps/splitty:0, apps/slinky:1, sys/log:0]
+    LOG_NEWTMGR: [apps/splitty:0, apps/slinky:1, sys/log/full:0]
 
 ```
 
 The above error occurs because the `apps/slinky` and `apps/splitty` packages 
 in the split image target both override the same setting with different 
-values.  The `apps/slinky` package sets the `sys/log` package `LOG_NEWTMGR` 
+values.  The `apps/slinky` package sets the `sys/log/full` package `LOG_NEWTMGR` 
 setting to 1, and the `apps/splitty` package sets the setting to 0. The 
 overrides are ambiguous because both are `app` packages and 
 have the same priority.  The following are excerpts of the defintion 
@@ -52,7 +52,7 @@ and the two overrides from the `syscfg.yml` files that cause the error:
 
 ```no-highlight
 
-#Package: sys/log/
+#Package: sys/log/full
 syscfg.defs:
     LOG_NEWTMGR:
         description: 'Enables or disables newtmgr command tool logging'
@@ -70,27 +70,28 @@ syscfg.vals:
 
 ####Example: Priority Violation Error Message
 
-The following example shows the error message that newt outputs for a lateral violation where a package tries to change the setting that was defined by another package at the same priority level:
+The following example shows the error message that newt outputs for a priority violation 
+where a package tries to change the setting that was defined by another package at 
+the same priority level:
 
 ```no-highlight
 
-
-Error: Lateral overrides detected (bottom-priority packages cannot override settings):
-    Package: mgmt/newtmgr, Setting: LOG_NEWTMGR
+Error: Priority violations detected (Packages can only override settings defined by packages of lower priority):
+    Package: mgmt/newtmgr overriding setting: LOG_NEWTMGR defined by sys/log/full
 
 Setting history (newest -> oldest):
-    LOG_NEWTMGR: [sys/log:0]
+    LOG_NEWTMGR: [sys/log/full:0]
 
 ```
 
 The above error occurs because the `mgmt/newtmgr` lib package 
-overrides the `LOG_NEWTMGR` setting that the `sys/log` lib package 
+overrides the `LOG_NEWTMGR` setting that the `sys/log/full` lib package 
 defines. The following are excerpts of the definition and the override from the 
 `syscfg.yml` files that cause this error: 
 
 ```no-highlight
 
-#Package: sys/log
+#Package: sys/log/full
 syscfg.defs:
      LOG_NEWTMGR:
         description: 'Enables or disables newtmgr command tool logging'

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/def3e5db/docs/os/modules/sysinitconfig/sysinitconfig.md
----------------------------------------------------------------------
diff --git a/docs/os/modules/sysinitconfig/sysinitconfig.md b/docs/os/modules/sysinitconfig/sysinitconfig.md
index 40faf92..832f9bd 100644
--- a/docs/os/modules/sysinitconfig/sysinitconfig.md
+++ b/docs/os/modules/sysinitconfig/sysinitconfig.md
@@ -11,7 +11,7 @@ package dependencies for your target build.
 
 Mynewt defines several configuration parameters in the `pkg.yml` and `syscfg.yml` files. The newt tool uses this information to: 
 
-* Generate a system initialization function that calls all the package-specific system initialization functions. 
+* Generate a system initialization function that calls all the package-specific ystem initialization functions. 
 * Generate a system configuration header file that contains all the package configuration settings and values.
 * Display the system configuration settings and values in the `newt target config` command.
 
@@ -113,7 +113,7 @@ defined in the BSP flash map for your target board.
 
 ####Examples of Configuration Settings
 
-**Example 1:** The following example is an excerpt from the `sys/log` package `syscfg.yml` file. It defines the 
+**Example 1:** The following example is an excerpt from the `sys/log/full` package `syscfg.yml` file. It defines the 
 `LOG_LEVEL` configuration setting to specify the log level and the `LOG_NEWTMGR` configuration setting to specify whether
 to enable or disable the newtmgr logging feature.
 
@@ -238,7 +238,7 @@ package `syscfg.yml` files.
 ####Examples of Overrides
 
 **Example 4:** The following example is an excerpt from the `apps/slinky` package `syscfg.yml` file.  The application package overrides, 
-in addition to other packages, the `sys/log` package system configuration settings defined in **Example 1**. It changes the LOG_NEWTMGR system configuration setting value from `0` to `1`.
+in addition to other packages, the `sys/log/full` package system configuration settings defined in **Example 1**. It changes the LOG_NEWTMGR system configuration setting value from `0` to `1`.
 
 ```no-highlight
 
@@ -312,9 +312,9 @@ For example, to reference the `my-config-name` setting name,  you use `MYNEWT_VA
 
 ####Example of syscfg.h and How to Reference a Setting Name
 **Example 6**: The following example are excerpts from a sample `syscfg.h` file generated for an app/slinky target and 
-from the `sys/log` package `log.c` file that shows how to reference a setting name.
+from the `sys/log/full` package `log.c` file that shows how to reference a setting name.
 
-The `syscfg.h` file shows the `sys/log` package definitions and also indicates that `app/slinky` 
+The `syscfg.h` file shows the `sys/log/full` package definitions and also indicates that `app/slinky` 
 changed the value for the `LOG_NEWTMGR` settings. 
 
 ```no-highlight
@@ -349,7 +349,7 @@ changed the value for the `LOG_NEWTMGR` settings.
 
      ...
 
-/*** sys/log */
+/*** sys/log/full */
 
 #ifndef MYNEWT_VAL_LOG_LEVEL
 #define MYNEWT_VAL_LOG_LEVEL (0)
@@ -357,7 +357,7 @@ changed the value for the `LOG_NEWTMGR` settings.
 
      ...
 
-/* Overridden by apps/slinky (defined by sys/log) */
+/* Overridden by apps/slinky (defined by sys/log/full) */
 #ifndef MYNEWT_VAL_LOG_NEWTMGR
 #define MYNEWT_VAL_LOG_NEWTMGR (1)
 #endif
@@ -366,7 +366,7 @@ changed the value for the `LOG_NEWTMGR` settings.
 
 ```
 
-The `log_init()` function in the `sys/log/src/log.c` file initializes the `sys/log` package. It checks the 
+The `log_init()` function in the `sys/log/full/src/log.c` file initializes the `sys/log/full` package. It checks the 
 `LOG_NEWTMGR` setting value, using `MYNEWT_VAL(LOG_NEWTMGR)`, to determine whether the target application
 has enabled the `newtmgr log` functionality. It only registers the the callbacks to process the
 `newtmgr log` commands when the setting value is non-zero.
@@ -401,103 +401,167 @@ log_init(void)
 
 ### System Initialization
 
-An application's `main()` function must first call the Mynewt `sysinit()` function to 
-initialize the software before it performs any other processing.
-`sysinit()` calls the `sysinit_app()` function to perform system 
-initialization for the packages in the target.  You can, optionally, specify an 
-initialization function that `sysinit_app()` calls to initialize a package. 
+During system startup, Mynewt creates a default event queue and a main task to process events from this queue. 
+You can override the `OS_MAIN_TASK_PRIO` and `OS_MAIN_TASK_STACK_SIZE` setting values defined by the 
+`kernel/os` package to specify different task priority and stack size values.
 
-A package init function must have the following prototype:
+Your application's `main()` function executes in the context of the main task and must perform the following:
+
+* At the start of `main()`, call the Mynewt `sysinit()` function to initialize 
+the packages before performing any other processing.
+* At the end of `main()`, wait for and dispatch events from the default event queue in a forever loop. 
+
+**Note:** You must include the `sysinit/sysinit.h` header file to access the `sysinit()` function.
+
+Here is an example of a `main()` function:
+
+```no-highlight
+
+int
+main(int argc, char **argv)
+{
+    /* First, call sysinit() to perform the system and package initialization */
+    sysinit();
+
+      ... other application initialization processing....
+
+     
+    /*  Last, process events from the default event queue.  */
+    while (1) {
+       os_eventq_run(os_eventq_dflt_get());
+    }
+    /* main never returns */   
+}
+
+```
+<br>
+
+####Specifying Package Initialization Functions
+
+The `sysinit()` function calls the `sysinit_app()` function to perform system 
+initialization for the packages in the target.   You can, optionally, 
+specify one or more package initialization functions 
+that `sysinit_app()` calls to initialize a package. 
+
+A package initialization function must have the following prototype:
 
 ```no-highlight
 
 void init_func_name(void)
 
 ```
-Package init functions are called in stages to ensure that lower priority packages 
-are initialized before higher priority packages.
+Package initialization functions are called in stages to ensure that lower priority
+packages are initialized before higher priority packages.  A stage is an 
+integer value, 0 or higher, that specifies when an initialization function is 
+called.  Mynewt calls the package initialization functions 
+in increasing stage number order.  The call order for initialization functions with the 
+same stage number depends on the order the packages are processed,
+and you cannot rely on a specific call order for these functions.  
 
-You specify an init function in the `pkg.yml` file for a package as follows:
+You use the `pkg.init` parameter in the 
+`pkg.yml` file to specify an initialization function and the stage number to call the function.
+You can specify multiple initialization functions, with a different stage number for each function,
+for the parameter values.  This feature allows packages with interdependencies to
+perform initialization in multiple stages.  
 
-* Use the `init_function` parameter to specify an init function name. 
+The `pkg.init` parameter has the following syntax in the `pkg.yml` file: 
 
-           pkg.init_function: pkg_init_func_name
+```no-highlight 
 
-      where `pkg_init_func_name` is the C function name of package init function. 
+pkg.init: 
+    pkg_init_func1_name: pkg_init_func1_stage 
+    pkg_init_func2_name: pkg_init_func2_stage 
 
-* Use the `init_stage` parameter to specify when to call the package init function.
+              ...
 
-           pkg.init_stage: stage_number
+    pkg_init_funcN_name: pkg_init_funcN_stage
+
+```
+where `pkg_init_func#_name` is the C function name of an initialization function, and `pkg_init_func#_stage` 
+is an integer value, 0 or higher, that indicates the stage when the `pkg_init_func#_name` function is called.  
 
-       where `stage_number` is a number that indicates when this init function is called relative to the other 
-       package init functions.  Mynewt calls the package init functions in increasing stage number order
-       and in alphabetic order of init function names for functions in the same stage.
-       **Note:** The init function will be called at stage 0 if `pkg.init_stage` is not specified.
- 
-**Note:** You must include the `sysinit/sysinit.h` header file to access the `sysinit()` function.
+
+**Note:** The `pkg.init_function` and `pkg.init_stage` parameters introduced in a previous release for 
+specifying a package initialization function and a stage number are deprecated and have been 
+retained to support the legacy format.  They will not 
+be maintained for future releases and we recommend that you migrate to use the `pkg.init` parameter.
 
 <br>
 
 #### Generated sysinit_app() Function
 
-The newt tool processes the `init_function` and `init_stage` parameters in all the pkg.yml files for a target,
+The newt tool processes the `pkg.init` parameters in all the `pkg.yml` files for a target,
 generates the `sysinit_app()` function in the `<target-path>/generated/src/<target-name>-sysinit_app.c` file, and 
 includes the file in the build. Here is an example `sysinit_app()` function:
 
 ```no-highlight
 
-/**
+**
  * This file was generated by Apache Newt (incubating) version: 1.0.0-dev
  */
 
 #if !SPLIT_LOADER
 
-void os_init(void);
 void split_app_init(void);
 void os_pkg_init(void);
 void imgmgr_module_init(void);
-void nmgr_pkg_init(void);
 
       ...
 
-void console_pkg_init(void);
-void log_init(void);
-
-      ...
+void stats_module_init(void);
 
 void
 sysinit_app(void)
 {
-    os_init();
 
     /*** Stage 0 */
     /* 0.0: kernel/os */
     os_pkg_init();
-    /* 0.1: sys/console/full */
-    console_pkg_init();
 
-        ...
+    /*** Stage 2 */
+    /* 2.0: sys/flash_map */
+    flash_map_init();
+
+    /*** Stage 10 */
+    /* 10.0: sys/stats/full */
+    stats_module_init();
 
-    /*** Stage 1 */
-    /* 1.0: sys/log */
+    /*** Stage 20 */
+    /* 20.0: sys/console/full */
+    console_pkg_init();
+
+    /*** Stage 100 */
+    /* 100.0: sys/log/full */
     log_init();
+    /* 100.1: sys/mfg */
+    mfg_init();
 
-        ...
+         ....
+
+    /*** Stage 300 */
+    /* 300.0: sys/config */    
+    config_pkg_init();
+
+    /*** Stage 500 */
+    /* 500.0: sys/id */
+    id_init();
+    /* 500.1: sys/shell */
+    shell_init();
 
-    /*** Stage 5 */
-    /* 5.0: boot/split */
-    split_app_init();
-    /* 5.1: mgmt/imgmgr */
+          ...
+
+    /* 500.4: mgmt/imgmgr */
     imgmgr_module_init();
-    /* 5.2: mgmt/newtmgr */
-    nmgr_pkg_init();
-        ...
-}
 
+    /*** Stage 501 */
+    /* 501.0: mgmt/newtmgr/transport/nmgr_shell */
+    nmgr_shell_pkg_init();
+}
 #endif
 
 ```
 
+
 <br>
 
 ###Conditional Configurations

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/def3e5db/docs/os/tutorials/add_newtmgr.md
----------------------------------------------------------------------
diff --git a/docs/os/tutorials/add_newtmgr.md b/docs/os/tutorials/add_newtmgr.md
index 6e69017..bf868b8 100644
--- a/docs/os/tutorials/add_newtmgr.md
+++ b/docs/os/tutorials/add_newtmgr.md
@@ -93,14 +93,15 @@ package functionality.
 ###Modify the Source
 
 Your application must designate an event queue that the `mgmt` package uses to receive request events from 
-the newtmgr tool.  It must also initialize a task and implement the task handler to
-dispatch events from this queue.  The `mgmt` package executes and processes newtmgr 
-request events in the context of this task.  Your application, however, does 
-not need to create a dedicated event queue and task for this purpose and can use its default 
-event queue.  This example uses the application's default event queue.  
+the newtmgr tool.  The `mgmt` package executes and handles newtmgr request events in the context of the task that
+processes events from this event queue.  You can designate the default event queue that Mynewt 
+creates.  If you choose to create and use a dedicated event queue, you must also 
+initialize a task and implement the task handler to dispatch events from this queue.  This example 
+uses the default event queue that Mynewt creates. 
 
-The `mgmt` package exports the `void mgmt_evq_set(struct os_eventq *evq)` function that an application must call 
-to designate the event queue. Modify `main.c` to add this call as follows:
+The `mgmt` package exports the `void mgmt_evq_set(struct os_eventq *evq)` 
+function that an application must call to designate the event queue.
+Modify `main.c` to add this call as follows:
 
 Add the `mgmt/mgmt.h` header file: 
 
@@ -110,15 +111,16 @@ Add the `mgmt/mgmt.h` header file:
 
 ```
 Add the call to designate the event queue. In the `main()` function,  
-scroll down to the `os_eventq_dflt_set(&ble_tiny_evq)` function call and add the 
-following statement below it:
+scroll down to the  `while (1) ` loop and add the 
+following statement above the loop: 
 
 ```no-highlight
 
-mgmt_eventq_set(&ble_tiny_evq)
+mgmt_evq_set(os_eventq_dflt_get())
 
 ```
-The `mgmt_eventq_set()` function must be called after your application has initialized the event queue and task.
+**Note:** If you choose to create and use a dedicated event queue, you must initialize the event queue and 
+the task before calling the `mgmt_evq_set()` function. 
 
 
 ### Build the Targets


[5/5] incubator-mynewt-site git commit: removed baselibc from air quality sensor tutorial

Posted by ad...@apache.org.
removed baselibc from air quality sensor tutorial


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

Branch: refs/heads/develop
Commit: 003ca196175bbdd8a62e1bbb28ff458ccc0e3476
Parents: 0cc52b7
Author: aditihilbert <ad...@runtime.io>
Authored: Tue Jan 31 22:48:50 2017 -0800
Committer: aditihilbert <ad...@runtime.io>
Committed: Tue Jan 31 22:48:50 2017 -0800

----------------------------------------------------------------------
 docs/os/tutorials/air_quality_sensor.md | 2 --
 1 file changed, 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/003ca196/docs/os/tutorials/air_quality_sensor.md
----------------------------------------------------------------------
diff --git a/docs/os/tutorials/air_quality_sensor.md b/docs/os/tutorials/air_quality_sensor.md
index 941bed3..fcca460 100644
--- a/docs/os/tutorials/air_quality_sensor.md
+++ b/docs/os/tutorials/air_quality_sensor.md
@@ -161,7 +161,6 @@ Then you modify the apps/air_quality/pkg.yml for air_quality in order to change
 You'll need to add the `@apache-mynewt-core/` path to all the package dependencies, since the app no longer
 resides within the apache-mynewt-core repository.
 
-The Arduino Primo board has a limited amount of memory, so you must also switch your libc to be baselibc, instead of the standard one.
 
 ```no-highlight
 [user@IsMyLaptop:~/src/air_quality]$ cat apps/air_quality/pkg.yml
@@ -335,7 +334,6 @@ pkg.deps:
     - "@apache-mynewt-core/sys/config"
     - "@apache-mynewt-core/sys/log/full"
     - "@apache-mynewt-core/sys/stats/full"
-    - "@apache-mynewt-core/libs/baselibc"
     - libs/my_drivers/senseair
 ```
 


[4/5] incubator-mynewt-site git commit: minor edits to the air-quality sensor tutorial

Posted by ad...@apache.org.
minor edits to the air-quality sensor tutorial


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

Branch: refs/heads/develop
Commit: 0cc52b70ceb4ab4ae637aae31e1eb96f4aef37fd
Parents: 28b0e42
Author: aditihilbert <ad...@runtime.io>
Authored: Tue Jan 31 22:38:26 2017 -0800
Committer: aditihilbert <ad...@runtime.io>
Committed: Tue Jan 31 22:38:26 2017 -0800

----------------------------------------------------------------------
 docs/os/tutorials/air_quality_sensor.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/0cc52b70/docs/os/tutorials/air_quality_sensor.md
----------------------------------------------------------------------
diff --git a/docs/os/tutorials/air_quality_sensor.md b/docs/os/tutorials/air_quality_sensor.md
index 72bc561..941bed3 100644
--- a/docs/os/tutorials/air_quality_sensor.md
+++ b/docs/os/tutorials/air_quality_sensor.md
@@ -501,7 +501,7 @@ The sensor has a serial port connection, and that's how you are going to connect
 We're using one for our shell/console. It also has a second UART set up as a 'bit-bang' UART but since the SenseAir only needs to
 communicate at 9600 baud, this bit-banged uart is plenty fast enough.
 
-You'll have to make a small change to the `syscfg.yml` file in your project's target directory to chang the pin definitions 
+You'll have to make a small change to the `syscfg.yml` file in your project's target directory to change  the pin definitions 
 for this second UART. Those changes are as follows:
 
 ```no-highlight