You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by st...@apache.org on 2016/10/31 23:08:59 UTC

[1/3] incubator-mynewt-core git commit: rename E* symbol to SYS_* to avoid POSIX conflicts.. slow process to have all error codes in the systme use these.

Repository: incubator-mynewt-core
Updated Branches:
  refs/heads/develop 490bb784f -> 9c8786439


rename E* symbol to SYS_* to avoid POSIX conflicts.. slow process to have all error codes in the systme use these.


Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/commit/3f8bc7c0
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/3f8bc7c0
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/3f8bc7c0

Branch: refs/heads/develop
Commit: 3f8bc7c0513fc8ba62efe1d0b961f10eedd9c9dd
Parents: 490bb78
Author: Sterling Hughes <st...@apache.org>
Authored: Mon Oct 31 16:01:39 2016 -0700
Committer: Sterling Hughes <st...@apache.org>
Committed: Mon Oct 31 16:01:39 2016 -0700

----------------------------------------------------------------------
 sys/defs/include/defs/error.h | 24 ++++++++++++------------
 sys/flash_map/src/flash_map.c |  6 +++---
 2 files changed, 15 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/3f8bc7c0/sys/defs/include/defs/error.h
----------------------------------------------------------------------
diff --git a/sys/defs/include/defs/error.h b/sys/defs/include/defs/error.h
index 177c70b..7bc984d 100644
--- a/sys/defs/include/defs/error.h
+++ b/sys/defs/include/defs/error.h
@@ -24,19 +24,19 @@
 extern "C" {
 #endif
 
-#define EOK      (0)
-#define ENOMEM   (-1)
-#define EINVAL   (-2)
-#define ETIMEOUT (-3)
-#define ENOENT   (-4)
-#define EIO      (-5)
-#define EAGAIN   (-6)
-#define EACCES   (-7)
-#define EBUSY    (-8)
-#define ENODEV   (-9)
-#define ERANGE   (-10)
+#define SYS_EOK      (0)
+#define SYS_ENOMEM   (-1)
+#define SYS_EINVAL   (-2)
+#define SYS_ETIMEOUT (-3)
+#define SYS_ENOENT   (-4)
+#define SYS_EIO      (-5)
+#define SYS_EAGAIN   (-6)
+#define SYS_EACCES   (-7)
+#define SYS_EBUSY    (-8)
+#define SYS_ENODEV   (-9)
+#define SYS_ERANGE   (-10)
 
-#define E_PERUSER (-65535)
+#define SYS_EPERUSER (-65535)
 
 #ifdef __cplusplus
 }

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/3f8bc7c0/sys/flash_map/src/flash_map.c
----------------------------------------------------------------------
diff --git a/sys/flash_map/src/flash_map.c b/sys/flash_map/src/flash_map.c
index e5bb245..77a617b 100644
--- a/sys/flash_map/src/flash_map.c
+++ b/sys/flash_map/src/flash_map.c
@@ -6,7 +6,7 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- * 
+ *
  *  http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing,
@@ -41,7 +41,7 @@ flash_area_open(uint8_t id, const struct flash_area **fap)
     int i;
 
     if (flash_map == NULL) {
-        return EACCES;
+        return SYS_EACCES;
     }
 
     for (i = 0; i < flash_map_entries; i++) {
@@ -52,7 +52,7 @@ flash_area_open(uint8_t id, const struct flash_area **fap)
         }
     }
 
-    return ENOENT;
+    return SYS_ENOENT;
 }
 
 void


[3/3] incubator-mynewt-core git commit: move definition of os cputime timer number to the os package

Posted by st...@apache.org.
move definition of os cputime timer number to the os package


Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/commit/9c878643
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/9c878643
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/9c878643

Branch: refs/heads/develop
Commit: 9c8786439b3698c552973ff50a1a9c94dc978ef8
Parents: 22cc12e
Author: Sterling Hughes <st...@apache.org>
Authored: Mon Oct 31 16:08:52 2016 -0700
Committer: Sterling Hughes <st...@apache.org>
Committed: Mon Oct 31 16:08:52 2016 -0700

----------------------------------------------------------------------
 hw/bsp/arduino_primo_nrf52/syscfg.yml | 4 ----
 hw/bsp/bmd300eval/syscfg.yml          | 4 ----
 hw/bsp/nrf51-arduino_101/syscfg.yml   | 4 ----
 hw/bsp/nrf51-blenano/syscfg.yml       | 4 ----
 hw/bsp/nrf51dk-16kbram/syscfg.yml     | 4 ----
 hw/bsp/nrf51dk/syscfg.yml             | 4 ----
 hw/bsp/nrf52dk/syscfg.yml             | 5 -----
 hw/bsp/rb-nano2/syscfg.yml            | 4 ----
 kernel/os/src/os_cputime.c            | 4 ----
 kernel/os/syscfg.yml                  | 3 +++
 10 files changed, 3 insertions(+), 37 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/9c878643/hw/bsp/arduino_primo_nrf52/syscfg.yml
