diff options
author | Vincent Palatin <vpalatin@chromium.org> | 2012-01-27 23:10:25 +0000 |
---|---|---|
committer | Vincent Palatin <vpalatin@chromium.org> | 2012-01-31 22:29:13 +0000 |
commit | e3edad44599ed0f66b46c110b6a0b8abc51e671c (patch) | |
tree | 0bc3c1bd4e1b3d46ecc7a1de8e80a1b0c852e96b /include/util.h | |
parent | df1d8933223817b4b5afe33101e939ff243aa9f6 (diff) | |
download | chrome-ec-e3edad44599ed0f66b46c110b6a0b8abc51e671c.tar.gz |
stm32l: add UART driver
simple UART driver to get the serial console on the USART3.
Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BUG=None
TEST=run on Discovery board and check we get the first message on the
UART and the console is echoing the characters.
Change-Id: Id85999a5ddbd75804e9317a1b8c2fd4afb89eb38
Diffstat (limited to 'include/util.h')
-rw-r--r-- | include/util.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/util.h b/include/util.h index 3381911293..5a76a66a72 100644 --- a/include/util.h +++ b/include/util.h @@ -38,6 +38,12 @@ #define MIN(a, b) ((a) < (b) ? (a) : (b)) #define NULL ((void *)0) +/** + * macros for integer division with various rounding variants + * default integer division rounds down. + */ +#define DIV_ROUND_UP(x, y) (((x) + ((y) - 1)) / (y)) +#define DIV_ROUND_NEAREST(x, y) (((x) + ((y) / 2)) / (y)) /* Standard library functions */ int atoi(const char *nptr); |