From 714b7a7d41be60fdee2502725a798e5221f0b151 Mon Sep 17 00:00:00 2001 From: noman1228 Date: Tue, 27 Feb 2024 19:27:24 -0500 Subject: [PATCH] Fixed spacing, switched to now() function. NetworkMgr API in place. Added entry to firmware. --- ESPixelStick/ESPixelStick.ino | 6 ++-- ESPixelStick/src/service/DisplayOLED.cpp | 11 +++++--- ESPixelStick/src/service/DisplayOLED.h | 3 +- dist/firmware/firmware.json | 35 ++++++++++++++++++++++++ platformio.ini | 2 +- 5 files changed, 47 insertions(+), 10 deletions(-) diff --git a/ESPixelStick/ESPixelStick.ino b/ESPixelStick/ESPixelStick.ino index 7e2e0c592..ed337748d 100644 --- a/ESPixelStick/ESPixelStick.ino +++ b/ESPixelStick/ESPixelStick.ino @@ -501,8 +501,6 @@ void loop() */ FeedWDT (); - - // Keep the Network Open NetworkMgr.Poll (); @@ -548,14 +546,14 @@ void loop() if(abs(now() - ConfigLoadNeeded) > LOAD_CONFIG_DELAY) { FeedWDT (); - LoadConfig (); + LoadConfig (); } } if (ConfigSaveNeeded) { FeedWDT (); - SaveConfig (); + SaveConfig (); } } // loop diff --git a/ESPixelStick/src/service/DisplayOLED.cpp b/ESPixelStick/src/service/DisplayOLED.cpp index fd3b1f260..0f80b198d 100644 --- a/ESPixelStick/src/service/DisplayOLED.cpp +++ b/ESPixelStick/src/service/DisplayOLED.cpp @@ -26,6 +26,8 @@ #include #include #include "DisplayOLED.h" +#include +#include "../network/NetworkMgr.hpp" Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET); @@ -51,12 +53,13 @@ void c_OLED::Begin() void c_OLED::Update() { // DEBUG_START; - if (millis() > updateTimer_OLED) // Lets check if OLED needs an update only once every 10 seconds + if (now() > updateTimer_OLED) // Lets check if OLED needs an update only once every 10 seconds { - updateTimer_OLED += 10000; + updateTimer_OLED += 10; display.stopscroll(); - String currIP = WiFi.localIP().toString(); - String currHost = WiFi.getHostname(); + String currIP = NetworkMgr.GetlocalIP ().toString (); + String currHost; + NetworkMgr.GetHostname(currHost); int rssi = constrain(WiFi.RSSI(), -100, -50); int quality = map(rssi, -100, -50, 0, 100); if (!dispIP.equals(currIP) || !dispHostName.equals(currHost) || dispRSSI != quality) diff --git a/ESPixelStick/src/service/DisplayOLED.h b/ESPixelStick/src/service/DisplayOLED.h index f858cbe0f..03a510bcd 100644 --- a/ESPixelStick/src/service/DisplayOLED.h +++ b/ESPixelStick/src/service/DisplayOLED.h @@ -1,3 +1,4 @@ +#pragma once /* * DisplayOLED.h * @@ -24,7 +25,7 @@ class c_OLED { private: - uint64_t updateTimer_OLED = 10000; + uint64_t updateTimer_OLED = 10; String dispIP; String dispHostName; int dispRSSI; diff --git a/dist/firmware/firmware.json b/dist/firmware/firmware.json index 4fc28dd7a..77bc09e96 100644 --- a/dist/firmware/firmware.json +++ b/dist/firmware/firmware.json @@ -876,6 +876,41 @@ "offset": "0x3B0000" } }, + { + "name": "ESP32 DevKitC V4 OLED", + "description": "ESP32 module NO PSRAM support for DIY builds", + "chip": "esp32", + "appbin": "esp32/esp32_devkitc_v4_oled-app.bin", + "esptool": { + "baudrate": "460800", + "options": "--before default_reset --after hard_reset", + "flashcmd": "write_flash -z" + }, + "binfiles": [ + { + "name": "esp32/esp32_devkitc_v4_oled-bootloader.bin", + "offset": "0x1000" + }, + { + "name": "esp32/esp32_devkitc_v4_oled-partitions.bin", + "offset": "0x8000" + }, + { + "name": "esp32/boot_app0.bin", + "offset": "0xe000" + }, + { + "name": "esp32/esp32_devkitc_v4_oled-app.bin", + "offset": "0x10000" + } + ], + "filesystem": { + "page": "256", + "block": "4096", + "size": "0x50000", + "offset": "0x3B0000" + } + }, { "name": "ESP3DEUXQUAD_DMX", "description": "Canada Pixels Coro ESP32 module NO PSRAM support", diff --git a/platformio.ini b/platformio.ini index 278b6381a..e301d5191 100644 --- a/platformio.ini +++ b/platformio.ini @@ -36,7 +36,7 @@ extra_scripts = pre:.scripts/pio-version.py .scripts/download_fs.py post:.scripts/CopyTargets.py -build_type = debug +build_type = release ; upload_port = com6 lib_ignore =