From f47ce538dcbb37b3bda40f15cca587f0c01cbe0b Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Wed, 13 Sep 2023 20:41:51 -0400 Subject: [PATCH] Make sure CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR is always defined. (#29224) Possibly as 0. --- examples/pump-app/cc13x2x7_26x2x7/main/AppTask.cpp | 6 +++--- examples/pump-app/cc13x4_26x4/main/AppTask.cpp | 6 +++--- .../pump-controller-app/cc13x2x7_26x2x7/main/AppTask.cpp | 6 +++--- examples/pump-controller-app/cc13x4_26x4/main/AppTask.cpp | 6 +++--- src/platform/BUILD.gn | 6 +++--- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/examples/pump-app/cc13x2x7_26x2x7/main/AppTask.cpp b/examples/pump-app/cc13x2x7_26x2x7/main/AppTask.cpp index 6fe2ee9973b3d7..625d48392f59a8 100644 --- a/examples/pump-app/cc13x2x7_26x2x7/main/AppTask.cpp +++ b/examples/pump-app/cc13x2x7_26x2x7/main/AppTask.cpp @@ -33,7 +33,7 @@ #include #include -#if defined(CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR) +#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR #include #include #include @@ -81,7 +81,7 @@ AppTask AppTask::sAppTask; static DeviceCallbacks sDeviceCallbacks; -#if defined(CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR) +#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR static DefaultOTARequestor sRequestorCore; static DefaultOTARequestorStorage sRequestorStorage; static DefaultOTARequestorDriver sRequestorUser; @@ -231,7 +231,7 @@ int AppTask::Init() ConfigurationMgr().LogDeviceConfig(); -#if defined(CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR) +#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR InitializeOTARequestor(); #endif diff --git a/examples/pump-app/cc13x4_26x4/main/AppTask.cpp b/examples/pump-app/cc13x4_26x4/main/AppTask.cpp index 4e70c312e77f33..8611b750f80a34 100644 --- a/examples/pump-app/cc13x4_26x4/main/AppTask.cpp +++ b/examples/pump-app/cc13x4_26x4/main/AppTask.cpp @@ -34,7 +34,7 @@ #include #include -#if defined(CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR) +#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR #include #include #include @@ -82,7 +82,7 @@ AppTask AppTask::sAppTask; static DeviceCallbacks sDeviceCallbacks; -#if defined(CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR) +#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR static DefaultOTARequestor sRequestorCore; static DefaultOTARequestorStorage sRequestorStorage; static DefaultOTARequestorDriver sRequestorUser; @@ -231,7 +231,7 @@ int AppTask::Init() ConfigurationMgr().LogDeviceConfig(); -#if defined(CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR) +#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR InitializeOTARequestor(); #endif diff --git a/examples/pump-controller-app/cc13x2x7_26x2x7/main/AppTask.cpp b/examples/pump-controller-app/cc13x2x7_26x2x7/main/AppTask.cpp index e7dadb13f75fad..cc59f4daee7b26 100644 --- a/examples/pump-controller-app/cc13x2x7_26x2x7/main/AppTask.cpp +++ b/examples/pump-controller-app/cc13x2x7_26x2x7/main/AppTask.cpp @@ -30,7 +30,7 @@ #include #include -#if defined(CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR) +#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR #include #include #include @@ -70,7 +70,7 @@ static Button_Handle sAppRightHandle; AppTask AppTask::sAppTask; -#if defined(CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR) +#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR static DefaultOTARequestor sRequestorCore; static DefaultOTARequestorStorage sRequestorStorage; static DefaultOTARequestorDriver sRequestorUser; @@ -225,7 +225,7 @@ int AppTask::Init() ConfigurationMgr().LogDeviceConfig(); -#if defined(CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR) +#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR InitializeOTARequestor(); #endif diff --git a/examples/pump-controller-app/cc13x4_26x4/main/AppTask.cpp b/examples/pump-controller-app/cc13x4_26x4/main/AppTask.cpp index 3d8b0bf2033b34..b51878e64651b6 100644 --- a/examples/pump-controller-app/cc13x4_26x4/main/AppTask.cpp +++ b/examples/pump-controller-app/cc13x4_26x4/main/AppTask.cpp @@ -30,7 +30,7 @@ #include #include -#if defined(CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR) +#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR #include #include #include @@ -70,7 +70,7 @@ static Button_Handle sAppRightHandle; AppTask AppTask::sAppTask; -#if defined(CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR) +#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR static DefaultOTARequestor sRequestorCore; static DefaultOTARequestorStorage sRequestorStorage; static DefaultOTARequestorDriver sRequestorUser; @@ -225,7 +225,7 @@ int AppTask::Init() ConfigurationMgr().LogDeviceConfig(); -#if defined(CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR) +#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR InitializeOTARequestor(); #endif diff --git a/src/platform/BUILD.gn b/src/platform/BUILD.gn index 5c1f079cef3cf9..86d5c3f4476fbb 100644 --- a/src/platform/BUILD.gn +++ b/src/platform/BUILD.gn @@ -133,9 +133,9 @@ if (chip_device_platform != "none" && chip_device_platform != "external") { ] } - if (chip_enable_ota_requestor) { - defines += [ "CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR=1" ] - } + defines += [ + "CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR=${chip_enable_ota_requestor}", + ] if (chip_device_project_config_include != "") { defines += [ "CHIP_DEVICE_PROJECT_CONFIG_INCLUDE=${chip_device_project_config_include}" ]