From 42c287f36372dfadcb320ae38aaf3f54335fbf1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Th=C3=A9baudeau?= Date: Tue, 28 Jan 2014 20:10:51 +0100 Subject: [PATCH] cc2538: lpm: Fix build for LPM_CONF_ENABLE == 0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit lpm.c needs to #include lpm.h in order to get the definition of lpm_periph_permit_pm1_func_t, which made the replacement macros conflict with the function definitions for the LPM_CONF_ENABLE == 0 case. This change fixes this issue by #if-ing out the code in lpm.c in that case. Also, the replacement macro for lpm_register_peripheral() was missing in that case, which is fixed here. Signed-off-by: Benoît Thébaudeau --- cpu/cc2538/lpm.c | 3 +++ cpu/cc2538/lpm.h | 1 + 2 files changed, 4 insertions(+) diff --git a/cpu/cc2538/lpm.c b/cpu/cc2538/lpm.c index 80b536998..b620d2df6 100644 --- a/cpu/cc2538/lpm.c +++ b/cpu/cc2538/lpm.c @@ -48,6 +48,8 @@ #include #include #include + +#if LPM_CONF_ENABLE != 0 /*---------------------------------------------------------------------------*/ #if ENERGEST_CONF_ON static unsigned long irq_energest = 0; @@ -378,4 +380,5 @@ lpm_init() LPM_STATS_INIT(); } /*---------------------------------------------------------------------------*/ +#endif /* LPM_CONF_ENABLE != 0 */ /** @} */ diff --git a/cpu/cc2538/lpm.h b/cpu/cc2538/lpm.h index 0c497b5be..60dc46693 100644 --- a/cpu/cc2538/lpm.h +++ b/cpu/cc2538/lpm.h @@ -212,6 +212,7 @@ void lpm_register_peripheral(lpm_periph_permit_pm1_func_t permit_pm1_func); #define lpm_enter() #define lpm_exit() #define lpm_set_max_pm(...) +#define lpm_register_peripheral(...) #endif #endif /* LPM_H_ */