[build] detect undefined macros to avoid misconfigurations (#4300)

This commit is contained in:
Diego Ismirlian
2020-01-08 08:37:46 -08:00
committed by Jonathan Hui
parent 4fec70b67d
commit e44461151f
40 changed files with 218 additions and 40 deletions
+61 -13
View File
@@ -222,6 +222,11 @@ AC_PROG_LN_S
AC_PATH_PROG(CMP, cmp)
# Check for and initialize libtool
LT_INIT
AC_PROG_LIBTOOL
#
# Checks for specific compiler characteristics
#
@@ -232,8 +237,8 @@ AC_PATH_PROG(CMP, cmp)
# -Wall CC, CXX
#
PROSPECTIVE_CFLAGS="-Wall -Wextra -Wshadow -Werror -std=c99 -pedantic-errors -Wno-gnu-zero-variadic-macro-arguments"
PROSPECTIVE_CXXFLAGS="-Wall -Wextra -Wshadow -Werror -std=gnu++98 -Wno-c++14-compat -fno-exceptions"
PROSPECTIVE_CFLAGS="-Wall -Wextra -Wshadow -Wundef -Werror -Wno-error=undef -std=c99 -pedantic-errors"
PROSPECTIVE_CXXFLAGS="-Wall -Wextra -Wshadow -Wundef -Werror -Wno-error=undef -std=gnu++98 -Wno-c++14-compat -fno-exceptions"
AC_CACHE_CHECK([whether $CC is Clang],
[nl_cv_clang],
@@ -250,17 +255,60 @@ AC_CACHE_CHECK([whether $CC is Clang],
])
if test "${nl_cv_clang}" = "yes"; then
PROSPECTIVE_CFLAGS="${PROSPECTIVE_CFLAGS} -Wconversion"
PROSPECTIVE_CFLAGS="${PROSPECTIVE_CFLAGS} -Wconversion -Wno-gnu-zero-variadic-macro-arguments"
PROSPECTIVE_CXXFLAGS="${PROSPECTIVE_CXXFLAGS} -Wconversion"
fi
AX_CHECK_COMPILER_OPTIONS([C], ${PROSPECTIVE_CFLAGS})
AX_CHECK_COMPILER_OPTIONS([C++], ${PROSPECTIVE_CXXFLAGS})
function convert_warning_flags_to_positive() {
flags_to_check=""
warning_flag_backup=""
for option in ${1}; do
case "$option"
in
-Wno-*)
flags_to_check="${flags_to_check} -W${option##-Wno-}"
warning_flag_backup="${warning_flag_backup} ${option##-Wno-}";;
*)
flags_to_check="${flags_to_check} ${option}";;
esac
done
}
# Check for and initialize libtool
function restore_negative_form_of_warning_flags() {
final_flags=${1}
for positive_option in ${warning_flag_backup}; do
final_flags=$(echo $ECHO_N $final_flags | $SED "s|-W${positive_option}|-Wno-${positive_option}|g")
done
unset flags_to_check
unset warning_flag_backup
}
LT_INIT
AC_PROG_LIBTOOL
function check_prospective_CFLAGS() {
if test "${nl_cv_clang}" = "yes"; then
AX_CHECK_COMPILER_OPTIONS([C], ${PROSPECTIVE_CFLAGS})
else
convert_warning_flags_to_positive "${PROSPECTIVE_CFLAGS}"
AX_CHECK_COMPILER_OPTIONS([C], ${flags_to_check})
restore_negative_form_of_warning_flags "${CFLAGS}"
CFLAGS=${final_flags}
unset final_flags
fi
}
function check_prospective_CXXFLAGS() {
if test "${nl_cv_clang}" = "yes"; then
AX_CHECK_COMPILER_OPTIONS([C++], ${PROSPECTIVE_CXXFLAGS})
else
convert_warning_flags_to_positive "${PROSPECTIVE_CXXFLAGS}"
AX_CHECK_COMPILER_OPTIONS([C++], ${flags_to_check})
restore_negative_form_of_warning_flags "${CXXFLAGS}"
CXXFLAGS=${final_flags}
unset final_flags
fi
}
check_prospective_CFLAGS
check_prospective_CXXFLAGS
# Disable building shared libraries by default (can be enabled with --enable-shared)
@@ -322,7 +370,7 @@ AM_CONDITIONAL([OPENTHREAD_ENABLE_FUZZ_TARGETS], [test "${enable_fuzz_targets}"
if test "${enable_fuzz_targets}" = "no" ; then
PROSPECTIVE_CXXFLAGS="-fno-rtti"
AX_CHECK_COMPILER_OPTIONS([C++], ${PROSPECTIVE_CXXFLAGS})
check_prospective_CXXFLAGS
fi
# Address Sanitizer
@@ -351,11 +399,11 @@ AM_CONDITIONAL([OPENTHREAD_WITH_ADDRESS_SANITIZER], [test "${enable_address_sani
if test "${enable_address_sanitizer}" = "yes" ; then
PROSPECTIVE_CFLAGS="-fsanitize=address"
PROSPECTIVE_CXXFLAGS="-fsanitize=address"
# Check if the compilers support address sanitizer
AX_CHECK_COMPILER_OPTIONS([C], ${PROSPECTIVE_CFLAGS})
AX_CHECK_COMPILER_OPTIONS([C++], ${PROSPECTIVE_CFLAGS})
check_prospective_CFLAGS
check_prospective_CXXFLAGS
fi
#
@@ -816,7 +864,7 @@ AM_CONDITIONAL([OPENTHREAD_EXAMPLES_NRF52840], [test "${with_examples}" = "nrf5
AM_CONDITIONAL([OPENTHREAD_EXAMPLES_QPG6095], [test "${with_examples}" = "qpg6095"])
AM_CONDITIONAL([OPENTHREAD_EXAMPLES_SAMR21], [test "${with_examples}" = "samr21"])
AM_COND_IF([OPENTHREAD_EXAMPLES_POSIX], CPPFLAGS="${CPPFLAGS} -DOPENTHREAD_EXAMPLES_POSIX=1")
AM_COND_IF([OPENTHREAD_EXAMPLES_POSIX], CPPFLAGS="${CPPFLAGS} -DOPENTHREAD_EXAMPLES_POSIX=1", CPPFLAGS="${CPPFLAGS} -DOPENTHREAD_EXAMPLES_POSIX=0")
AC_MSG_CHECKING([whether to enable examples])
AC_MSG_RESULT(${with_examples})
+2
View File
@@ -225,6 +225,8 @@ endif
ifeq ($(SETTINGS_RAM),1)
COMMONCFLAGS += -DOPENTHREAD_SETTINGS_RAM=1
else
COMMONCFLAGS += -DOPENTHREAD_SETTINGS_RAM=0
endif
ifeq ($(FULL_LOGS),1)
+1
View File
@@ -32,6 +32,7 @@
*
*/
#include "openthread-core-config.h"
#include <openthread/config.h>
#include <assert.h>
+2
View File
@@ -26,6 +26,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include "openthread-core-config.h"
#include <driverlib/aon_rtc.h>
#include <stdbool.h>
#include <stdint.h>
+1
View File
@@ -26,6 +26,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include "openthread-core-config.h"
#include <openthread/config.h>
#include <stdbool.h>
+1
View File
@@ -26,6 +26,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include "openthread-core-config.h"
#include <openthread/config.h>
#include "cc2650_radio.h"
+1
View File
@@ -32,6 +32,7 @@
*
*/
#include "openthread-core-config.h"
#include <openthread/config.h>
#include <assert.h>
+4
View File
@@ -38,6 +38,10 @@ override CXXFLAGS := $(filter-out -Wconversion,$(CXXF
override CFLAGS := $(filter-out -pedantic-errors,$(CFLAGS))
override CXXFLAGS := $(filter-out -pedantic-errors,$(CXXFLAGS))
# Do not enable -Wundef for rail
override CFLAGS := $(filter-out -Wundef,$(CFLAGS))
override CXXFLAGS := $(filter-out -Wundef,$(CXXFLAGS))
EFR32_BOARD_DIR = $(shell echo $(BOARD) | tr A-Z a-z)
EFR32MG_SDK_SRCDIR = $(top_srcdir)/third_party/silabs/gecko_sdk_suite/v2.6
@@ -53,7 +53,7 @@
* Define to 1 if you want to enable physical layer to support OQPSK modulation in 915MHz band.
*
*/
#ifdef RADIO_CONFIG_915MHZ_OQPSK_SUPPORT
#if RADIO_CONFIG_915MHZ_OQPSK_SUPPORT
#define OPENTHREAD_CONFIG_RADIO_915MHZ_OQPSK_SUPPORT 1
#else
#define OPENTHREAD_CONFIG_RADIO_915MHZ_OQPSK_SUPPORT 0
@@ -65,7 +65,7 @@
* Define to 1 if you want to enable physical layer to support OQPSK modulation in 2.4GHz band.
*
*/
#ifdef RADIO_CONFIG_2P4GHZ_OQPSK_SUPPORT
#if RADIO_CONFIG_2P4GHZ_OQPSK_SUPPORT
#define OPENTHREAD_CONFIG_RADIO_2P4GHZ_OQPSK_SUPPORT 1
#else
#define OPENTHREAD_CONFIG_RADIO_2P4GHZ_OQPSK_SUPPORT 0
+4
View File
@@ -38,6 +38,10 @@ override CXXFLAGS := $(filter-out -Wconversion,$(CXXF
override CFLAGS := $(filter-out -pedantic-errors,$(CFLAGS))
override CXXFLAGS := $(filter-out -pedantic-errors,$(CXXFLAGS))
# Do not enable -Wundef for rail
override CFLAGS := $(filter-out -Wundef,$(CFLAGS))
override CXXFLAGS := $(filter-out -Wundef,$(CXXFLAGS))
EFR32_BOARD_DIR = $(shell echo $(BOARD) | tr A-Z a-z)
EFR32MG_SDK_SRCDIR = $(top_srcdir)/third_party/silabs/gecko_sdk_suite/v2.6
@@ -62,7 +62,7 @@
* Define to 1 if you want to enable physical layer to support OQPSK modulation in 2.4GHz band.
*
*/
#ifdef RADIO_CONFIG_2P4GHZ_OQPSK_SUPPORT
#if RADIO_CONFIG_2P4GHZ_OQPSK_SUPPORT
#define OPENTHREAD_CONFIG_RADIO_2P4GHZ_OQPSK_SUPPORT 1
#else
#define OPENTHREAD_CONFIG_RADIO_2P4GHZ_OQPSK_SUPPORT 0
+4
View File
@@ -30,6 +30,10 @@ include $(abs_top_nlbuild_autotools_dir)/automake/pre.am
lib_LIBRARIES = libopenthread-kw41z.a
# Do not enable -Wundef for this platform
override CFLAGS := $(filter-out -Wundef,$(CFLAGS))
override CXXFLAGS := $(filter-out -Wundef,$(CXXFLAGS))
libopenthread_kw41z_a_CPPFLAGS = \
-DCPU_MKW41Z512VHT4 \
-I$(top_srcdir)/include \
@@ -37,6 +37,10 @@ lib_LIBRARIES
override CFLAGS := $(filter-out -pedantic-errors,$(CFLAGS))
override CXXFLAGS := $(filter-out -pedantic-errors,$(CXXFLAGS))
# Do not enable -Wundef for nRF52811 driver library
override CFLAGS := $(filter-out -Wundef,$(CFLAGS))
override CXXFLAGS := $(filter-out -Wundef,$(CXXFLAGS))
COMMONCPPFLAGS = \
-DCONFIG_GPIO_AS_PINRESET \
-DNRF52811_XXAA \
@@ -38,6 +38,10 @@ lib_LIBRARIES
override CFLAGS := $(filter-out -pedantic-errors,$(CFLAGS))
override CXXFLAGS := $(filter-out -pedantic-errors,$(CXXFLAGS))
# Do not enable -Wundef for nRF52833 driver library
override CFLAGS := $(filter-out -Wundef,$(CFLAGS))
override CXXFLAGS := $(filter-out -Wundef,$(CXXFLAGS))
COMMONCPPFLAGS = \
-DCONFIG_GPIO_AS_PINRESET \
-DNRF52833_XXAA \
@@ -38,6 +38,10 @@ lib_LIBRARIES
override CFLAGS := $(filter-out -pedantic-errors,$(CFLAGS))
override CXXFLAGS := $(filter-out -pedantic-errors,$(CXXFLAGS))
# Do not enable -Wundef for nRF52840 driver library
override CFLAGS := $(filter-out -Wundef,$(CFLAGS))
override CXXFLAGS := $(filter-out -Wundef,$(CXXFLAGS))
COMMONCPPFLAGS = \
-DCONFIG_GPIO_AS_PINRESET \
-DNRF52840_XXAA \
+2
View File
@@ -26,6 +26,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include "openthread-core-config.h"
#include "platform_qorvo.h"
#include <ctype.h>
-1
View File
@@ -35,7 +35,6 @@
#include <openthread-core-config.h>
#include <stdbool.h>
#include "common/settings.hpp"
#include "openthread/platform/settings.h"
#include <utils/code_utils.h>
+4
View File
@@ -33,6 +33,10 @@ lib_LIBRARIES = libopenthread-samr21.a
override CFLAGS := $(filter-out -pedantic-errors,$(CFLAGS))
override CXXFLAGS := $(filter-out -pedantic-errors,$(CXXFLAGS))
# Do not enable -Wundef for this platform
override CFLAGS := $(filter-out -Wundef,$(CFLAGS))
override CXXFLAGS := $(filter-out -Wundef,$(CXXFLAGS))
libopenthread_samr21_a_CPPFLAGS = \
-D ARM_MATH_CM0PLUS=true \
-D PHY_AT86RF233 \
+2 -2
View File
@@ -56,7 +56,7 @@
* intended to be present, or used in production system.
*/
#if __cplusplus
#ifdef __cplusplus
extern "C" {
#endif
@@ -188,7 +188,7 @@ otError otPlatDebugUart_logfile(const char *filename);
*
*/
#if __cplusplus
#ifdef __cplusplus
} // extern "C"
#endif
+8
View File
@@ -129,15 +129,23 @@ if OPENTHREAD_POSIX
CPPFLAGS_COMMON += \
-DOPENTHREAD_POSIX=1 \
$(NULL)
else
CPPFLAGS_COMMON += \
-DOPENTHREAD_POSIX=0 \
$(NULL)
endif
libopenthread_cli_mtd_a_CPPFLAGS = \
-DOPENTHREAD_MTD=1 \
-DOPENTHREAD_FTD=0 \
-DOPENTHREAD_RADIO=0 \
$(CPPFLAGS_COMMON) \
$(NULL)
libopenthread_cli_ftd_a_CPPFLAGS = \
-DOPENTHREAD_MTD=0 \
-DOPENTHREAD_FTD=1 \
-DOPENTHREAD_RADIO=0 \
$(CPPFLAGS_COMMON) \
$(NULL)
+1 -1
View File
@@ -3561,7 +3561,7 @@ otError Interpreter::ProcessMacRetries(int argc, char *argv[])
otLinkSetMaxFrameRetriesDirect(mInstance, static_cast<uint8_t>(value));
}
}
#ifdef OPENTHREAD_FTD
#if OPENTHREAD_FTD
else if (strcmp(argv[0], "indirect") == 0)
{
if (argc == 1)
+4
View File
@@ -41,6 +41,10 @@
#include "coap/coap_message.hpp"
#include "coap/coap_secure.hpp"
#ifndef CLI_COAP_SECURE_USE_COAP_DEFAULT_HANDLER
#define CLI_COAP_SECURE_USE_COAP_DEFAULT_HANDLER 0
#endif
namespace ot {
namespace Cli {
+10
View File
@@ -65,4 +65,14 @@
#define OPENTHREAD_CONFIG_CLI_UART_TX_BUFFER_SIZE 1024
#endif
/**
* @def OPENTHREAD_CONFIG_UART_CLI_RAW
*
* TODO: complete.
*
*/
#ifndef OPENTHREAD_CONFIG_UART_CLI_RAW
#define OPENTHREAD_CONFIG_UART_CLI_RAW 0
#endif
#endif // CONFIG_CLI_H_
+6
View File
@@ -49,17 +49,23 @@ CPPFLAGS_COMMON = \
libopenthread_radio_a_CPPFLAGS = \
$(CPPFLAGS_COMMON) \
-DOPENTHREAD_MTD=0 \
-DOPENTHREAD_FTD=0 \
-DOPENTHREAD_RADIO=1 \
$(NULL)
libopenthread_ftd_a_CPPFLAGS = \
$(CPPFLAGS_COMMON) \
-DOPENTHREAD_MTD=0 \
-DOPENTHREAD_FTD=1 \
-DOPENTHREAD_RADIO=0 \
$(NULL)
libopenthread_mtd_a_CPPFLAGS = \
$(CPPFLAGS_COMMON) \
-DOPENTHREAD_MTD=1 \
-DOPENTHREAD_FTD=0 \
-DOPENTHREAD_RADIO=0 \
$(NULL)
#------------------------------------------------------
+4
View File
@@ -36,6 +36,10 @@
#include "openthread-core-config.h"
#ifndef BYTE_ORDER_BIG_ENDIAN
#define BYTE_ORDER_BIG_ENDIAN 0
#endif
#include <limits.h>
#include <stdint.h>
+6 -6
View File
@@ -35,7 +35,7 @@
#include <openthread/platform/entropy.h>
#ifndef OPENTHREAD_RADIO
#if !OPENTHREAD_RADIO
#include <mbedtls/entropy_poll.h>
#endif
@@ -49,7 +49,7 @@ namespace ot {
uint16_t RandomManager::sInitCount = 0;
RandomManager::NonCryptoPrng RandomManager::sPrng;
#ifndef OPENTHREAD_RADIO
#if !OPENTHREAD_RADIO
RandomManager::Entropy RandomManager::sEntropy;
RandomManager::CryptoCtrDrbg RandomManager::sCtrDrbg;
#endif
@@ -63,7 +63,7 @@ RandomManager::RandomManager(void)
VerifyOrExit(sInitCount == 0);
#ifndef OPENTHREAD_RADIO
#if !OPENTHREAD_RADIO
sEntropy.Init();
sCtrDrbg.Init();
@@ -87,7 +87,7 @@ RandomManager::~RandomManager(void)
sInitCount--;
VerifyOrExit(sInitCount == 0);
#ifndef OPENTHREAD_RADIO
#if !OPENTHREAD_RADIO
sCtrDrbg.Deinit();
sEntropy.Deinit();
#endif
@@ -141,7 +141,7 @@ uint32_t RandomManager::NonCryptoPrng::GetNext(void)
return mlcg;
}
#ifndef OPENTHREAD_RADIO
#if !OPENTHREAD_RADIO
//-------------------------------------------------------------------
// Entropy
@@ -203,6 +203,6 @@ otError RandomManager::CryptoCtrDrbg::FillBuffer(uint8_t *aBuffer, uint16_t aSiz
mbedtls_ctr_drbg_random(&mCtrDrbg, static_cast<unsigned char *>(aBuffer), static_cast<size_t>(aSize)));
}
#endif // #ifndef OPENTHREAD_RADIO
#endif // #if !OPENTHREAD_RADIO
} // namespace ot
+4 -4
View File
@@ -39,7 +39,7 @@
#include <stdint.h>
#include <openthread/error.h>
#ifndef OPENTHREAD_RADIO
#if !OPENTHREAD_RADIO
#include <mbedtls/ctr_drbg.h>
#include <mbedtls/entropy.h>
#endif
@@ -78,7 +78,7 @@ public:
*/
static uint32_t NonCryptoGetUint32(void);
#ifndef OPENTHREAD_RADIO
#if !OPENTHREAD_RADIO
/**
* This static method returns the initialized mbedtls_entropy_context.
*
@@ -117,7 +117,7 @@ private:
uint32_t mState;
};
#ifndef OPENTHREAD_RADIO
#if !OPENTHREAD_RADIO
class Entropy
{
public:
@@ -150,7 +150,7 @@ private:
static uint16_t sInitCount;
static NonCryptoPrng sPrng;
#ifndef OPENTHREAD_RADIO
#if !OPENTHREAD_RADIO
static Entropy sEntropy;
static CryptoCtrDrbg sCtrDrbg;
#endif
+3 -1
View File
@@ -35,6 +35,8 @@
#ifndef CONFIG_MAC_H_
#define CONFIG_MAC_H_
#include "config/time_sync.h"
/**
* @def OPENTHREAD_CONFIG_MAC_MAX_CSMA_BACKOFFS_DIRECT
*
@@ -198,7 +200,7 @@
*
*/
#ifndef OPENTHREAD_CONFIG_MAC_JOIN_BEACON_VERSION
#define OPENTHREAD_CONFIG_MAC_JOIN_BEACON_VERSION kProtocolVersion
#define OPENTHREAD_CONFIG_MAC_JOIN_BEACON_VERSION OPENTHREAD_THREAD_VERSION
#endif
/**
@@ -6,7 +6,7 @@
* 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
* 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
@@ -35,6 +35,8 @@
#ifndef OPENTHREAD_CORE_DEFAULT_CONFIG_H_
#define OPENTHREAD_CORE_DEFAULT_CONFIG_H_
#include "config/coap.h"
/**
* @def OPENTHREAD_CONFIG_STACK_VENDOR_OUI
*
@@ -264,6 +266,16 @@
#define OPENTHREAD_CONFIG_HEAP_INTERNAL_SIZE_NO_DTLS 384
#endif
/**
* @def OPENTHREAD_CONFIG_HEAP_EXTERNAL_ENABLE
*
* Enable the external heap.
*
*/
#ifndef OPENTHREAD_CONFIG_HEAP_EXTERNAL_ENABLE
#define OPENTHREAD_CONFIG_HEAP_EXTERNAL_ENABLE 0
#endif
/**
* @def OPENTHREAD_CONFIG_DTLS_APPLICATION_DATA_MAX_LENGTH
*
+1 -1
View File
@@ -1287,7 +1287,7 @@ public:
{
mFlags |= kJoiningFlag;
#if OPENTHREAD_CONFIG_MAC_JOIN_BEACON_VERSION != kProtocolVersion
#if OPENTHREAD_CONFIG_MAC_JOIN_BEACON_VERSION != 2 // check against kProtocolVersion
mFlags &= ~kVersionMask;
mFlags |= OPENTHREAD_CONFIG_MAC_JOIN_BEACON_VERSION << kVersionOffset;
#endif
+2
View File
@@ -73,6 +73,8 @@
#if OPENTHREAD_CONFIG_COAP_SECURE_API_ENABLE || OPENTHREAD_CONFIG_BORDER_AGENT_ENABLE || \
OPENTHREAD_CONFIG_COMMISSIONER_ENABLE || OPENTHREAD_CONFIG_JOINER_ENABLE
#define OPENTHREAD_CONFIG_DTLS_ENABLE 1
#else
#define OPENTHREAD_CONFIG_DTLS_ENABLE 0
#endif
#undef OPENTHREAD_CORE_CONFIG_H_IN
+1 -1
View File
@@ -972,7 +972,7 @@ void Mle::SetRloc16(uint16_t aRloc16)
// mesh-local 16
mMeshLocal16.GetAddress().mFields.m16[7] = HostSwap16(aRloc16);
Get<ThreadNetif>().AddUnicastAddress(mMeshLocal16);
#ifdef OPENTHREAD_FTD
#if OPENTHREAD_FTD
Get<AddressResolver>().RestartAddressQueries();
#endif
}
+6
View File
@@ -59,17 +59,23 @@ COMMON_CPPFLAGS = \
$(NULL)
libopenthread_ncp_mtd_a_CPPFLAGS = \
-DOPENTHREAD_RADIO=0 \
-DOPENTHREAD_FTD=0 \
-DOPENTHREAD_MTD=1 \
$(COMMON_CPPFLAGS) \
$(NULL)
libopenthread_ncp_ftd_a_CPPFLAGS = \
-DOPENTHREAD_RADIO=0 \
-DOPENTHREAD_FTD=1 \
-DOPENTHREAD_MTD=0 \
$(COMMON_CPPFLAGS) \
$(NULL)
libopenthread_rcp_a_CPPFLAGS = \
-DOPENTHREAD_RADIO=1 \
-DOPENTHREAD_FTD=0 \
-DOPENTHREAD_MTD=0 \
$(COMMON_CPPFLAGS) \
$(NULL)
+10
View File
@@ -175,4 +175,14 @@
#define OPENTHREAD_CONFIG_NCP_ENABLE_MCU_POWER_STATE_CONTROL 0
#endif
/**
* @def OPENTHREAD_ENABLE_NCP_VENDOR_HOOK
*
* TODO: complete.
*
*/
#ifndef OPENTHREAD_ENABLE_NCP_VENDOR_HOOK
#define OPENTHREAD_ENABLE_NCP_VENDOR_HOOK 0
#endif
#endif // CONFIG_NCP_H_
+6 -6
View File
@@ -38,9 +38,9 @@
#include "ncp/hdlc.hpp"
#include "ncp/ncp_base.hpp"
#if OPENTHREAD_CONFIG_NCP_SPI_ENABLENEL_ENCRYPTER
#if OPENTHREAD_ENABLE_NCP_SPINEL_ENCRYPTER
#include "spinel_encrypter.hpp"
#endif // OPENTHREAD_CONFIG_NCP_SPI_ENABLENEL_ENCRYPTER
#endif // OPENTHREAD_ENABLE_NCP_SPINEL_ENCRYPTER
namespace ot {
namespace Ncp {
@@ -85,7 +85,7 @@ private:
kFinalizingFrame, // Finalizing a frame.
};
#if OPENTHREAD_CONFIG_NCP_SPI_ENABLENEL_ENCRYPTER
#if OPENTHREAD_ENABLE_NCP_SPINEL_ENCRYPTER
/**
* Wraps NcpFrameBuffer allowing to read data through spinel encrypter.
* Creates additional buffers to allow transforming of the whole spinel frames.
@@ -112,7 +112,7 @@ private:
size_t mDataBufferReadIndex;
size_t mOutputDataLength;
};
#endif // OPENTHREAD_CONFIG_NCP_SPI_ENABLENEL_ENCRYPTER
#endif // OPENTHREAD_ENABLE_NCP_SPINEL_ENCRYPTER
void EncodeAndSendToUart(void);
void HandleFrame(otError aError);
@@ -136,9 +136,9 @@ private:
bool mUartSendImmediate;
Tasklet mUartSendTask;
#if OPENTHREAD_CONFIG_NCP_SPI_ENABLENEL_ENCRYPTER
#if OPENTHREAD_ENABLE_NCP_SPINEL_ENCRYPTER
NcpFrameBufferEncrypterReader mTxFrameBufferEncrypterReader;
#endif // OPENTHREAD_CONFIG_NCP_SPI_ENABLENEL_ENCRYPTER
#endif // OPENTHREAD_ENABLE_NCP_SPINEL_ENCRYPTER
};
} // namespace Ncp
+16
View File
@@ -84,6 +84,22 @@
#define ENOMEM 1
#endif
#ifndef SPINEL_PLATFORM_SHOULD_LOG_ASSERTS
#define SPINEL_PLATFORM_SHOULD_LOG_ASSERTS 0
#endif
#ifndef SPINEL_PLATFORM_DOESNT_IMPLEMENT_ERRNO_VAR
#define SPINEL_PLATFORM_DOESNT_IMPLEMENT_ERRNO_VAR 0
#endif
#ifndef SPINEL_PLATFORM_DOESNT_IMPLEMENT_FPRINTF
#define SPINEL_PLATFORM_DOESNT_IMPLEMENT_FPRINTF 0
#endif
#ifndef SPINEL_SELF_TEST
#define SPINEL_SELF_TEST 0
#endif
#if defined(errno) && SPINEL_PLATFORM_DOESNT_IMPLEMENT_ERRNO_VAR
#error "SPINEL_PLATFORM_DOESNT_IMPLEMENT_ERRNO_VAR is set but errno is already defined."
#endif
+4
View File
@@ -55,6 +55,10 @@ endif
override CFLAGS := $(filter-out -pedantic-errors,$(CFLAGS))
override CXXFLAGS := $(filter-out -pedantic-errors,$(CXXFLAGS))
# Do not enable -Wundef for Nordic Semiconductor driver library
override CFLAGS := $(filter-out -Wundef,$(CFLAGS))
override CXXFLAGS := $(filter-out -Wundef,$(CXXFLAGS))
COMMONCPPFLAGS = \
-DCONFIG_GPIO_AS_PINRESET \
-DENABLE_FEM=1 \
+4
View File
@@ -28,6 +28,10 @@
include $(abs_top_nlbuild_autotools_dir)/automake/pre.am
# Do not enable -Wundef for jlink library
override CFLAGS := $(filter-out -Wundef,$(CFLAGS))
override CXXFLAGS := $(filter-out -Wundef,$(CXXFLAGS))
lib_LIBRARIES = libjlinkrtt.a
libjlinkrtt_a_CPPFLAGS = \
+1
View File
@@ -0,0 +1 @@
gecko_sdk_suite
+4
View File
@@ -52,6 +52,10 @@ override CXXFLAGS := $(filter-out -pedantic-errors,$(
override CFLAGS := $(filter-out -Wshadow,$(CFLAGS))
override CXXFLAGS := $(filter-out -Wshadow,$(CXXFLAGS))
# Do not enable -Wundef for Silicon Labs SDK sources
override CFLAGS := $(filter-out -Wundef,$(CFLAGS))
override CXXFLAGS := $(filter-out -Wundef,$(CXXFLAGS))
EFR32_BOARD_DIR = $(shell echo $(BOARD) | tr A-Z a-z)
EFR32MG_SDK_SRCDIR = $(top_srcdir)/third_party/silabs/gecko_sdk_suite/v2.6