From 996f94d401275cda6b02ee9bcf5375996c1cd585 Mon Sep 17 00:00:00 2001 From: Klaus K Wilting Date: Fri, 27 Apr 2018 18:48:24 +0200 Subject: [PATCH] repair memory display --- src/macsniff.cpp | 4 ++-- src/main.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/macsniff.cpp b/src/macsniff.cpp index da69ba22..3595f18e 100644 --- a/src/macsniff.cpp +++ b/src/macsniff.cpp @@ -27,7 +27,7 @@ bool mac_add(uint8_t *paddr, int8_t rssi, bool sniff_type) { bool added = false; uint32_t addr2int, vendor2int; // temporary buffer for MAC and Vendor OUI uint16_t hashedmac; // temporary buffer for generated hash value - float memlevel; // % of used heap mem + uint8_t memlevel; // % of used heap mem // only last 3 MAC Address bytes are used for MAC address anonymization // but since it's uint32 we take 4 bytes to avoid 1st value to be 0 @@ -53,7 +53,7 @@ bool mac_add(uint8_t *paddr, int8_t rssi, bool sniff_type) { if (added) { // Display heap memory left memlevel = ESP.getFreeHeap() / heapmem * 100; - sprintf(display_mem, "%d%%", memlevel); + sprintf(display_mem, "%i%%", memlevel); // increment counter and one blink led if (sniff_type == MAC_SNIFF_WIFI ) { macs_wifi++; // increment Wifi MACs counter diff --git a/src/main.cpp b/src/main.cpp index 15dbc0dc..2e8b8d21 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -54,7 +54,7 @@ uint16_t LEDBlinkDuration = 0; // How long the blink need to be uint16_t LEDColor = COLOR_NONE; // state machine variable to set RGB LED color bool joinstate = false; // LoRa network joined? global flag bool blinkdone = true; // flag for state machine for blinking LED once -const uint32_t heapmem = ESP.getFreeHeap(); // free heap memory after start (:= 100%) +const uint32_t heapmem = ESP.getFreeHeap(); // free heap memory after start (:= 100%) std::set macs; // associative container holds total of unique MAC adress hashes (Wifi + BLE)