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