You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by pa...@apache.org on 2016/10/26 16:28:16 UTC

[1/2] incubator-mynewt-core git commit: allows console buffers larger than 128 bytes. Also check to ensure that console buffers are a power of 2 because the code requires them to be since it uses masks instead of mods

Repository: incubator-mynewt-core
Updated Branches:
  refs/heads/develop 062d3ab39 -> bc9a74c44


allows console buffers larger than 128 bytes.  Also check to ensure that console buffers
are a power of 2 because the code requires them to be since it uses masks instead of mods


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

Branch: refs/heads/develop
Commit: bc9a74c443c512d584d4f038439b12ae7894b7c0
Parents: 4b17d72
Author: paulfdietrich <pa...@yahoo.com>
Authored: Wed Oct 26 09:10:45 2016 -0700
Committer: paulfdietrich <pa...@yahoo.com>
Committed: Wed Oct 26 09:11:35 2016 -0700

----------------------------------------------------------------------
 sys/console/full/src/cons_tty.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/bc9a74c4/sys/console/full/src/cons_tty.c
----------------------------------------------------------------------
diff --git a/sys/console/full/src/cons_tty.c b/sys/console/full/src/cons_tty.c
index 2ac0a1a..3563c89 100644
--- a/sys/console/full/src/cons_tty.c
+++ b/sys/console/full/src/cons_tty.c
@@ -53,8 +53,7 @@ void console_print_prompt(void);
 struct console_ring {
     uint8_t cr_head;
     uint8_t cr_tail;
-    uint8_t cr_size;
-    uint8_t _pad;
+    uint16_t cr_size;
     uint8_t *cr_buf;
 };
 
@@ -516,6 +515,11 @@ console_is_init(void)
     return (ct->ct_dev != NULL);
 }
 
+static int is_power_of_two (unsigned int x)
+{
+  return ((x != 0) && !(x & (x - 1)));
+}
+
 int
 console_init(console_rx_cb rx_cb)
 {
@@ -547,6 +551,9 @@ console_init(console_rx_cb rx_cb)
         ct->ct_echo_off = ! MYNEWT_VAL(CONSOLE_ECHO);
     }
 
+    /* must be a power of 2 */
+    assert(is_power_of_two(MYNEWT_VAL(CONSOLE_RX_BUF_SIZE)));
+
 #if MYNEWT_VAL(CONSOLE_HIST_ENABLE)
     console_hist_init();
 #endif


[2/2] incubator-mynewt-core git commit: ensure we set all interrupts to lowest priority when we initialize

Posted by pa...@apache.org.
ensure we set all interrupts to lowest priority when we initialize


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

Branch: refs/heads/develop
Commit: 4b17d72330739c4aa675c3f2f24ecd1f6052454c
Parents: 062d3ab
Author: Paul Dietrich <pa...@yahoo.com>
Authored: Mon Oct 17 17:34:10 2016 -0700
Committer: paulfdietrich <pa...@yahoo.com>
Committed: Wed Oct 26 09:11:35 2016 -0700

----------------------------------------------------------------------
 kernel/os/src/arch/cortex_m0/os_arch_arm.c | 2 +-
 kernel/os/src/arch/cortex_m4/os_arch_arm.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/4b17d723/kernel/os/src/arch/cortex_m0/os_arch_arm.c
----------------------------------------------------------------------
diff --git a/kernel/os/src/arch/cortex_m0/os_arch_arm.c b/kernel/os/src/arch/cortex_m0/os_arch_arm.c
index e6be971..6d501c0 100755
--- a/kernel/os/src/arch/cortex_m0/os_arch_arm.c
+++ b/kernel/os/src/arch/cortex_m0/os_arch_arm.c
@@ -197,7 +197,7 @@ os_arch_os_init(void)
 
         /* Drop priority for all interrupts */
         for (i = 0; i < sizeof(NVIC->IP); i++) {
-            NVIC->IP[i] = 0xff;
+            NVIC->IP[i] = 0xffffffff;
         }
 
         NVIC_SetVector(SVCall_IRQn, (uint32_t)SVC_Handler);

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/4b17d723/kernel/os/src/arch/cortex_m4/os_arch_arm.c
----------------------------------------------------------------------
diff --git a/kernel/os/src/arch/cortex_m4/os_arch_arm.c b/kernel/os/src/arch/cortex_m4/os_arch_arm.c
index ce685f3..08c70a3 100755
--- a/kernel/os/src/arch/cortex_m4/os_arch_arm.c
+++ b/kernel/os/src/arch/cortex_m4/os_arch_arm.c
@@ -200,7 +200,7 @@ os_arch_os_init(void)
 
         /* Drop priority for all interrupts */
         for (i = 0; i < sizeof(NVIC->IP); i++) {
-            NVIC->IP[i] = 0xff;
+            NVIC->IP[i] = 0xffffffff;
         }
 
         NVIC_SetVector(SVCall_IRQn, (uint32_t)SVC_Handler);