Skip to content

Commit

Permalink
Adding conditional compilation for jlink/segger_rtt code (#23777)
Browse files Browse the repository at this point in the history
* Adding conditional compilation for jlink/segger_rtt code

* Review remarks addressed
  • Loading branch information
milanr-q authored and pull[bot] committed Sep 28, 2023
1 parent 639db62 commit 636ebed
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
7 changes: 6 additions & 1 deletion src/platform/device.gni
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ declare_args() {
build_tv_casting_common_a = false
}

assert(chip_disable_platform_kvs == false || chip_device_platform == "darwin",
assert(!chip_disable_platform_kvs || chip_device_platform == "darwin",
"Can only disable KVS on some platforms")

if (_chip_device_layer != "none" && chip_device_platform != "external") {
Expand All @@ -201,6 +201,11 @@ if (_chip_device_layer != "none" && chip_device_platform != "external") {
"<platform/" + _chip_device_layer + "/SystemPlatformConfig.h>"
}

declare_args() {
# Enable jlink/segger_rtt support.
chip_enable_segger_rtt = chip_device_platform != "qpg"
}

assert(
(current_os != "freertos" && chip_device_platform == "none") ||
chip_device_platform == "fake" ||
Expand Down
19 changes: 13 additions & 6 deletions third_party/openthread/platforms/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import("//build_overrides/chip.gni")
import("//build_overrides/jlink.gni")
import("//build_overrides/openthread.gni")
import("${chip_root}/src/platform/device.gni")

config("libopenthread-platform_config") {
include_dirs = [ "${openthread_root}/examples/platforms" ]
Expand Down Expand Up @@ -45,19 +47,24 @@ static_library("libopenthread-platform-utils") {
"${openthread_root}/examples/platforms/utils/code_utils.h",
"${openthread_root}/examples/platforms/utils/debug_uart.c",
"${openthread_root}/examples/platforms/utils/encoding.h",
"${openthread_root}/examples/platforms/utils/logging_rtt.c",
"${openthread_root}/examples/platforms/utils/logging_rtt.h",
"${openthread_root}/examples/platforms/utils/mac_frame.cpp",
"${openthread_root}/examples/platforms/utils/mac_frame.h",
"${openthread_root}/examples/platforms/utils/settings.h",
"${openthread_root}/examples/platforms/utils/settings_ram.c",
"${openthread_root}/examples/platforms/utils/soft_source_match_table.c",
"${openthread_root}/examples/platforms/utils/soft_source_match_table.h",
]
public_deps = [
"${openthread_root}/src/core:libopenthread_core_headers",
"${segger_rtt_root}:segger_rtt",
]

public_deps = [ "${openthread_root}/src/core:libopenthread_core_headers" ]

if (chip_enable_segger_rtt) {
sources += [
"${openthread_root}/examples/platforms/utils/logging_rtt.c",
"${openthread_root}/examples/platforms/utils/logging_rtt.h",
]

public_deps += [ "${segger_rtt_root}:segger_rtt" ]
}

public_configs = [ ":libopenthread-platform_config" ]
}

0 comments on commit 636ebed

Please sign in to comment.