From e99512a45602f05b1873375748f517ebd5e943b2 Mon Sep 17 00:00:00 2001 From: "Vic (Chun-Ju) Yang" Date: Wed, 23 Apr 2014 14:42:36 +0800 Subject: 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 Reviewed-on: https://chromium-review.googlesource.com/196190 Reviewed-by: Vincent Palatin --- board/keyborg/debug.c | 6 +++--- 1 file 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; } -- cgit v1.2.1