mirror of
https://github.com/espressif/esp-idf.git
synced 2026-08-18 06:35:35 +03:00
feat(openthread): support vendor hook for rcp spi
This commit is contained in:
@@ -4,12 +4,11 @@
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include "sdkconfig.h"
|
||||
#include "esp_ieee802154.h"
|
||||
#include "esp_openthread_ncp.h"
|
||||
#include "ncp_base.hpp"
|
||||
|
||||
#if OPENTHREAD_ENABLE_NCP_VENDOR_HOOK
|
||||
|
||||
#if CONFIG_OPENTHREAD_RCP_UART
|
||||
#include "utils/uart.h"
|
||||
#endif
|
||||
@@ -107,5 +106,3 @@ otError NcpBase::VendorSetPropertyHandler(spinel_prop_key_t aPropKey)
|
||||
|
||||
} // namespace Ncp
|
||||
} // namespace ot
|
||||
|
||||
#endif // #if OPENTHREAD_ENABLE_NCP_VENDOR_HOOK
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -7,8 +7,6 @@
|
||||
#include "common/new.hpp"
|
||||
#include "ncp_hdlc.hpp"
|
||||
|
||||
#if OPENTHREAD_ENABLE_NCP_VENDOR_HOOK
|
||||
|
||||
namespace ot {
|
||||
namespace Ncp {
|
||||
|
||||
@@ -29,5 +27,3 @@ extern "C" void otNcpHdlcInit(otInstance *aInstance, otNcpHdlcSendCallback aSend
|
||||
|
||||
} // namespace Ncp
|
||||
} // namespace ot
|
||||
|
||||
#endif // #if OPENTHREAD_ENABLE_NCP_VENDOR_HOOK
|
||||
|
||||
29
components/openthread/src/ncp/esp_openthread_ncp_spi.cpp
Normal file
29
components/openthread/src/ncp/esp_openthread_ncp_spi.cpp
Normal file
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include "common/new.hpp"
|
||||
#include "ncp_spi.hpp"
|
||||
|
||||
namespace ot {
|
||||
namespace Ncp {
|
||||
|
||||
static OT_DEFINE_ALIGNED_VAR(sNcpRaw, sizeof(NcpSpi), uint64_t);
|
||||
|
||||
extern "C" void otNcpSpiInit(otInstance *aInstance)
|
||||
{
|
||||
NcpSpi *ncpSpi = nullptr;
|
||||
Instance *instance = static_cast<Instance *>(aInstance);
|
||||
|
||||
ncpSpi = new (&sNcpRaw) NcpSpi(instance);
|
||||
|
||||
if (ncpSpi == nullptr || ncpSpi != NcpBase::GetNcpInstance())
|
||||
{
|
||||
OT_ASSERT(false);
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace Ncp
|
||||
} // namespace ot
|
||||
Reference in New Issue
Block a user