From bf6a21f44f79f4803549c72dcdcff833178db679 Mon Sep 17 00:00:00 2001 From: Klaus K Wilting Date: Tue, 17 Apr 2018 23:05:12 +0200 Subject: [PATCH] new led management (part 2) --- platformio.ini | 4 ++-- src/macsniff.cpp | 4 ++-- src/main.cpp | 5 ++++- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/platformio.ini b/platformio.ini index 8be3a272..e3217138 100644 --- a/platformio.ini +++ b/platformio.ini @@ -11,10 +11,10 @@ ; ---> SELECT TARGET PLATFORM HERE! <--- [platformio] -env_default = heltec_wifi_lora_32 +;env_default = heltec_wifi_lora_32 ;env_default = ttgov1 ;env_default = ttgov2 -;env_default = lopy +env_default = lopy ;env_default = lopy4 ;env_default = lolin32lite_lora ;env_default = lolin32_lora diff --git a/src/macsniff.cpp b/src/macsniff.cpp index e57526b1..6762d662 100644 --- a/src/macsniff.cpp +++ b/src/macsniff.cpp @@ -53,12 +53,12 @@ bool mac_add(uint8_t *paddr, int8_t rssi, bool sniff_type) { // Insert only if it was not found on global count if (added) { if (sniff_type == MAC_SNIFF_WIFI ) { - set_LED(COLOR_GREEN, 20, 0, 1); + set_LED(COLOR_GREEN, 50, 0, 1); wifis.insert(hashedmac); // add hashed MAC to wifi container } #ifdef BLECOUNTER else if (sniff_type == MAC_SNIFF_BLE ) { - set_LED(COLOR_MAGENTA, 20, 0, 1); + set_LED(COLOR_MAGENTA, 50, 0, 1); bles.insert(hashedmac); // add hashed MAC to BLE container } #endif diff --git a/src/main.cpp b/src/main.cpp index 5c0e608b..f45403e9 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -424,7 +424,10 @@ uint64_t uptime() { #endif #ifdef HAS_RGB_LED - rgb_set_color(color); + if (LEDState) + rgb_set_color(color); // LED on + else + rgb_set_color(COLOR_NONE); // LED off #endif previousLEDState = LEDState; LEDcount--; // decrement blink counter