Skip to content

Commit

Permalink
Fixed spacing, switched to now() function. NetworkMgr API in place. A…
Browse files Browse the repository at this point in the history
…dded entry to firmware.
  • Loading branch information
noman1228 committed Feb 28, 2024
1 parent 3fc19a4 commit 714b7a7
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 10 deletions.
6 changes: 2 additions & 4 deletions ESPixelStick/ESPixelStick.ino
Original file line number Diff line number Diff line change
Expand Up @@ -501,8 +501,6 @@ void loop()
*/
FeedWDT ();



// Keep the Network Open
NetworkMgr.Poll ();

Expand Down Expand Up @@ -548,14 +546,14 @@ void loop()
if(abs(now() - ConfigLoadNeeded) > LOAD_CONFIG_DELAY)
{
FeedWDT ();
LoadConfig ();
LoadConfig ();
}
}

if (ConfigSaveNeeded)
{
FeedWDT ();
SaveConfig ();
SaveConfig ();
}

} // loop
Expand Down
11 changes: 7 additions & 4 deletions ESPixelStick/src/service/DisplayOLED.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#include "DisplayOLED.h"
#include <TimeLib.h>
#include "../network/NetworkMgr.hpp"

Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);

Expand All @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion ESPixelStick/src/service/DisplayOLED.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#pragma once
/*
* DisplayOLED.h
*
Expand All @@ -24,7 +25,7 @@
class c_OLED
{
private:
uint64_t updateTimer_OLED = 10000;
uint64_t updateTimer_OLED = 10;
String dispIP;
String dispHostName;
int dispRSSI;
Expand Down
35 changes: 35 additions & 0 deletions dist/firmware/firmware.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down

0 comments on commit 714b7a7

Please sign in to comment.