Skip to content

Commit

Permalink
ESP32: Enable shell command for external platform feature (#25648)
Browse files Browse the repository at this point in the history
* ESP32: Enable shell command for external platform feature

* Restyled by gn

---------

Co-authored-by: Restyled.io <commits@restyled.io>
  • Loading branch information
2 people authored and pull[bot] committed Sep 27, 2023
1 parent 5148707 commit 5256254
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
3 changes: 3 additions & 0 deletions config/esp32/components/chip/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,9 @@ endif()

if (CONFIG_CHIP_ENABLE_EXTERNAL_PLATFORM)
chip_gn_arg_append("chip_device_platform" "\"external\"")
if (CONFIG_ENABLE_CHIP_SHELL)
chip_gn_arg_append("chip_shell_platform" "\"esp32\"")
endif()
chip_gn_arg_append("chip_platform_target" "\"//${CONFIG_CHIP_EXTERNAL_PLATFORM_DIR}\"")
endif()

Expand Down
4 changes: 3 additions & 1 deletion src/lib/shell/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import("//build_overrides/chip.gni")

import("${chip_root}/src/lib/core/core.gni")
import("${chip_root}/src/lib/shell/shell_device.gni")
import("${chip_root}/src/platform/device.gni")

source_set("shell_core") {
Expand Down Expand Up @@ -43,7 +44,8 @@ static_library("shell") {
sources += [ "streamer_stdio.cpp" ]
}

if (chip_device_platform == "esp32") {
if (chip_device_platform == "esp32" ||
(chip_device_platform == "external" && chip_shell_platform == "esp32")) {
sources += [
"MainLoopESP32.cpp",
"streamer_esp32.cpp",
Expand Down
18 changes: 18 additions & 0 deletions src/lib/shell/shell_device.gni
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright (c) 2020 Project CHIP Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

declare_args() {
# Enable shell support
chip_shell_platform = ""
}

0 comments on commit 5256254

Please sign in to comment.