----------------------------------------------------------------------
diff --git a/hw/bsp/arduino_primo_nrf52/syscfg.yml b/hw/bsp/arduino_primo_nrf52/syscfg.yml
index 1b360cc..178b9a2 100644
--- a/hw/bsp/arduino_primo_nrf52/syscfg.yml
+++ b/hw/bsp/arduino_primo_nrf52/syscfg.yml
@@ -28,10 +28,6 @@ syscfg.defs:
         description: 'TBD'
         value:  1000000
 
-    OS_CPUTIME_TIMER_NUM:
-        description: 'Timer to use for cputime'
-        value:  0
-
     XTAL_32768:
         description: 'TBD'
         value: 1

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/9c878643/hw/bsp/bmd300eval/syscfg.yml
----------------------------------------------------------------------
diff --git a/hw/bsp/bmd300eval/syscfg.yml b/hw/bsp/bmd300eval/syscfg.yml
index aaf9128..68b32ed 100644
--- a/hw/bsp/bmd300eval/syscfg.yml
+++ b/hw/bsp/bmd300eval/syscfg.yml
@@ -28,10 +28,6 @@ syscfg.defs:
         description: 'TBD'
         value:  1000000
 
-    OS_CPUTIME_TIMER_NUM:
-        description: 'Timer to use for cputime'
-        value:  0
-
     XTAL_32768:
         description: 'TBD'
         value: 1

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/9c878643/hw/bsp/nrf51-arduino_101/syscfg.yml
----------------------------------------------------------------------
diff --git a/hw/bsp/nrf51-arduino_101/syscfg.yml b/hw/bsp/nrf51-arduino_101/syscfg.yml
index 5b1ab5f..97b213d 100644
--- a/hw/bsp/nrf51-arduino_101/syscfg.yml
+++ b/hw/bsp/nrf51-arduino_101/syscfg.yml
@@ -28,10 +28,6 @@ syscfg.defs:
         description: 'TBD'
         value: 1000000
 
-    OS_CPUTIME_TIMER_NUM:
-        description: 'Timer to use for cputime'
-        value:  0
-
     XTAL_32768:
         description: 'TBD'
         value: 1

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/9c878643/hw/bsp/nrf51-blenano/syscfg.yml
----------------------------------------------------------------------
diff --git a/hw/bsp/nrf51-blenano/syscfg.yml b/hw/bsp/nrf51-blenano/syscfg.yml
index 114f1c2..048c781 100644
--- a/hw/bsp/nrf51-blenano/syscfg.yml
+++ b/hw/bsp/nrf51-blenano/syscfg.yml
@@ -28,10 +28,6 @@ syscfg.defs:
         description: 'TBD'
         value: 1000000
 
-    OS_CPUTIME_TIMER_NUM:
-        description: 'Timer to use for cputime'
-        value:  0
-
     XTAL_32768:
         description: 'TBD'
         value: 1

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/9c878643/hw/bsp/nrf51dk-16kbram/syscfg.yml
----------------------------------------------------------------------
diff --git a/hw/bsp/nrf51dk-16kbram/syscfg.yml b/hw/bsp/nrf51dk-16kbram/syscfg.yml
index 21ff5ce..7381af0 100644
--- a/hw/bsp/nrf51dk-16kbram/syscfg.yml
+++ b/hw/bsp/nrf51dk-16kbram/syscfg.yml
@@ -28,10 +28,6 @@ syscfg.defs:
         description: 'TBD'
         value: 1000000
 
-    OS_CPUTIME_TIMER_NUM:
-        description: 'Timer to use for cputime'
-        value:  0
-
     XTAL_32768:
         description: 'TBD'
         value: 1

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/9c878643/hw/bsp/nrf51dk/syscfg.yml
----------------------------------------------------------------------
diff --git a/hw/bsp/nrf51dk/syscfg.yml b/hw/bsp/nrf51dk/syscfg.yml
index a862880..17d9213 100644
--- a/hw/bsp/nrf51dk/syscfg.yml
+++ b/hw/bsp/nrf51dk/syscfg.yml
@@ -28,10 +28,6 @@ syscfg.defs:
         description: 'TBD'
         value: 1000000
 
