Skip to content

Commit

Permalink
[genio] supports more examples and bug fixes.
Browse files Browse the repository at this point in the history
* add support of ota example
* add support of thermostat example
* add support of lock example
* add support of light switch example
* add support of color in lighting example
* fix factory reset button
* fix ipv4 and ipv6 event logic
  • Loading branch information
pakls committed Oct 31, 2022
1 parent 81a64dc commit 30b0267
Show file tree
Hide file tree
Showing 115 changed files with 13,852 additions and 235 deletions.
27 changes: 27 additions & 0 deletions examples/light-switch-app/genio/.gn
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# 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.

import("//build_overrides/build.gni")

# The location of the build configuration file.
buildconfig = "${build_root}/config/BUILDCONFIG.gn"

# CHIP uses angle bracket includes.
check_system_includes = true

default_args = {
target_cpu = "arm"
target_os = "freertos"
import("//args.gni")
}
117 changes: 117 additions & 0 deletions examples/light-switch-app/genio/BUILD.gn
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
# Copyright (c) 2022 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.

import("//build_overrides/build.gni")
import("//build_overrides/chip.gni")
import("//build_overrides/mt793x_sdk.gni")
import("//build_overrides/pigweed.gni")

import("${build_root}/config/defaults.gni")
import("${mt793x_sdk_build_root}/mt793x_executable.gni")
import("${mt793x_sdk_build_root}/mt793x_sdk.gni")

import("${chip_root}/examples/common/pigweed/pigweed_rpcs.gni")
import("${chip_root}/src/platform/device.gni")

if (chip_enable_pw_rpc) {
import("//build_overrides/pigweed.gni")
import("$dir_pw_build/target_types.gni")
}

assert(current_os == "freertos")

mt793x_project_dir = "${chip_root}/examples/light-switch-app/genio"
mt793x_examples_plat_dir = "${chip_root}/examples/platform/mt793x"

declare_args() {
# Dump memory usage at link time.
chip_print_memory_usage = true

# PIN code for PASE session establishment.
setupPinCode = 20202021
setupDiscriminator = 3840
}

mt793x_sdk("sdk") {
sources = [
"${mt793x_project_dir}/include/CHIPProjectConfig.h",
"${mt793x_project_dir}/include/FreeRTOSConfig.h",
]

include_dirs = [
"${chip_root}/src/platform/mt793x",
"${mt793x_project_dir}/include",
"${mt793x_examples_plat_dir}",
"${chip_root}/src/lib",
]

defines = [ "OPENTHREAD_CONFIG_CLI_TRANSPORT=OT_CLI_TRANSPORT_CONSOLE" ]

defines += [
"CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE=${setupPinCode}",
"CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR=${setupDiscriminator}",
]
}

mt793x_executable("light_switch_app") {
output_name = "chip-mt793x-light-switch-app-example.out"
include_dirs = [ "include" ]
defines = []

sources = [
"src/BindingHandler.cpp",
"src/AppTask.cpp",
"src/ZclCallbacks.cpp",
"src/main.cpp",
"src/LEDWidget.cpp",
]

deps = [
":sdk",
"${chip_root}/examples/common/QRCode",
"${chip_root}/examples/light-switch-app/light-switch-common",
"${chip_root}/examples/providers:device_info_provider",
"${chip_root}/src/lib",
"${chip_root}/src/setup_payload",
"${mt793x_examples_plat_dir}:genio-matter-shell",
]

if (chip_enable_ota_requestor) {
defines += [ "MT793X_OTA_ENABLED" ]
sources += [ "${examples_plat_dir}/OTAConfig.cpp" ]
}

ldscript = "mt793x_xip.ld"

inputs = [ ldscript ]

ldflags = [ "-T" + rebase_path(ldscript, root_build_dir) ]

if (chip_print_memory_usage) {
ldflags += [
"-Wl,--print-memory-usage",
"-fstack-usage",
]
}

output_dir = root_out_dir
}

group("mt793x") {
deps = [ ":light_switch_app" ]
}

group("default") {
deps = [ ":mt793x" ]
}
Loading

0 comments on commit 30b0267

Please sign in to comment.