mirror of
https://github.com/espressif/openthread.git
synced 2026-08-12 13:47:47 +00:00
[style] fix unused variable in release build (#5763)
assert() is not defined when NDEBUG is defined.
This commit is contained in:
@@ -125,6 +125,8 @@ void otPlatFlashErase(otInstance *aInstance, uint8_t aSwapIndex)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
OT_UNUSED_VARIABLE(error);
|
||||
}
|
||||
|
||||
void otPlatFlashWrite(otInstance *aInstance, uint8_t aSwapIndex, uint32_t aOffset, const void *aData, uint32_t aSize)
|
||||
@@ -135,6 +137,8 @@ void otPlatFlashWrite(otInstance *aInstance, uint8_t aSwapIndex, uint32_t aOffse
|
||||
|
||||
error = nrf5FlashWrite(mapAddress(aSwapIndex, aOffset), aData, aSize);
|
||||
assert(error == OT_ERROR_NONE);
|
||||
|
||||
OT_UNUSED_VARIABLE(error);
|
||||
}
|
||||
|
||||
void otPlatFlashRead(otInstance *aInstance, uint8_t aSwapIndex, uint32_t aOffset, void *aData, uint32_t aSize)
|
||||
|
||||
@@ -148,6 +148,10 @@ otError otPlatSpiSlaveEnable(otPlatSpiSlaveTransactionCompleteCallback aComplete
|
||||
|
||||
error = nrfx_spis_init(&sSpiSlaveInstance, &config, spisEventHandler, NULL);
|
||||
assert(error == NRFX_SUCCESS);
|
||||
if (error != NRFX_SUCCESS)
|
||||
{
|
||||
result = OT_ERROR_FAILED;
|
||||
}
|
||||
|
||||
// Set up Host IRQ pin.
|
||||
nrf_gpio_pin_set(SPIS_PIN_HOST_IRQ);
|
||||
|
||||
@@ -285,6 +285,8 @@ void nrf5UartInit(void)
|
||||
|
||||
ret = app_usbd_power_events_enable();
|
||||
assert(ret == NRF_SUCCESS);
|
||||
|
||||
OT_UNUSED_VARIABLE(ret);
|
||||
}
|
||||
|
||||
void nrf5UartDeinit(void)
|
||||
|
||||
@@ -284,18 +284,28 @@ main()
|
||||
{
|
||||
./bootstrap
|
||||
|
||||
build_cc1352
|
||||
build_cc2538
|
||||
build_cc2650
|
||||
build_cc2652
|
||||
build_jn5189
|
||||
build_k32w061
|
||||
build_kw41z
|
||||
build_nrf52811
|
||||
build_nrf52833
|
||||
build_nrf52840
|
||||
build_qpg6095
|
||||
build_samr21
|
||||
export CPPFLAGS="${CPPFLAGS:-} -DNDEBUG"
|
||||
|
||||
if [[ $# == 0 ]]; then
|
||||
build_cc1352
|
||||
build_cc2538
|
||||
build_cc2650
|
||||
build_cc2652
|
||||
build_jn5189
|
||||
build_k32w061
|
||||
build_kw41z
|
||||
build_nrf52811
|
||||
build_nrf52833
|
||||
build_nrf52840
|
||||
build_qpg6095
|
||||
build_samr21
|
||||
return 0
|
||||
fi
|
||||
|
||||
while [[ $# != 0 ]]; do
|
||||
"build_$1"
|
||||
shift
|
||||
done
|
||||
}
|
||||
|
||||
main "$@"
|
||||
|
||||
@@ -98,6 +98,8 @@ build_samr21()
|
||||
|
||||
main()
|
||||
{
|
||||
export CPPFLAGS="${CPPFLAGS:-} -DNDEBUG"
|
||||
|
||||
if [[ $# == 0 ]]; then
|
||||
build_cc1352
|
||||
build_cc2538
|
||||
|
||||
+3
@@ -84,6 +84,9 @@ override CXXFLAGS := $(filter-out -Wundef,$(CXXFLAGS))
|
||||
override CFLAGS := $(filter-out -Wcast-align,$(CFLAGS))
|
||||
override CXXFLAGS := $(filter-out -Wcast-align,$(CXXFLAGS))
|
||||
|
||||
CFLAGS += -Wno-unused-but-set-variable
|
||||
CXXFLAGS += -Wno-unused-but-set-variable
|
||||
|
||||
COMMONCPPFLAGS = \
|
||||
-DCONFIG_GPIO_AS_PINRESET \
|
||||
-DENABLE_FEM=1 \
|
||||
|
||||
Vendored
+1
@@ -704,6 +704,7 @@ bool nrf_802154_ack_data_pending_bit_should_be_set(const uint8_t * p_frame)
|
||||
|
||||
default:
|
||||
assert(false);
|
||||
ret = false;
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
||||
Reference in New Issue
Block a user