Skip to content

Commit

Permalink
[low-power] fix CSL_RECEIVER build option (#5428)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Irving-cl committed Aug 20, 2020
1 parent 0bcc261 commit e438c2e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 1 addition & 3 deletions src/core/config/mac.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions src/core/radio/radio.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,7 @@ class Radio : public InstanceLocator, private NonCopyable
*/
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.
*
Expand All @@ -436,6 +437,7 @@ class Radio : public InstanceLocator, private NonCopyable
{
return otPlatRadioEnableCsl(GetInstance(), aCslPeriod, aExtAddr);
}
#endif // OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE

/**
* This method gets the radio transmit frame buffer.
Expand Down

0 comments on commit e438c2e

Please sign in to comment.