Repository: incubator-mynewt-core
Updated Branches:
  refs/heads/develop f98cc5679 -> 64aca16a6


MYNEWT-300; console - copy in RX data in chunks.
Serve interrupts after every chunk.


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

Branch: refs/heads/develop
Commit: 64aca16a6e039fabdd313ff1164aadb1d5960344
Parents: f98cc56
Author: Marko Kiiskila <[email protected]>
Authored: Tue May 24 14:38:23 2016 -0700
Committer: Marko Kiiskila <[email protected]>
Committed: Tue May 24 14:38:23 2016 -0700

----------------------------------------------------------------------
 libs/console/full/src/cons_tty.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/64aca16a/libs/console/full/src/cons_tty.c
----------------------------------------------------------------------
diff --git a/libs/console/full/src/cons_tty.c b/libs/console/full/src/cons_tty.c
index e7057a1..a50f1a6 100644
--- a/libs/console/full/src/cons_tty.c
+++ b/libs/console/full/src/cons_tty.c
@@ -30,7 +30,7 @@ int console_is_midline;
 
 #define CONSOLE_TX_BUF_SZ      32      /* IO buffering, must be power of 2 */
 #define CONSOLE_RX_BUF_SZ      128
-
+#define CONSOLE_RX_CHUNK       16
 
 #define CONSOLE_DEL            0x7f    /* del character */
 #define CONSOLE_ESC            0x1b    /* esc character */
@@ -198,6 +198,15 @@ console_read(char *str, int cnt)
         if (cr->cr_head == cr->cr_tail) {
             break;
         }
+
+       if ((i & (CONSOLE_RX_CHUNK - 1)) == (CONSOLE_RX_CHUNK - 1)) {
+               /*
+                * Make a break from blocking interrupts during the copy.
+                */
+               OS_EXIT_CRITICAL(sr);
+               OS_ENTER_CRITICAL(sr);
+       }
+
         ch = console_pull_char(cr);
         if (ch == '\n') {
             *str = '\0';

Reply via email to