-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Infineon] Implement event-based Thread stack task for CYW30739. (#25796
) * [Infineon] Implement event-based Thread stack task for CYW30739. * Add EventFlags for platform-specific wrappers of event flags. * Implement otTaskletsSignalPending and otSysEventSignalPending callback functions for the OpenThread stack to notify the Thread stack task if there are pending events to be processed. * Update CYW30739 SDK and ot-ifx submodules for the event-based implementations. * Use the default value of CHIP_DEVICE_CONFIG_EVENT_LOGGING_CRIT_BUFFER_SIZE. * Disable OTA of lighting and lock apps because CYW30739 is running out of flash. * Enable OTA and disable FTD for the flash space. * Fix the documents.
- Loading branch information
Showing
15 changed files
with
176 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
/* | ||
* | ||
* Copyright (c) 2022 Project CHIP Authors | ||
* Copyright (c) 2019 Nest Labs, Inc. | ||
* | ||
* 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. | ||
*/ | ||
|
||
/** | ||
* @file | ||
* Provides a class that serves as a wrapper for the event system of CYW30739 | ||
* platform's underlying RTOS. An event instance is comprised of 32 flags. | ||
* Each flag can be utilized for thread synchronization purposes. | ||
*/ | ||
#include "EventFlags.h" | ||
|
||
#include <lib/support/CodeUtils.h> | ||
|
||
namespace chip { | ||
namespace DeviceLayer { | ||
|
||
CHIP_ERROR EventFlags::Init(void) | ||
{ | ||
CHIP_ERROR err = CHIP_NO_ERROR; | ||
wiced_result_t result; | ||
|
||
mFlags = wiced_rtos_create_event_flags(); | ||
VerifyOrExit(mFlags != nullptr, err = CHIP_ERROR_NO_MEMORY); | ||
|
||
result = wiced_rtos_init_event_flags(mFlags); | ||
VerifyOrExit(result == WICED_SUCCESS, err = CHIP_ERROR_NO_MEMORY); | ||
|
||
exit: | ||
return err; | ||
} | ||
|
||
CHIP_ERROR EventFlags::Set(uint32_t flags) | ||
{ | ||
assert(!wiced_rtos_check_for_stack_overflow()); | ||
|
||
if (wiced_rtos_set_event_flags(mFlags, flags) != WICED_SUCCESS) | ||
{ | ||
ChipLogError(DeviceLayer, "wiced_rtos_set_event_flags %08lx", flags); | ||
return CHIP_ERROR_INTERNAL; | ||
} | ||
return CHIP_NO_ERROR; | ||
} | ||
|
||
CHIP_ERROR EventFlags::WaitAnyForever(uint32_t & flags) | ||
{ | ||
const wiced_result_t result = | ||
wiced_rtos_wait_for_event_flags(mFlags, 0xffffffff, &flags, WICED_TRUE, WAIT_FOR_ANY_EVENT, WICED_WAIT_FOREVER); | ||
if (result != WICED_SUCCESS) | ||
{ | ||
ChipLogError(DeviceLayer, "wiced_rtos_wait_for_event_flags 0x%08x", result); | ||
return CHIP_ERROR_INTERNAL; | ||
} | ||
return CHIP_NO_ERROR; | ||
} | ||
|
||
} // namespace DeviceLayer | ||
} // namespace chip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/* | ||
* | ||
* Copyright (c) 2022 Project CHIP Authors | ||
* Copyright (c) 2019 Nest Labs, Inc. | ||
* | ||
* 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. | ||
*/ | ||
|
||
/** | ||
* @file | ||
* Provides a class that serves as a wrapper for the event system of CYW30739 | ||
* platform's underlying RTOS. An event instance is comprised of 32 flags. | ||
* Each flag can be utilized for thread synchronization purposes. | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include <lib/core/CHIPError.h> | ||
#include <wiced_rtos.h> | ||
|
||
namespace chip { | ||
namespace DeviceLayer { | ||
|
||
/** | ||
* A class represents an event group with 32 flags. | ||
*/ | ||
class EventFlags | ||
{ | ||
public: | ||
CHIP_ERROR Init(void); | ||
CHIP_ERROR Set(uint32_t flags); | ||
CHIP_ERROR WaitAnyForever(uint32_t & flags); | ||
|
||
private: | ||
wiced_event_flags_t * mFlags; | ||
}; | ||
|
||
} // namespace DeviceLayer | ||
} // namespace chip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule 30739A0
updated
12 files
Submodule CYW930739M2EVB-01
updated
from d5f5b6 to d3e46e
Submodule btsdk-include
updated
36 files
+11 −10 | LICENSE.txt | |
+237 −9 | hci_control_api.h | |
+1 −1 | hsl_rgb_lib.h | |
+1 −1 | version.xml | |
+3 −3 | wiced_bt_anc.h | |
+1 −1 | wiced_bt_anp.h | |
+1 −1 | wiced_bt_ans.h | |
+24 −15 | wiced_bt_battery_client.h | |
+462 −0 | wiced_bt_battery_server.h | |
+2 −2 | wiced_bt_beacon.h | |
+68 −26 | wiced_bt_factory_app_config.h | |
+1 −1 | wiced_bt_hci_firmware_upgrade.h | |
+3 −3 | wiced_bt_hrc.h | |
+1 −1 | wiced_bt_hrp.h | |
+3 −3 | wiced_bt_hrs.h | |
+12 −2 | wiced_bt_iap2.h | |
+1 −1 | wiced_bt_map_def.h | |
+1 −1 | wiced_bt_mce_api.h | |
+3 −1 | wiced_bt_mesh_app.h | |
+1 −2 | wiced_bt_mesh_cfg.h | |
+1 −1 | wiced_bt_mesh_client.h | |
+222 −93 | wiced_bt_mesh_core.h | |
+2 −1 | wiced_bt_mesh_event.h | |
+6 −5 | wiced_bt_mesh_model_defs.h | |
+15 −3 | wiced_bt_mesh_model_utils.h | |
+47 −56 | wiced_bt_mesh_models.h | |
+42 −9 | wiced_bt_mesh_provision.h | |
+1 −1 | wiced_bt_ota_firmware_upgrade.h | |
+1 −1 | wiced_bt_pan.h | |
+1 −1 | wiced_bt_serial_gatt.h | |
+1 −1 | wiced_bt_spp.h | |
+1 −1 | wiced_bt_utils.h | |
+1 −1 | wiced_firmware_upgrade.h | |
+3 −3 | wiced_hal_puart.h | |
+1 −1 | wiced_platform_audio_common.h | |
+1 −1 | wiced_thermistor.h |
Submodule btsdk-tools
updated
33 files
Submodule ot-ifx
updated
23 files
+8 −0 | .github/dependabot.yml | |
+12 −15 | .github/workflows/build.yml | |
+1 −1 | openthread | |
+2 −1 | script/build | |
+4 −2 | script/flash | |
+12 −5 | script/make-pretty | |
+11 −19 | src/cyw30739/alarm.c | |
+5 −5 | src/cyw30739/crypto/aes_ccm_alt.cpp | |
+2 −2 | src/cyw30739/crypto/aes_ccm_alt.hpp | |
+6 −3 | src/cyw30739/ifx_ot_cli_cmd.c | |
+6 −6 | src/cyw30739/mbedtls/include/ccm_alt.h | |
+5 −5 | src/cyw30739/mbedtls/include/sha256_alt.h | |
+12 −12 | src/cyw30739/mbedtls/library/ccm_alt.c | |
+5 −11 | src/cyw30739/mbedtls/library/sha256_alt.c | |
+1 −4 | src/cyw30739/misc.c | |
+46 −69 | src/cyw30739/radio.c | |
+8 −8 | src/cyw30739/settings.c | |
+186 −8 | src/cyw30739/system.c | |
+70 −0 | src/cyw30739/system.h | |
+6 −10 | src/cyw30739/uart.c | |
+1 −1 | third_party/infineon/btsdk-include | |
+1 −1 | third_party/infineon/platform/cyw30739/30739a0 | |
+1 −1 | third_party/infineon/platform/cyw30739/bsp/cyw930739m2evb-01/TARGET_CYW930739M2EVB-01 |