diff --git a/examples/platforms/nrf52840/diag.c b/examples/platforms/nrf52840/diag.c index 3d6cd9d97..09485f53a 100644 --- a/examples/platforms/nrf52840/diag.c +++ b/examples/platforms/nrf52840/diag.c @@ -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 diff --git a/examples/platforms/nrf52840/usb-cdc-uart.c b/examples/platforms/nrf52840/usb-cdc-uart.c index d1605bc97..df24253a5 100644 --- a/examples/platforms/nrf52840/usb-cdc-uart.c +++ b/examples/platforms/nrf52840/usb-cdc-uart.c @@ -32,8 +32,12 @@ * */ +#if defined(__GNUC__) + #pragma GCC diagnostic ignored "-Wpedantic" +#endif + #include #include diff --git a/include/openthread/platform/toolchain.h b/include/openthread/platform/toolchain.h index c2708d908..6b9e83f2f 100644 --- a/include/openthread/platform/toolchain.h +++ b/include/openthread/platform/toolchain.h @@ -233,6 +233,8 @@ extern "C" { #if defined(__ICCARM__) +#include + #define OT_UNUSED_VARIABLE(VARIABLE) \ do \ { \ diff --git a/src/core/meshcop/dataset_manager.cpp b/src/core/meshcop/dataset_manager.cpp index 5c015a91e..84ebeef6b 100644 --- a/src/core/meshcop/dataset_manager.cpp +++ b/src/core/meshcop/dataset_manager.cpp @@ -925,7 +925,7 @@ void DatasetManager::SendGetResponse(const Coap::Header &aRequestHeader, const I continue; } - if ((tlv = mNetwork.Get(static_cast(aTlvs[index]))) != NULL) + if ((tlv = mNetwork.Get(static_cast(aTlvs[index]))) != NULL) { SuccessOrExit(error = message->Append(tlv, sizeof(Tlv) + tlv->GetLength())); } diff --git a/src/ncp/spinel.c b/src/ncp/spinel.c index f746befd0..9803c3113 100644 --- a/src/ncp/spinel.c +++ b/src/ncp/spinel.c @@ -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 diff --git a/third_party/NordicSemiconductor/dependencies/sdk_config.h b/third_party/NordicSemiconductor/dependencies/sdk_config.h index b0017b8d1..064a75dc2 100644 --- a/third_party/NordicSemiconductor/dependencies/sdk_config.h +++ b/third_party/NordicSemiconductor/dependencies/sdk_config.h @@ -4,9 +4,13 @@ #include #undef PACKAGE +#if defined(__GNUC__) + #pragma GCC diagnostic ignored "-Wpedantic" #pragma GCC diagnostic ignored "-Wunused-parameter" +#endif + //========================================================== // APP_USBD_ENABLED - app_usbd - USB Device library //========================================================== diff --git a/third_party/NordicSemiconductor/drivers/radio/fem/nrf_fem_control_common.c b/third_party/NordicSemiconductor/drivers/radio/fem/nrf_fem_control_common.c index 40cc8f53d..6dcc154ae 100644 --- a/third_party/NordicSemiconductor/drivers/radio/fem/nrf_fem_control_common.c +++ b/third_party/NordicSemiconductor/drivers/radio/fem/nrf_fem_control_common.c @@ -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 - diff --git a/third_party/NordicSemiconductor/drivers/radio/fem/nrf_fem_control_direct.c b/third_party/NordicSemiconductor/drivers/radio/fem/nrf_fem_control_direct.c index 33086a319..77d3c1055 100644 --- a/third_party/NordicSemiconductor/drivers/radio/fem/nrf_fem_control_direct.c +++ b/third_party/NordicSemiconductor/drivers/radio/fem/nrf_fem_control_direct.c @@ -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) diff --git a/third_party/NordicSemiconductor/drivers/radio/fem/nrf_fem_control_softdevice.c b/third_party/NordicSemiconductor/drivers/radio/fem/nrf_fem_control_softdevice.c index 821be2fa1..b5ef092c4 100644 --- a/third_party/NordicSemiconductor/drivers/radio/fem/nrf_fem_control_softdevice.c +++ b/third_party/NordicSemiconductor/drivers/radio/fem/nrf_fem_control_softdevice.c @@ -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)