diff options
author | Vic (Chun-Ju) Yang <victoryang@chromium.org> | 2014-04-23 14:42:36 +0800 |
---|---|---|
committer | chrome-internal-fetch <chrome-internal-fetch@google.com> | 2014-04-24 11:36:53 +0000 |
commit | e99512a45602f05b1873375748f517ebd5e943b2 (patch) | |
tree | 11993c7952448a6c0b56041068436a320bd54c05 | |
parent | 632d00509049884918abfc7fc275472592da2c2c (diff) | |
download | chrome-ec-e99512a45602f05b1873375748f517ebd5e943b2.tar.gz |
Keyborg: increase UART baud rate to 38400
We are running a minimal runtime with less overhead. This allows us to
run UART at 38400 bps. Let's update the config for easier debugging.
Also fix a potential underflow bug.
BUG=None
TEST=See debug output at 38400 bps
BRANCH=None
Change-Id: Ic9e4f9d545f5dbc4a0816a843b0f01a4cf219666
Signed-off-by: Vic (Chun-Ju) Yang <victoryang@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/196190
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
-rw-r--r-- | board/keyborg/debug.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/board/keyborg/debug.c b/board/keyborg/debug.c index 403af499c2..e801c1f543 100644 --- a/board/keyborg/debug.c +++ b/board/keyborg/debug.c @@ -11,7 +11,7 @@ #include "timer.h" #include "util.h" -#define BAUD 9600 +#define BAUD 38400 #define BIT_PERIOD (1000000 / BAUD) int debug_txchar(void *context, int c) @@ -27,8 +27,8 @@ int debug_txchar(void *context, int c) st = get_time(); for (i = 0; i < 10; ++i) { STM32_GPIO_BSRR(GPIO_A) = 1 << ((c & 1) ? 15 : 31); - d = MAX(st.val + BIT_PERIOD * (i + 1) - get_time().val, 0); - if (d) + d = (int32_t)st.le.lo + BIT_PERIOD * (i + 1) - get_time().le.lo; + if (d > 0) udelay(d); c >>= 1; } |