From 6bcffbd2528425a24bb2bd39ff53e50c4c580e35 Mon Sep 17 00:00:00 2001 From: hathach Date: Thu, 6 Jun 2019 11:40:56 +0700 Subject: [PATCH] clean up warnings --- cores/nRF5/utility/debug.cpp | 2 +- libraries/Bluefruit52Lib/src/BLEAdvertising.cpp | 2 +- libraries/Bluefruit52Lib/src/BLEDiscovery.cpp | 5 ++++- libraries/InternalFileSytem/src/flash/flash_cache.c | 3 ++- libraries/InternalFileSytem/src/flash/flash_nrf5x.c | 1 + 5 files changed, 9 insertions(+), 4 deletions(-) diff --git a/cores/nRF5/utility/debug.cpp b/cores/nRF5/utility/debug.cpp index 58fc0d23..7939fcfa 100644 --- a/cores/nRF5/utility/debug.cpp +++ b/cores/nRF5/utility/debug.cpp @@ -262,7 +262,7 @@ void dbgDumpMemoryCFormat(const char* str, void const *buf, uint16_t count) buf8++; } - printf("\n\};\n"); + printf("\n};\n"); } diff --git a/libraries/Bluefruit52Lib/src/BLEAdvertising.cpp b/libraries/Bluefruit52Lib/src/BLEAdvertising.cpp index b8b76f7b..a766b588 100644 --- a/libraries/Bluefruit52Lib/src/BLEAdvertising.cpp +++ b/libraries/Bluefruit52Lib/src/BLEAdvertising.cpp @@ -346,7 +346,7 @@ bool BLEAdvertising::_start(uint16_t interval, uint16_t timeout) }, .p_peer_addr = NULL , // Undirected advertisement .interval = interval , // advertising interval (in units of 0.625 ms) - .duration = timeout*100 , // in 10-ms unit + .duration = (uint16_t) (timeout*100), // in 10-ms unit .max_adv_evts = 0, // TODO can be used for fast/slow mode .channel_mask = { 0, 0, 0, 0, 0 } , // 40 channel, set 1 to disable diff --git a/libraries/Bluefruit52Lib/src/BLEDiscovery.cpp b/libraries/Bluefruit52Lib/src/BLEDiscovery.cpp index 220e5d84..0c789b54 100644 --- a/libraries/Bluefruit52Lib/src/BLEDiscovery.cpp +++ b/libraries/Bluefruit52Lib/src/BLEDiscovery.cpp @@ -144,7 +144,10 @@ uint8_t BLEDiscovery::discoverCharacteristic(uint16_t conn_handle, BLEClientChar // only discover CCCD descriptor if (disc_chr->chars[d].char_props.notify || disc_chr->chars[d].char_props.indicate ) { - ble_gattc_handle_range_t range = { disc_chr->chars[d].handle_value + 1, _hdl_range.end_handle }; + ble_gattc_handle_range_t range = { + .start_handle = (uint16_t) (disc_chr->chars[d].handle_value + 1), + .end_handle = _hdl_range.end_handle + }; if ( range.start_handle <= range.end_handle ) { diff --git a/libraries/InternalFileSytem/src/flash/flash_cache.c b/libraries/InternalFileSytem/src/flash/flash_cache.c index 5fc17609..7004b6dd 100644 --- a/libraries/InternalFileSytem/src/flash/flash_cache.c +++ b/libraries/InternalFileSytem/src/flash/flash_cache.c @@ -22,6 +22,7 @@ * THE SOFTWARE. */ +#include #include "flash_cache.h" #include "common_func.h" #include "variant.h" @@ -124,6 +125,6 @@ void flash_cache_read (flash_cache_t* fc, void* dst, uint32_t addr, uint32_t cou } else { - fc->read(dst, (void*) addr, count); + fc->read(dst, addr, count); } } diff --git a/libraries/InternalFileSytem/src/flash/flash_nrf5x.c b/libraries/InternalFileSytem/src/flash/flash_nrf5x.c index 2a2edb6b..01b92d69 100644 --- a/libraries/InternalFileSytem/src/flash/flash_nrf5x.c +++ b/libraries/InternalFileSytem/src/flash/flash_nrf5x.c @@ -26,6 +26,7 @@ #include "flash_cache.h" #include "nrf_sdm.h" #include "nrf_soc.h" +#include "delay.h" #include "rtos.h" //--------------------------------------------------------------------+