From 8e624c750d3f8390aed521dc1ce5909d655b706e Mon Sep 17 00:00:00 2001 From: Ulf Knoblich Date: Wed, 29 Apr 2015 11:07:59 +0200 Subject: [PATCH] cc2538 i2c bug in clock computation --- cpu/cc2538/dev/i2c.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpu/cc2538/dev/i2c.c b/cpu/cc2538/dev/i2c.c index 29ded2967..a4683bdc5 100644 --- a/cpu/cc2538/dev/i2c.c +++ b/cpu/cc2538/dev/i2c.c @@ -50,7 +50,7 @@ get_sys_clock(void) { /* Get the clock status diviser */ return SYS_CTRL_32MHZ / - ((REG(SYS_CTRL_CLOCK_STA) & SYS_CTRL_CLOCK_STA_SYS_DIV) + 1); + (1 << (REG(SYS_CTRL_CLOCK_STA) & SYS_CTRL_CLOCK_STA_SYS_DIV)); } /*---------------------------------------------------------------------------*/ void