From 64e176b7cd2d11b331f9bfc234021266aa961ed8 Mon Sep 17 00:00:00 2001 From: hathach Date: Fri, 7 Jun 2019 15:27:57 +0700 Subject: [PATCH] more warnings clean up --- .../nRF5/freertos/portable/CMSIS/nrf52/port_cmsis_systick.c | 4 ++-- cores/nRF5/utility/debug.cpp | 4 +--- cores/nRF5/utility/utilities.c | 4 ++-- libraries/Bluefruit52Lib/src/bluefruit.cpp | 6 ++++-- libraries/Bluefruit52Lib/src/utility/bonding.cpp | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/cores/nRF5/freertos/portable/CMSIS/nrf52/port_cmsis_systick.c b/cores/nRF5/freertos/portable/CMSIS/nrf52/port_cmsis_systick.c index da9f1591..828457ba 100644 --- a/cores/nRF5/freertos/portable/CMSIS/nrf52/port_cmsis_systick.c +++ b/cores/nRF5/freertos/portable/CMSIS/nrf52/port_cmsis_systick.c @@ -144,7 +144,7 @@ void vPortSuppressTicksAndSleep( TickType_t xExpectedIdleTime ) do{ uint8_t dummy = 0; uint32_t err_code = sd_nvic_critical_region_enter(&dummy); - //APP_ERROR_CHECK(err_code); + (void) err_code; //APP_ERROR_CHECK(err_code); }while (0); #else __disable_irq(); @@ -229,7 +229,7 @@ void vPortSuppressTicksAndSleep( TickType_t xExpectedIdleTime ) } #ifdef SOFTDEVICE_PRESENT uint32_t err_code = sd_nvic_critical_region_exit(0); - //APP_ERROR_CHECK(err_code); + (void) err_code; //APP_ERROR_CHECK(err_code); #else __enable_irq(); #endif diff --git a/cores/nRF5/utility/debug.cpp b/cores/nRF5/utility/debug.cpp index c09c840f..83a4c1ac 100644 --- a/cores/nRF5/utility/debug.cpp +++ b/cores/nRF5/utility/debug.cpp @@ -248,8 +248,6 @@ void dbgDumpMemoryCFormat(const char* str, void const *buf, uint16_t count) for(uint32_t i=0; iDEVICEID[1], NRF_FICR->DEVICEID[0]); + sprintf(serial_str, "%08lu%08lu", NRF_FICR->DEVICEID[1], NRF_FICR->DEVICEID[0]); } return serial_str; diff --git a/libraries/Bluefruit52Lib/src/bluefruit.cpp b/libraries/Bluefruit52Lib/src/bluefruit.cpp index 14684eb0..751cb26d 100644 --- a/libraries/Bluefruit52Lib/src/bluefruit.cpp +++ b/libraries/Bluefruit52Lib/src/bluefruit.cpp @@ -887,11 +887,12 @@ void AdafruitBluefruit::_ble_handler(ble_evt_t* evt) case BLE_GAP_EVT_PHY_UPDATE_REQUEST: { - #if CFG_DEBUG >= 1 ble_gap_phys_t* req_phy = &evt->evt.gap_evt.params.phy_update_request.peer_preferred_phys; char const *phy_str[] = { "Auto", "1 Mbps", "2 Mbps", "Coded" }; + + (void) req_phy; + (void) phy_str; LOG_LV1("GAP", "PHY request tx: %s, rx: %s", phy_str[req_phy->tx_phys], phy_str[req_phy->rx_phys]); - #endif // Tell SoftDevice to choose PHY automatically ble_gap_phys_t phy = { BLE_GAP_PHY_AUTO, BLE_GAP_PHY_AUTO }; @@ -909,6 +910,7 @@ void AdafruitBluefruit::_ble_handler(ble_evt_t* evt) }else { char const *phy_str[] = { "Auto", "1 Mbps", "2 Mbps", "Coded" }; + (void) phy_str; LOG_LV1("GAP", "PHY active tx: %s, rx: %s", phy_str[active_phy->tx_phy], phy_str[active_phy->rx_phy]); } } diff --git a/libraries/Bluefruit52Lib/src/utility/bonding.cpp b/libraries/Bluefruit52Lib/src/utility/bonding.cpp index 329c8eff..25631f0c 100644 --- a/libraries/Bluefruit52Lib/src/utility/bonding.cpp +++ b/libraries/Bluefruit52Lib/src/utility/bonding.cpp @@ -254,7 +254,7 @@ void bond_print_list(uint8_t role) char devname[len]; file.read(devname, len); - printf(" %s : %s (%d bytes)\n", file.name(), devname, file.size()); + printf(" %s : %s (%lu bytes)\n", file.name(), devname, file.size()); } }