-    OS_CPUTIME_TIMER_NUM:
-        description: 'Timer to use for cputime'
-        value:  0
-
     XTAL_32768:
         description: 'TBD'
         value: 1

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/9c878643/hw/bsp/nrf52dk/syscfg.yml
----------------------------------------------------------------------
diff --git a/hw/bsp/nrf52dk/syscfg.yml b/hw/bsp/nrf52dk/syscfg.yml
index 38f2754..3abc759 100644
--- a/hw/bsp/nrf52dk/syscfg.yml
+++ b/hw/bsp/nrf52dk/syscfg.yml
@@ -8,11 +8,6 @@ syscfg.defs:
     CLOCK_FREQ:
         description: 'TBD'
         value:  1000000
-
-    OS_CPUTIME_TIMER_NUM:
-        description: 'Timer to use for cputime'
-        value:  0
-
     XTAL_32768:
         description: 'TBD'
         value: 1

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/9c878643/hw/bsp/rb-nano2/syscfg.yml
----------------------------------------------------------------------
diff --git a/hw/bsp/rb-nano2/syscfg.yml b/hw/bsp/rb-nano2/syscfg.yml
index 906145b..8f8fa81 100644
--- a/hw/bsp/rb-nano2/syscfg.yml
+++ b/hw/bsp/rb-nano2/syscfg.yml
@@ -28,10 +28,6 @@ syscfg.defs:
         description: 'TBD'
         value:  1000000
 
-    OS_CPUTIME_TIMER_NUM:
-        description: 'Timer to use for cputime'
-        value:  0
-
     XTAL_32768:
         description: 'TBD'
         value: 1

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/9c878643/kernel/os/src/os_cputime.c
----------------------------------------------------------------------
diff --git a/kernel/os/src/os_cputime.c b/kernel/os/src/os_cputime.c
index 11b53d8..e67a2f8 100644
--- a/kernel/os/src/os_cputime.c
+++ b/kernel/os/src/os_cputime.c
@@ -23,8 +23,6 @@
 #include "os/os.h"
 #include "os/os_cputime.h"
 
-#if defined(MYNEWT_VAL_OS_CPUTIME_TIMER_NUM)
-
 /**
  * @addtogroup OSKernel Operating System Kernel
  * @{
@@ -280,5 +278,3 @@ os_cputime_get32(void)
  * @} OSKernel
  */
 
-#endif  /* if defined(MYNEWT_VAL_OS_CPUTIME_TIMER_NUM) */
-

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/9c878643/kernel/os/syscfg.yml
----------------------------------------------------------------------
diff --git a/kernel/os/syscfg.yml b/kernel/os/syscfg.yml
index 2173c82..840d854 100644
--- a/kernel/os/syscfg.yml
+++ b/kernel/os/syscfg.yml
@@ -12,6 +12,9 @@ syscfg.defs:
     OS_CPUTIME_FREQ:
         description: 'Frequency of os cputime'
         value: 1000000
+    OS_CPUTIME_TIMER_NUM:
+        description: 'Timer number to use in OS CPUTime, 0 by default.'
+        value: 0
     SANITY_INTERVAL:
         description: 'The interval (in milliseconds) at which the sanity checks should run, should be at least 200ms prior to watchdog'
         value: 15000


[2/3] incubator-mynewt-core git commit: rename to use system error code

Posted by st...@apache.org.
rename to use system error code


Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/commit/22cc12e4
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/22cc12e4
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/22cc12e4

Branch: refs/heads/develop
Commit: 22cc12e4fecda11764d85b84e46e6f827ad54126
Parents: 3f8bc7c
Author: Sterling Hughes <st...@apache.org>
Authored: Mon Oct 31 16:08:39 2016 -0700
Committer: Sterling Hughes <st...@apache.org>
Committed: Mon Oct 31 16:08:39 2016 -0700

----------------------------------------------------------------------
 boot/split/src/split.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/22cc12e4/boot/split/src/split.c
----------------------------------------------------------------------
diff --git a/boot/split/src/split.c b/boot/split/src/split.c
index 3a72382..c7aae93 100644
--- a/boot/split/src/split.c
+++ b/boot/split/src/split.c
@@ -86,7 +86,7 @@ int
 split_mode_set(split_mode_t split_mode)
 {
     if (split_mode < 0 || split_mode >= SPLIT_MODE_CNT) {
-        return EINVAL;
+        return SYS_EINVAL;
     }
 
     split_mode_cur = split_mode;