mirror of
https://github.com/espressif/openthread.git
synced 2026-08-23 18:59:51 +00:00
[iar] warning fixes (#2241)
This commit is contained in:
committed by
Jonathan Hui
parent
27081335f0
commit
6933a1c680
@@ -320,11 +320,12 @@ static void processTemp(otInstance *aInstance, int argc, char *argv[], char *aOu
|
||||
OT_UNUSED_VARIABLE(argv);
|
||||
|
||||
otError error = OT_ERROR_NONE;
|
||||
int32_t temperature;
|
||||
|
||||
otEXPECT_ACTION(otPlatDiagModeGet(), error = OT_ERROR_INVALID_STATE);
|
||||
otEXPECT_ACTION(argc == 0, error = OT_ERROR_INVALID_ARGS);
|
||||
|
||||
int32_t temperature = nrf5TempGet();
|
||||
temperature = nrf5TempGet();
|
||||
|
||||
// Measurement resolution is 0.25 degrees Celsius
|
||||
// Convert the temperature measurement to a decimal value, in degrees Celsius
|
||||
|
||||
@@ -32,8 +32,12 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#if defined(__GNUC__)
|
||||
|
||||
#pragma GCC diagnostic ignored "-Wpedantic"
|
||||
|
||||
#endif
|
||||
|
||||
#include <openthread/config.h>
|
||||
#include <openthread-core-config.h>
|
||||
|
||||
|
||||
@@ -233,6 +233,8 @@ extern "C" {
|
||||
|
||||
#if defined(__ICCARM__)
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#define OT_UNUSED_VARIABLE(VARIABLE) \
|
||||
do \
|
||||
{ \
|
||||
|
||||
@@ -925,7 +925,7 @@ void DatasetManager::SendGetResponse(const Coap::Header &aRequestHeader, const I
|
||||
continue;
|
||||
}
|
||||
|
||||
if ((tlv = mNetwork.Get(static_cast<const Tlv::Type>(aTlvs[index]))) != NULL)
|
||||
if ((tlv = mNetwork.Get(static_cast<Tlv::Type>(aTlvs[index]))) != NULL)
|
||||
{
|
||||
SuccessOrExit(error = message->Append(tlv, sizeof(Tlv) + tlv->GetLength()));
|
||||
}
|
||||
|
||||
@@ -75,6 +75,14 @@
|
||||
#define EINVAL 1
|
||||
#endif
|
||||
|
||||
// IAR's errno.h apparently doesn't define ENOMEM.
|
||||
#ifndef ENOMEM
|
||||
// There is no real good choice for what to set
|
||||
// errno to in this case, so we just pick the
|
||||
// value '1' somewhat arbitrarily.
|
||||
#define ENOMEM 1
|
||||
#endif
|
||||
|
||||
#ifdef _KERNEL_MODE
|
||||
#define va_copy(destination, source) ((destination) = (source))
|
||||
#undef errno
|
||||
|
||||
@@ -4,9 +4,13 @@
|
||||
#include <openthread/config.h>
|
||||
#undef PACKAGE
|
||||
|
||||
#if defined(__GNUC__)
|
||||
|
||||
#pragma GCC diagnostic ignored "-Wpedantic"
|
||||
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||
|
||||
#endif
|
||||
|
||||
//==========================================================
|
||||
// <e> APP_USBD_ENABLED - app_usbd - USB Device library
|
||||
//==========================================================
|
||||
|
||||
@@ -88,20 +88,20 @@ __STATIC_INLINE void gpiote_configure(uint8_t pin, nrf_gpiote_outinit_t init_val
|
||||
/** Initialize PPI according to configuration provided. */
|
||||
static void ppi_init(void)
|
||||
{
|
||||
nrf_ppi_channel_include_in_group(m_nrf_fem_control_cfg.ppi_ch_id_set,
|
||||
m_nrf_fem_control_cfg.timer_ppi_grp);
|
||||
nrf_ppi_channel_include_in_group(m_nrf_fem_control_cfg.ppi_ch_id_clr,
|
||||
m_nrf_fem_control_cfg.radio_ppi_grp);
|
||||
nrf_ppi_channel_include_in_group((nrf_ppi_channel_t)m_nrf_fem_control_cfg.ppi_ch_id_set,
|
||||
(nrf_ppi_channel_group_t)m_nrf_fem_control_cfg.timer_ppi_grp);
|
||||
nrf_ppi_channel_include_in_group((nrf_ppi_channel_t)m_nrf_fem_control_cfg.ppi_ch_id_clr,
|
||||
(nrf_ppi_channel_group_t)m_nrf_fem_control_cfg.radio_ppi_grp);
|
||||
|
||||
nrf_ppi_channel_and_fork_endpoint_setup(
|
||||
m_nrf_fem_control_cfg.ppi_ch_id_set,
|
||||
(nrf_ppi_channel_t)m_nrf_fem_control_cfg.ppi_ch_id_set,
|
||||
(uint32_t)(&NRF_TIMER0->EVENTS_COMPARE[TIMER_CC_FEM]),
|
||||
(uint32_t)(&NRF_GPIOTE->TASKS_OUT[m_nrf_fem_control_cfg.gpiote_ch_id]),
|
||||
(uint32_t)(&NRF_PPI->TASKS_CHG[m_nrf_fem_control_cfg.timer_ppi_grp].DIS));
|
||||
|
||||
// Workaround for FTPAN-114, disable PPI to prevent second radio DISABLED event trigger.
|
||||
nrf_ppi_channel_and_fork_endpoint_setup(
|
||||
m_nrf_fem_control_cfg.ppi_ch_id_clr,
|
||||
(nrf_ppi_channel_t)m_nrf_fem_control_cfg.ppi_ch_id_clr,
|
||||
(uint32_t)(&NRF_RADIO->EVENTS_DISABLED),
|
||||
(uint32_t)(&NRF_GPIOTE->TASKS_OUT[m_nrf_fem_control_cfg.gpiote_ch_id]),
|
||||
(uint32_t)(&NRF_PPI->TASKS_CHG[m_nrf_fem_control_cfg.radio_ppi_grp].DIS));
|
||||
@@ -179,7 +179,7 @@ void nrf_fem_control_pa_set(bool shorts_used)
|
||||
if (m_nrf_fem_control_cfg.pa_cfg.enable)
|
||||
{
|
||||
gpiote_configure(m_nrf_fem_control_cfg.pa_cfg.gpio_pin,
|
||||
!m_nrf_fem_control_cfg.pa_cfg.active_high);
|
||||
(nrf_gpiote_outinit_t)!m_nrf_fem_control_cfg.pa_cfg.active_high);
|
||||
ppi_enable();
|
||||
|
||||
uint32_t tifs = nrf_radio_ifs_get();
|
||||
@@ -204,7 +204,7 @@ void nrf_fem_control_lna_set(bool shorts_used)
|
||||
if (m_nrf_fem_control_cfg.lna_cfg.enable)
|
||||
{
|
||||
gpiote_configure(m_nrf_fem_control_cfg.lna_cfg.gpio_pin,
|
||||
!m_nrf_fem_control_cfg.lna_cfg.active_high);
|
||||
(nrf_gpiote_outinit_t)!m_nrf_fem_control_cfg.lna_cfg.active_high);
|
||||
ppi_enable();
|
||||
|
||||
target_time = m_time_latch + NRF_FEM_RADIO_RX_STARTUP_LATENCY_US -
|
||||
|
||||
@@ -60,7 +60,7 @@ void nrf_fem_control_timer_stop(void)
|
||||
|
||||
void nrf_fem_control_timer_set(uint32_t target)
|
||||
{
|
||||
nrf_timer_cc_write(NRF_TIMER0, TIMER_CC_FEM, target);
|
||||
nrf_timer_cc_write(NRF_TIMER0, (nrf_timer_cc_channel_t)TIMER_CC_FEM, target);
|
||||
}
|
||||
|
||||
uint32_t nrf_fem_control_timer_time_get(void)
|
||||
|
||||
+1
-1
@@ -53,7 +53,7 @@ void nrf_fem_control_timer_stop(void)
|
||||
|
||||
void nrf_fem_control_timer_set(uint32_t target)
|
||||
{
|
||||
nrf_timer_cc_write(NRF_TIMER0, TIMER_CC_FEM, target);
|
||||
nrf_timer_cc_write(NRF_TIMER0, (nrf_timer_cc_channel_t)TIMER_CC_FEM, target);
|
||||
}
|
||||
|
||||
uint32_t nrf_fem_control_timer_time_get(void)
|
||||
|
||||
Reference in New Issue
Block a user