From 7271c928ccc44fc0345ffdf9f600f8b614628357 Mon Sep 17 00:00:00 2001 From: Yonezawa-T2 Date: Tue, 29 Mar 2016 17:39:36 +0900 Subject: [PATCH] i2c: add missing #ifdef block --- cpu/cc2538/periph/i2c.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cpu/cc2538/periph/i2c.c b/cpu/cc2538/periph/i2c.c index 64557f9d2c..f4d5c8b952 100644 --- a/cpu/cc2538/periph/i2c.c +++ b/cpu/cc2538/periph/i2c.c @@ -27,7 +27,10 @@ #include "periph/i2c.h" #include "sched.h" #include "thread.h" +#ifdef MODULE_XTIMER #include "xtimer.h" +#endif +#include "timex.h" /* for SEC_IN_USEC */ #define ENABLE_DEBUG (0) #include "debug.h" @@ -188,7 +191,9 @@ static uint_fast8_t i2c_ctrl_blocking(uint_fast8_t flags) if (I2CM_STAT & BUSY) { /* If the controller is still busy, it probably will be forever */ +#ifdef MODULE_XTIMER DEBUG("Master is still BUSY after %u usec. Resetting.\n", xtimer_timeout); +#endif cc2538_i2c_init_master(speed_hz); }