You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by ma...@apache.org on 2016/12/28 21:40:12 UTC
[1/3] incubator-mynewt-core git commit: nrf51-blenano;
don't call os_cputime_init() unless TIMER_0 is set.
Repository: incubator-mynewt-core
Updated Branches:
refs/heads/develop f3a848d40 -> 12b5170d0
nrf51-blenano; don't call os_cputime_init() unless TIMER_0 is set.
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/b83b0f3e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/b83b0f3e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/b83b0f3e
Branch: refs/heads/develop
Commit: b83b0f3e627599e2e301fe4b06cd8084fbc81d20
Parents: f3a848d
Author: Marko Kiiskila <ma...@runtime.io>
Authored: Wed Dec 28 13:15:19 2016 -0800
Committer: Marko Kiiskila <ma...@runtime.io>
Committed: Wed Dec 28 13:15:48 2016 -0800
----------------------------------------------------------------------
hw/bsp/nrf51-blenano/src/hal_bsp.c | 5 +++++
1 file changed, 5 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/b83b0f3e/hw/bsp/nrf51-blenano/src/hal_bsp.c
----------------------------------------------------------------------
diff --git a/hw/bsp/nrf51-blenano/src/hal_bsp.c b/hw/bsp/nrf51-blenano/src/hal_bsp.c
index c8eb15f..8350f9f 100644
--- a/hw/bsp/nrf51-blenano/src/hal_bsp.c
+++ b/hw/bsp/nrf51-blenano/src/hal_bsp.c
@@ -151,9 +151,14 @@ hal_bsp_init(void)
assert(rc == 0);
#endif
+ /*
+ * XXXX, depending on what timer OS_CPUTIME_TIMER_NUM is set to use.
+ */
+#if MYNEWT_VAL(TIMER_0)
/* Set cputime to count at 1 usec increments */
rc = os_cputime_init(MYNEWT_VAL(CLOCK_FREQ));
assert(rc == 0);
+#endif
#if MYNEWT_VAL(SPI_0_MASTER)
rc = hal_spi_init(0, (void *)&os_bsp_spi0m_cfg, HAL_SPI_TYPE_MASTER);
[3/3] incubator-mynewt-core git commit: boot; set OS_SCHEDULING to 0.
Posted by ma...@apache.org.
boot; set OS_SCHEDULING to 0.
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/12b5170d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/12b5170d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/12b5170d
Branch: refs/heads/develop
Commit: 12b5170d08befcf791648d015696d3a27c0b70e9
Parents: f2b25f0
Author: Marko Kiiskila <ma...@runtime.io>
Authored: Wed Dec 28 13:29:44 2016 -0800
Committer: Marko Kiiskila <ma...@runtime.io>
Committed: Wed Dec 28 13:29:44 2016 -0800
----------------------------------------------------------------------
apps/boot/syscfg.yml | 1 +
1 file changed, 1 insertion(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/12b5170d/apps/boot/syscfg.yml
----------------------------------------------------------------------
diff --git a/apps/boot/syscfg.yml b/apps/boot/syscfg.yml
index b8ce81d..819a70a 100644
--- a/apps/boot/syscfg.yml
+++ b/apps/boot/syscfg.yml
@@ -28,3 +28,4 @@ syscfg.defs:
syscfg.vals:
SYSINIT_CONSTRAIN_INIT: 0
+ OS_SCHEDULING: 0
[2/3] incubator-mynewt-core git commit: os;
add syscfg option which tells whether OS will be started or not.
Posted by ma...@apache.org.
os; add syscfg option which tells whether OS will be started or
not.
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/f2b25f04
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/f2b25f04
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/f2b25f04
Branch: refs/heads/develop
Commit: f2b25f0473e62e66c4bf87086eb027611a443780
Parents: b83b0f3
Author: Marko Kiiskila <ma...@runtime.io>
Authored: Wed Dec 28 13:29:06 2016 -0800
Committer: Marko Kiiskila <ma...@runtime.io>
Committed: Wed Dec 28 13:29:06 2016 -0800
----------------------------------------------------------------------
kernel/os/src/os.c | 4 ++++
kernel/os/src/os_heap.c | 8 +++++++-
kernel/os/src/os_time.c | 9 +++++++++
kernel/os/syscfg.yml | 3 +++
4 files changed, 23 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/f2b25f04/kernel/os/src/os.c
----------------------------------------------------------------------
diff --git a/kernel/os/src/os.c b/kernel/os/src/os.c
index c313a26..6dfe128 100644
--- a/kernel/os/src/os.c
+++ b/kernel/os/src/os.c
@@ -179,6 +179,7 @@ os_init(void)
void
os_start(void)
{
+#if MYNEWT_VAL(OS_SCHEDULING)
os_error_t err;
err = os_dev_initialize_all(OS_DEV_INIT_KERNEL);
@@ -189,6 +190,9 @@ os_start(void)
err = os_arch_os_start();
assert(err == OS_OK);
+#else
+ assert(0);
+#endif
}
void
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/f2b25f04/kernel/os/src/os_heap.c
----------------------------------------------------------------------
diff --git a/kernel/os/src/os_heap.c b/kernel/os/src/os_heap.c
index 8592be0..0d94325 100644
--- a/kernel/os/src/os_heap.c
+++ b/kernel/os/src/os_heap.c
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-
+#include "syscfg/syscfg.h"
#include <assert.h>
#include "os/os_mutex.h"
@@ -29,28 +29,34 @@
* @{
*/
+#if MYNEWT_VAL(OS_SCHEDULING)
static struct os_mutex os_malloc_mutex;
+#endif
static void
os_malloc_lock(void)
{
+#if MYNEWT_VAL(OS_SCHEDULING)
int rc;
if (g_os_started) {
rc = os_mutex_pend(&os_malloc_mutex, 0xffffffff);
assert(rc == 0);
}
+#endif
}
static void
os_malloc_unlock(void)
{
+#if MYNEWT_VAL(OS_SCHEDULING)
int rc;
if (g_os_started) {
rc = os_mutex_release(&os_malloc_mutex);
assert(rc == 0);
}
+#endif
}
/**
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/f2b25f04/kernel/os/src/os_time.c
----------------------------------------------------------------------
diff --git a/kernel/os/src/os_time.c b/kernel/os/src/os_time.c
index 52ca7e5..3f6816d 100644
--- a/kernel/os/src/os_time.c
+++ b/kernel/os/src/os_time.c
@@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
+#include "syscfg/syscfg.h"
#include <assert.h>
@@ -67,6 +68,7 @@ os_time_get(void)
return (g_os_time);
}
+#if MYNEWT_VAL(OS_SCHEDULING)
static void
os_time_tick(int ticks)
{
@@ -113,6 +115,13 @@ os_time_advance(int ticks)
}
}
}
+#else
+void
+os_time_advance(int ticks)
+{
+ g_os_time += ticks;
+}
+#endif
/**
* Puts the current task to sleep for the specified number of os ticks. There
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/f2b25f04/kernel/os/syscfg.yml
----------------------------------------------------------------------
diff --git a/kernel/os/syscfg.yml b/kernel/os/syscfg.yml
index e2efda7..e175bce 100644
--- a/kernel/os/syscfg.yml
+++ b/kernel/os/syscfg.yml
@@ -27,6 +27,9 @@ syscfg.defs:
OS_COREDUMP:
description: 'TBD'
value: 0
+ OS_SCHEDULING:
+ description: 'Whether OS will be started or not'
+ value: 1
OS_CPUTIME_FREQ:
description: 'Frequency of os cputime'
value: 1000000