Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions modules/openthread/platform/radio_spinel.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*

Check warning on line 1 in modules/openthread/platform/radio_spinel.cpp

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

License missing

modules/openthread/platform/radio_spinel.cpp:1 File has no SPDX-License-Identifier header, consider adding one.
* Copyright (c) 2021, The OpenThread Authors.
* Copyright (c) 2022-2024, NXP.
* Copyright (c) 2022-2025, NXP.
*
* All rights reserved.
*
Expand Down Expand Up @@ -46,6 +46,8 @@
#include <zephyr/kernel.h>
#include <zephyr/net/net_pkt.h>
#include <openthread-system.h>
#include <stdalign.h>
#include <common/new.hpp>

enum pending_events {
PENDING_EVENT_FRAME_TO_SEND, /* There is a tx frame to send */
Expand All @@ -60,6 +62,11 @@
static ot::Hdlc::HdlcInterface *pSpinelInterface;
static ot::Spinel::SpinelDriver *psSpinelDriver;

alignas(ot::Spinel::RadioSpinel) static uint8_t gRadioBuf[sizeof(ot::Spinel::RadioSpinel)];
alignas(ot::Url::Url) static uint8_t gUrlBuf[sizeof(ot::Url::Url)];
alignas(ot::Hdlc::HdlcInterface) static uint8_t gIfaceBuf[sizeof(ot::Hdlc::HdlcInterface)];
alignas(ot::Spinel::SpinelDriver) static uint8_t gDriverBuf[sizeof(ot::Spinel::SpinelDriver)];

static const otRadioCaps sRequiredRadioCaps =
#if OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_2
OT_RADIO_CAPS_TRANSMIT_SEC | OT_RADIO_CAPS_TRANSMIT_TIMING |
Expand Down Expand Up @@ -527,11 +534,11 @@

iidList[0] = 0;

psRadioSpinel = new ot::Spinel::RadioSpinel();
psSpinelDriver = new ot::Spinel::SpinelDriver();
psRadioSpinel = new(gRadioBuf) ot::Spinel::RadioSpinel();
psSpinelDriver = new(gDriverBuf) ot::Spinel::SpinelDriver();

psRadioUrl = new ot::Url::Url();
pSpinelInterface = new ot::Hdlc::HdlcInterface(*psRadioUrl);
psRadioUrl = new(gUrlBuf) ot::Url::Url();
pSpinelInterface = new(gIfaceBuf) ot::Hdlc::HdlcInterface(*psRadioUrl);

OT_UNUSED_VARIABLE(psSpinelDriver->Init(*pSpinelInterface, true /* aSoftwareReset */,
iidList, OT_ARRAY_LENGTH(iidList)));
Expand Down
Loading