From da845993ddc464e20a049fc3f6ac87ff0b54e841 Mon Sep 17 00:00:00 2001 From: Klaus K Wilting Date: Sat, 12 Sep 2020 22:39:04 +0200 Subject: [PATCH] code sanitizations (fix some compiler warnings) --- include/sdcard.h | 10 ++++------ src/blecsan.cpp | 7 +++++-- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/include/sdcard.h b/include/sdcard.h index d95e8336..669cebc7 100644 --- a/include/sdcard.h +++ b/include/sdcard.h @@ -8,7 +8,6 @@ #if (HAS_SDCARD) #if HAS_SDCARD == 1 #include -//#include #elif HAS_SDCARD == 2 #include #else @@ -38,13 +37,12 @@ #define SDCARD_FILE_NAME "/paxcount.%02d" #define SDCARD_FILE_HEADER "date, time, wifi, bluet" -#define SDCARD_FILE_NAME "paxcount.%02d" -#define SDCARD_FILE_HEADER "date, time, wifi, bluet" + #if (COUNT_ENS) #define SDCARD_FILE_HEADER_CWA ",cwa" #endif -bool sdcard_init( void ); -void sdcardWriteData( uint16_t, uint16_t, uint16_t = 0); +bool sdcard_init(void); +void sdcardWriteData(uint16_t, uint16_t, uint16_t = 0); -#endif // _SDCARD_H +#endif // _SDCARD_H diff --git a/src/blecsan.cpp b/src/blecsan.cpp index 6bed9cbb..960825c5 100644 --- a/src/blecsan.cpp +++ b/src/blecsan.cpp @@ -116,7 +116,6 @@ IRAM_ATTR void gap_callback_handler(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param_t *param) { esp_ble_gap_cb_param_t *p = (esp_ble_gap_cb_param_t *)param; - uint16_t hashedmac = 0; ESP_LOGV(TAG, "BT payload rcvd -> type: 0x%.2x -> %s", *p->scan_rst.ble_adv, btsig_gap_type(*p->scan_rst.ble_adv)); @@ -162,7 +161,11 @@ IRAM_ATTR void gap_callback_handler(esp_gap_ble_cb_event_t event, // hash and add this device and show new count total if it was not // previously added - hashedmac = + +#if (COUNT_ENS) + uint16_t hashedmac = +#endif + mac_add((uint8_t *)p->scan_rst.bda, p->scan_rst.rssi, MAC_SNIFF_BLE); #if (COUNT_ENS)