From e438c2e383f81d23da69b67f17e9260368b5cc68 Mon Sep 17 00:00:00 2001 From: Li Cao Date: Fri, 21 Aug 2020 01:34:55 +0800 Subject: [PATCH] [low-power] fix CSL_RECEIVER build option (#5428) This commit removes the config setting OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE automatically when it's 1.2 and MTD. The reason is that it's in core config and it's also used in platform (radio) which cannot access core config. If CSL_RECEIVER is not set in options in cmake and it's 1.2, then in core config, OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE would be turned on if it's MTD. While in platform, it's not turned on. And then there would be a link issue. --- src/core/config/mac.h | 4 +--- src/core/radio/radio.hpp | 2 ++ 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/config/mac.h b/src/core/config/mac.h index 081ea87ac..051d8971a 100644 --- a/src/core/config/mac.h +++ b/src/core/config/mac.h @@ -318,12 +318,10 @@ * @def OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE * * This setting configures the CSL receiver feature in Thread 1.2. - * This is compulsory for 1.2 MTD, optional for 1.2 FTD. * */ #ifndef OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE -#define OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE \ - (OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_2) && OPENTHREAD_MTD +#define OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE 0 #endif #if OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE diff --git a/src/core/radio/radio.hpp b/src/core/radio/radio.hpp index bfe9eb592..727e76b51 100644 --- a/src/core/radio/radio.hpp +++ b/src/core/radio/radio.hpp @@ -413,6 +413,7 @@ public: */ otError Receive(uint8_t aChannel) { return otPlatRadioReceive(GetInstance(), aChannel); } +#if OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE /** * This method updates the CSL sample time in radio. * @@ -436,6 +437,7 @@ public: { return otPlatRadioEnableCsl(GetInstance(), aCslPeriod, aExtAddr); } +#endif // OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE /** * This method gets the radio transmit frame buffer.