Skip to content

Commit

Permalink
Restyled by gn
Browse files Browse the repository at this point in the history
  • Loading branch information
restyled-commits authored and andrei-menzopol committed Feb 5, 2024
1 parent 086c0b9 commit e7b33e6
Show file tree
Hide file tree
Showing 14 changed files with 172 additions and 194 deletions.
3 changes: 1 addition & 2 deletions config/nxp/lib/pw_rpc/pw_rpc.gni
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ import("//build_overrides/pigweed.gni")
pw_log_BACKEND = "$dir_pw_log_basic"
pw_assert_BACKEND = "$dir_pw_assert_log:check_backend"
pw_rpc_CONFIG = "$dir_pw_rpc:disable_global_mutex"
pw_sys_io_BACKEND =
"${chip_root}/examples/platform/nxp/pw_sys_io:pw_sys_io_nxp"
pw_sys_io_BACKEND = "${chip_root}/examples/platform/nxp/pw_sys_io:pw_sys_io_nxp"

pw_build_LINK_DEPS = [
"$dir_pw_assert:impl",
Expand Down
1 change: 1 addition & 0 deletions examples/contact-sensor-app/nxp/k32w/k32w1/.gn
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ default_args = {
target_os = "freertos"

import("//args.gni")

# Import default platform configs
import("${chip_root}/src/platform/nxp/k32w/k32w1/args.gni")
}
5 changes: 1 addition & 4 deletions examples/contact-sensor-app/nxp/k32w/k32w1/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ k32w1_executable("contact_sensor_app") {

ldscript = "${k32w1_sdk_root}/middleware/wireless/framework/Common/devices/kw45_k32w1/gcc/connectivity.ld"


inputs = [ ldscript ]

ldflags = [
Expand All @@ -129,9 +128,7 @@ k32w1_executable("contact_sensor_app") {
]

if (chip_with_factory_data == 1) {
ldflags += [
"-Wl,--defsym=gUseFactoryData_d=1"
]
ldflags += [ "-Wl,--defsym=gUseFactoryData_d=1" ]
}

output_dir = root_out_dir
Expand Down
1 change: 1 addition & 0 deletions examples/lighting-app/nxp/k32w/k32w1/.gn
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ default_args = {
target_os = "freertos"

import("//args.gni")

# Import default platform configs
import("${chip_root}/src/platform/nxp/k32w/k32w1/args.gni")
}
5 changes: 1 addition & 4 deletions examples/lighting-app/nxp/k32w/k32w1/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.


import("//build_overrides/chip.gni")
import("//build_overrides/nxp_sdk.gni")
import("//build_overrides/openthread.gni")
Expand Down Expand Up @@ -156,9 +155,7 @@ k32w1_executable("light_app") {
]

if (chip_with_factory_data == 1) {
ldflags += [
"-Wl,--defsym=gUseFactoryData_d=1"
]
ldflags += [ "-Wl,--defsym=gUseFactoryData_d=1" ]
}

if (use_smu2_static) {
Expand Down
2 changes: 1 addition & 1 deletion examples/platform/nxp/pw_rpc_server.gni
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ pw_rpc_server = {
"${nxp_platform_dir}/PigweedLogger.cpp",
"${nxp_platform_dir}/Rpc.cpp",
]

include_dirs = [
"${chip_root}/examples/common",
"${chip_root}/examples/common/pigweed",
Expand Down
8 changes: 4 additions & 4 deletions examples/platform/nxp/pw_sys_io/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -13,29 +13,29 @@
# limitations under the License.

import("//build_overrides/chip.gni")
import("//build_overrides/pigweed.gni")
import("//build_overrides/nxp_sdk.gni")
import("//build_overrides/pigweed.gni")

import("$dir_pw_build/target_types.gni")
import("${chip_root}/src/platform/device.gni")

config("default_config") {
include_dirs = [
"public",
"${chip_root}/src/"
"${chip_root}/src/",
]
}

pw_source_set("pw_sys_io_nxp") {
sources = [
"${chip_root}/src/lib/shell/streamer_nxp.cpp",
"sys_io_nxp.cc",
"${chip_root}/src/lib/shell/streamer_nxp.cpp"
]

deps = [
"$dir_pw_sys_io:default_putget_bytes",
"$dir_pw_sys_io:facade",
"${nxp_sdk_build_root}/${nxp_sdk_name}:nxp_sdk"
"${nxp_sdk_build_root}/${nxp_sdk_name}:nxp_sdk",
]

public_configs = [ ":default_config" ]
Expand Down
3 changes: 2 additions & 1 deletion src/platform/device.gni
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ declare_args() {
# Enable openthread support.
chip_enable_openthread =
chip_device_platform == "linux" || chip_device_platform == "qpg" ||
chip_device_platform == "cc13x2_26x2" || chip_device_platform == "cc13x4_26x4" ||
chip_device_platform == "cc13x2_26x2" ||
chip_device_platform == "cc13x4_26x4" ||
chip_device_platform == "k32w0" || chip_device_platform == "tizen" ||
chip_device_platform == "stm32" || chip_device_platform == "webos"
}
Expand Down
38 changes: 17 additions & 21 deletions src/platform/nxp/k32w/k32w1/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@ static_library("nxp_platform") {
]

public = [
"${chip_root}/src/platform/nxp/k32w/k32w1/BLEManagerImpl.h",
"${chip_root}/src/credentials/DeviceAttestationCredsProvider.h",
"${chip_root}/src/credentials/examples/DeviceAttestationCredsExample.h",
"${chip_root}/src/credentials/examples/ExampleDACs.h",
"${chip_root}/src/credentials/examples/ExamplePAI.h",
"${chip_root}/src/platform/nxp/k32w/k32w1/BLEManagerImpl.h",
"${chip_root}/src/platform/nxp/k32w/k32w1/SMU2Manager.h"
"${chip_root}/src/platform/nxp/k32w/k32w1/BLEManagerImpl.h",
"${chip_root}/src/platform/nxp/k32w/k32w1/SMU2Manager.h",
]

public_deps = [ "${chip_root}/src/platform:platform_base" ]
Expand All @@ -76,9 +76,7 @@ static_library("nxp_platform") {
}

if (chip_enable_ota_requestor) {
public += [
"../common/OTAImageProcessorImpl.h"
]
public += [ "../common/OTAImageProcessorImpl.h" ]

sources += [
"../common/OTAImageProcessorImpl.cpp",
Expand All @@ -98,24 +96,22 @@ static_library("nxp_platform") {
"K32W1PersistentStorageOpKeystore.h",
]

if (chip_with_factory_data == 1) {
sources += [
"../common/FactoryDataProvider.cpp",
"FactoryDataProviderImpl.cpp",
]
public += [
"${chip_root}/src/credentials/CHIPCert.h",
"${chip_root}/src/credentials/CertificationDeclaration.h",
]
if (chip_with_factory_data == 1) {
sources += [
"../common/FactoryDataProvider.cpp",
"FactoryDataProviderImpl.cpp",
]
public += [
"${chip_root}/src/credentials/CHIPCert.h",
"${chip_root}/src/credentials/CertificationDeclaration.h",
]

if (chip_convert_dac_private_key == 1) {
defines = [ "CHIP_DEVICE_CONFIG_SECURE_DAC_PRIVATE_KEY=1" ]
if (chip_convert_dac_private_key == 1) {
defines = [ "CHIP_DEVICE_CONFIG_SECURE_DAC_PRIVATE_KEY=1" ]
}
}
}

public_deps += [
"${mbedtls_root}:mbedtls",
]
public_deps += [ "${mbedtls_root}:mbedtls" ]
}

deps = []
Expand Down Expand Up @@ -146,6 +142,6 @@ static_library("nxp_platform") {

public_deps += [
"${chip_root}/src/crypto",
"${chip_root}/src/platform/logging:headers"
"${chip_root}/src/platform/logging:headers",
]
}
5 changes: 3 additions & 2 deletions src/platform/nxp/k32w/k32w1/args.gni
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ chip_project_config_include = "<CHIPProjectConfig.h>"
chip_inet_project_config_include = "<CHIPProjectConfig.h>"
chip_system_project_config_include = "<CHIPProjectConfig.h>"
chip_ble_project_config_include = "<CHIPProjectConfig.h>"
chip_project_config_include_dirs = ["${chip_root}/examples/platform/${nxp_platform}/app/project_include"]
chip_project_config_include_dirs =
[ "${chip_root}/examples/platform/${nxp_platform}/app/project_include" ]

chip_enable_openthread = true

Expand All @@ -61,7 +62,7 @@ openthread_external_mbedtls = mbedtls_target

openthread_project_core_config_file = "OpenThreadConfig.h"
openthread_core_config_platform_check_file =
"openthread-core-k32w1-config-check.h"
"openthread-core-k32w1-config-check.h"
openthread_core_config_deps = [ "${chip_root}/examples/platform/nxp/k32w/k32w1:openthread_core_config_k32w1_chip_examples" ]

openthread_external_platform = "${chip_root}/third_party/openthread/platforms/nxp/k32w/k32w1:libopenthread-k32w1"
16 changes: 8 additions & 8 deletions third_party/nxp/k32w1_sdk/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ config("mbedtls_k32w1_config") {
"MBEDTLS_ERROR_C",
"MBEDTLS_PKCS5_C",

"MBEDTLS_ECP_FIXED_POINT_OPTIM=0", # To reduce peak memory usage
"MBEDTLS_ECP_FIXED_POINT_OPTIM=0", # To reduce peak memory usage
"MBEDTLS_MPI_WINDOW_SIZE=1",
"MBEDTLS_ECP_WINDOW_SIZE=2",
"MBEDTLS_MPI_MAX_SIZE=32", # Maximum number of bytes for usable MPIs.
"MBEDTLS_ECP_MAX_BITS=256", # Maximum bit size of groups */
"MBEDTLS_ENTROPY_MAX_SOURCES=1", # Maximum number of sources supported
"MBEDTLS_MPI_MAX_SIZE=32", # Maximum number of bytes for usable MPIs.
"MBEDTLS_ECP_MAX_BITS=256", # Maximum bit size of groups */
"MBEDTLS_ENTROPY_MAX_SOURCES=1", # Maximum number of sources supported

"MBEDTLS_ENTROPY_HARDWARE_ALT",
]
Expand All @@ -68,18 +68,18 @@ config("mbedtls_k32w1_config") {
}

if (chip_crypto == "platform") {
defines += [
# "MBEDTLS_CCM_ALT",
]
defines += [
# "MBEDTLS_CCM_ALT",
]
}

include_dirs = [ chip_root ]
}

mbedtls_target("mbedtls") {
sources = [
"${k32w1_sdk_root}/middleware/mbedtls/port/sssapi/entropy_poll_alt.c",
"${k32w1_sdk_root}/middleware/mbedtls/port/sssapi/ccm_alt.c",
"${k32w1_sdk_root}/middleware/mbedtls/port/sssapi/entropy_poll_alt.c",
]

public_configs = [ ":mbedtls_k32w1_config" ]
Expand Down
Loading

0 comments on commit e7b33e6

Please sign in to comment.