Skip to content

Commit

Permalink
[cmake] use OPENTHREAD_PLATFORM_CORE_CONFIG_FILE (#618)
Browse files Browse the repository at this point in the history
This commit changes the `CMakeList.txt` to use the newly added
`OPENTHREAD_PLATFORM_CORE_CONFIG_FILE` to specify the OT core
config header to use by platform instead of using the project
specific `PROJECT_CORE_CONFIG_FILE` header. It also removed the
use of now deprecated `OPENTHREAD_CONFIG_FILE`.

This allows a project using nrf platform to define its own set
configs, while still using the platform specified one from
`PLATFORM_CORE_CONFIG_FILE` as default for any unspecified
configs.

This commit also adds `#ifndef` check before defining a config in
the `openthread-core-nrf5282xxx-config.h` headers.
  • Loading branch information
abtink authored Jul 31, 2023
1 parent 8655ddf commit 4d00cbe
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
3 changes: 1 addition & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin)
add_subdirectory(openthread)

target_compile_definitions(ot-config INTERFACE
OPENTHREAD_CONFIG_FILE="openthread-core-${NRF_PLATFORM}-config.h"
OPENTHREAD_PROJECT_CORE_CONFIG_FILE="openthread-core-${NRF_PLATFORM}-config.h"
OPENTHREAD_PLATFORM_CORE_CONFIG_FILE="openthread-core-${NRF_PLATFORM}-config.h"
OPENTHREAD_CORE_CONFIG_PLATFORM_CHECK_FILE="openthread-core-${NRF_PLATFORM}-config-check.h"
)

Expand Down
2 changes: 2 additions & 0 deletions src/nrf52811/openthread-core-nrf52811-config.h
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,10 @@
*
*/
#if OPENTHREAD_CONFIG_TIME_SYNC_ENABLE
#ifndef OPENTHREAD_CONFIG_MAC_HEADER_IE_SUPPORT
#define OPENTHREAD_CONFIG_MAC_HEADER_IE_SUPPORT 1
#endif
#endif

/**
* @def RADIO_CONFIG_SRC_MATCH_SHORT_ENTRY_NUM
Expand Down
2 changes: 2 additions & 0 deletions src/nrf52833/openthread-core-nrf52833-config.h
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,10 @@
*
*/
#if OPENTHREAD_CONFIG_TIME_SYNC_ENABLE
#ifndef OPENTHREAD_CONFIG_MAC_HEADER_IE_SUPPORT
#define OPENTHREAD_CONFIG_MAC_HEADER_IE_SUPPORT 1
#endif
#endif

/**
* @def RADIO_CONFIG_SRC_MATCH_SHORT_ENTRY_NUM
Expand Down
2 changes: 2 additions & 0 deletions src/nrf52840/openthread-core-nrf52840-config.h
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,10 @@
*
*/
#if OPENTHREAD_CONFIG_TIME_SYNC_ENABLE
#ifndef OPENTHREAD_CONFIG_MAC_HEADER_IE_SUPPORT
#define OPENTHREAD_CONFIG_MAC_HEADER_IE_SUPPORT 1
#endif
#endif

/**
* @def RADIO_CONFIG_SRC_MATCH_SHORT_ENTRY_NUM
Expand Down

0 comments on commit 4d00cbe

Please sign in to comment.