Skip to content

Commit

Permalink
[lib] fix lib config build issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Irving-cl committed Jul 24, 2024
1 parent 82daeb8 commit 079689a
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 11 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ if (OT_BUILD_RT)
set(CONFIG_FILE "\"openthread-core-rt1060-config.h\"")
set(CORE_CONFIG_FILE "\"openthread-core-rt1060-config.h\"")
set(CORE_CONFIG_CHECK "\"openthread-core-rt1060-config-check.h\"")
set(OT_LIB_CONFIG "\"openthread-lib-rt1060-config.h\"")
set(PLATFORM rt1060)
set(CHIP imx_rt)
endif()
Expand Down
2 changes: 1 addition & 1 deletion openthread
Submodule openthread updated 120 files
13 changes: 12 additions & 1 deletion src/imx_rt/platform/radio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -367,12 +367,23 @@ otRadioState otPlatRadioGetState(otInstance *aInstance)

void otPlatRadioInit(void)
{
#if OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_2 && OPENTHREAD_CONFIG_MAC_CSL_TRANSMITTER_ENABLE
bool enableRcpTimeSync = true;
#else
bool enableRcpTimeSync = false;
#endif
const otRadioCaps kRequiredRadioCaps =
#if OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_2
OT_RADIO_CAPS_TRANSMIT_SEC | OT_RADIO_CAPS_TRANSMIT_TIMING |
#endif
OT_RADIO_CAPS_ACK_TIMEOUT | OT_RADIO_CAPS_TRANSMIT_RETRIES | OT_RADIO_CAPS_CSMA_BACKOFF;
spinel_iid_t iidList[ot::Spinel::kSpinelHeaderMaxNumIid];
iidList[0] = 0;

OT_UNUSED_VARIABLE(
sSpinelDriver.Init(sSpinelInterface, true /* aSoftwareReset */, iidList, OT_ARRAY_LENGTH(iidList)));
sRadioSpinel.Init(false /* aSkipRcpCompatibilityCheck */, true /* aSoftwareReset */, &sSpinelDriver);
sRadioSpinel.Init(false /* aSkipRcpCompatibilityCheck */, true /* aSoftwareReset */, &sSpinelDriver,
enableRcpTimeSync, kRequiredRadioCaps);
}

void otPlatRadioDeinit(void)
Expand Down
9 changes: 0 additions & 9 deletions src/imx_rt/rt1060/openthread-core-rt1060-config.h
Original file line number Diff line number Diff line change
Expand Up @@ -235,15 +235,6 @@ LOG_MODULE_DEFINE(ot_stack_log, kLOG_LevelDebug)
*/
#define OPENTHREAD_CONFIG_TMF_NETDATA_SERVICE_ENABLE 1

/**
* @def OPENTHREAD_CONFIG_PLATFORM_RADIO_SPINEL_RX_FRAME_BUFFER_SIZE
*
* Specifies the rx frame buffer size used by `SpinelInterface` in RCP host (posix) code. This is applicable/used when
* `RadioSpinel` platform is used.
*
*/
#define OPENTHREAD_LIB_SPINEL_RX_FRAME_BUFFER_SIZE 512

/**
* @def OPENTHREAD_CONFIG_PING_SENDER_ENABLE
*
Expand Down
47 changes: 47 additions & 0 deletions src/imx_rt/rt1060/openthread-lib-rt1060-config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/*
* Copyright (c) 2024, The OpenThread Authors.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the copyright holder nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/

/**
* @file
* This file includes RT 1060 compile-time configuration constants
* for OpenThread lib.
*/

#ifndef OT_RT_OPENTHREAD_LIB_RT_CONFIG_H_
#define OT_RT_OPENTHREAD_LIB_RT_CONFIG_H_

/**
* @def OPENTHREAD_LIB_SPINEL_RX_FRAME_BUFFER_SIZE
*
* Specifies the rx frame buffer size used by `SpinelInterface` in RCP host (posix) code. This is applicable/used when
* `RadioSpinel` platform is used.
*
*/
#define OPENTHREAD_LIB_SPINEL_RX_FRAME_BUFFER_SIZE 512

#endif // OT_RT_OPENTHREAD_LIB_RT_CONFIG_H_

0 comments on commit 079689a

Please sign in to comment.