Browse Source

0.8.47

* reduce GxEPD2 lib to compile faster
* upgraded GxEPD2 lib to `1.5.3`
* updated espressif32 platform to `6.5.0`
* updated U8g2 to `2.35.9`
* started to convert deprecated functions of new ArduinoJson `7.0.0`
pull/1330/head
lumapu 1 year ago
parent
commit
7a34b7e616
  1. 12
      patches/GxEPD2_SW_SPI.patch
  2. 41
      scripts/reduceGxEPD2.py
  3. 7
      src/CHANGES.md
  4. 20
      src/config/settings.h
  5. 2
      src/defines.h
  6. 32
      src/platformio.ini
  7. 2
      src/plugins/Display/Display_ePaper.h

12
patches/GxEPD2_SW_SPI.patch

@ -1,5 +1,5 @@
diff --git a/src/GxEPD2_EPD.cpp b/src/GxEPD2_EPD.cpp diff --git a/src/GxEPD2_EPD.cpp b/src/GxEPD2_EPD.cpp
index 1588444..592869b 100644 index 8df8bef..91d7f49 100644
--- a/src/GxEPD2_EPD.cpp --- a/src/GxEPD2_EPD.cpp
+++ b/src/GxEPD2_EPD.cpp +++ b/src/GxEPD2_EPD.cpp
@@ -19,9 +19,9 @@ @@ -19,9 +19,9 @@
@ -71,7 +71,7 @@ index 1588444..592869b 100644
void GxEPD2_EPD::_reset() void GxEPD2_EPD::_reset()
{ {
if (_rst >= 0) if (_rst >= 0)
@@ -174,115 +169,201 @@ void GxEPD2_EPD::_waitWhileBusy(const char* comment, uint16_t busy_time) @@ -174,115 +171,201 @@ void GxEPD2_EPD::_waitWhileBusy(const char* comment, uint16_t busy_time)
void GxEPD2_EPD::_writeCommand(uint8_t c) void GxEPD2_EPD::_writeCommand(uint8_t c)
{ {
@ -304,7 +304,7 @@ index 1588444..592869b 100644
+ _endTransaction(); + _endTransaction();
} }
diff --git a/src/GxEPD2_EPD.h b/src/GxEPD2_EPD.h diff --git a/src/GxEPD2_EPD.h b/src/GxEPD2_EPD.h
index ef2318f..50aa961 100644 index 34c1145..c480b7d 100644
--- a/src/GxEPD2_EPD.h --- a/src/GxEPD2_EPD.h
+++ b/src/GxEPD2_EPD.h +++ b/src/GxEPD2_EPD.h
@@ -8,6 +8,10 @@ @@ -8,6 +8,10 @@
@ -334,7 +334,7 @@ index ef2318f..50aa961 100644
protected: protected:
void _reset(); void _reset();
void _waitWhileBusy(const char* comment = 0, uint16_t busy_time = 5000); void _waitWhileBusy(const char* comment = 0, uint16_t busy_time = 5000);
@@ -111,9 +115,14 @@ class GxEPD2_EPD @@ -111,17 +115,22 @@ class GxEPD2_EPD
void _startTransfer(); void _startTransfer();
void _transfer(uint8_t value); void _transfer(uint8_t value);
void _endTransfer(); void _endTransfer();
@ -351,7 +351,9 @@ index ef2318f..50aa961 100644
bool _diag_enabled, _pulldown_rst_mode; bool _diag_enabled, _pulldown_rst_mode;
- SPIClass* _pSPIx; - SPIClass* _pSPIx;
SPISettings _spi_settings; SPISettings _spi_settings;
@@ -123,5 +124,5 @@ class GxEPD2_EPD bool _initial_write, _initial_refresh;
bool _power_is_on, _using_partial_mode, _hibernating;
bool _init_display_done;
uint16_t _reset_duration; uint16_t _reset_duration;
- void (*_busy_callback)(const void*); - void (*_busy_callback)(const void*);
+ void (*_busy_callback)(const void*); + void (*_busy_callback)(const void*);

41
scripts/reduceGxEPD2.py

@ -0,0 +1,41 @@
import os
import subprocess
import glob
Import("env")
def rmDirWithFiles(path):
if os.path.isdir(path):
for f in glob.glob(path + "/*"):
os.remove(f)
os.rmdir(path)
def clean(libName):
# save current wd
start = os.getcwd()
if os.path.exists('.pio/libdeps/' + env['PIOENV'] + '/' + libName) == False:
print("path '" + '.pio/libdeps/' + env['PIOENV'] + '/' + libName + "' does not exist")
return
os.chdir('.pio/libdeps/' + env['PIOENV'] + '/' + libName)
os.chdir('src/')
types = ('epd/*.h', 'epd/*.cpp') # the tuple of file types
files = []
for t in types:
files.extend(glob.glob(t))
for f in files:
if f.count('GxEPD2_150_BN') == 0:
os.remove(f)
rmDirWithFiles("epd3c")
rmDirWithFiles("epd4c")
rmDirWithFiles("epd7c")
rmDirWithFiles("gdeq")
rmDirWithFiles("gdey")
rmDirWithFiles("it8951")
os.chdir(start)
clean("GxEPD2")

7
src/CHANGES.md

@ -1,5 +1,12 @@
# Development Changes # Development Changes
## 0.8.47 - 2024-01-06
* reduce GxEPD2 lib to compile faster
* upgraded GxEPD2 lib to `1.5.3`
* updated espressif32 platform to `6.5.0`
* updated U8g2 to `2.35.9`
* started to convert deprecated functions of new ArduinoJson `7.0.0`
## 0.8.46 - 2024-01-06 ## 0.8.46 - 2024-01-06
* improved communication * improved communication

20
src/config/settings.h

@ -308,18 +308,18 @@ class settings {
DynamicJsonDocument json(MAX_ALLOWED_BUF_SIZE); DynamicJsonDocument json(MAX_ALLOWED_BUF_SIZE);
JsonObject root = json.to<JsonObject>(); JsonObject root = json.to<JsonObject>();
json[F("version")] = CONFIG_VERSION; json[F("version")] = CONFIG_VERSION;
jsonNetwork(root.createNestedObject(F("wifi")), true); jsonNetwork(root[F("wifi")].to<JsonObject>(), true);
jsonNrf(root.createNestedObject(F("nrf")), true); jsonNrf(root[F("nrf")].to<JsonObject>(), true);
#if defined(ESP32) #if defined(ESP32)
jsonCmt(root.createNestedObject(F("cmt")), true); jsonCmt(root[F("cmt")].to<JsonObject>(), true);
#endif #endif
jsonNtp(root.createNestedObject(F("ntp")), true); jsonNtp(root[F("ntp")].to<JsonObject>(), true);
jsonSun(root.createNestedObject(F("sun")), true); jsonSun(root[F("sun")].to<JsonObject>(), true);
jsonSerial(root.createNestedObject(F("serial")), true); jsonSerial(root[F("serial")].to<JsonObject>(), true);
jsonMqtt(root.createNestedObject(F("mqtt")), true); jsonMqtt(root[F("mqtt")].to<JsonObject>(), true);
jsonLed(root.createNestedObject(F("led")), true); jsonLed(root[F("led")].to<JsonObject>(), true);
jsonPlugin(root.createNestedObject(F("plugin")), true); jsonPlugin(root[F("plugin")].to<JsonObject>(), true);
jsonInst(root.createNestedObject(F("inst")), true); jsonInst(root[F("inst")].to<JsonObject>(), true);
DPRINT(DBG_INFO, F("memory usage: ")); DPRINT(DBG_INFO, F("memory usage: "));
DBGPRINTLN(String(json.memoryUsage())); DBGPRINTLN(String(json.memoryUsage()));

2
src/defines.h

@ -13,7 +13,7 @@
//------------------------------------- //-------------------------------------
#define VERSION_MAJOR 0 #define VERSION_MAJOR 0
#define VERSION_MINOR 8 #define VERSION_MINOR 8
#define VERSION_PATCH 46 #define VERSION_PATCH 47
//------------------------------------- //-------------------------------------
typedef struct { typedef struct {

32
src/platformio.ini

@ -22,6 +22,7 @@ extra_scripts =
pre:../scripts/auto_firmware_version.py pre:../scripts/auto_firmware_version.py
pre:../scripts/convertHtml.py pre:../scripts/convertHtml.py
pre:../scripts/applyPatches.py pre:../scripts/applyPatches.py
pre:../scripts/reduceGxEPD2.py
lib_deps = lib_deps =
https://github.com/yubox-node-org/ESPAsyncWebServer https://github.com/yubox-node-org/ESPAsyncWebServer
@ -30,8 +31,8 @@ lib_deps =
https://github.com/bertmelis/espMqttClient#v1.5.0 https://github.com/bertmelis/espMqttClient#v1.5.0
bblanchon/ArduinoJson @ ^6.21.3 bblanchon/ArduinoJson @ ^6.21.3
https://github.com/JChristensen/Timezone @ ^1.2.4 https://github.com/JChristensen/Timezone @ ^1.2.4
olikraus/U8g2 @ ^2.35.7 olikraus/U8g2 @ ^2.35.9
https://github.com/zinggjm/GxEPD2 @ ^1.5.2 https://github.com/zinggjm/GxEPD2 @ ^1.5.3
build_flags = build_flags =
-std=c++17 -std=c++17
-std=gnu++17 -std=gnu++17
@ -71,7 +72,7 @@ monitor_filters =
esp8266_exception_decoder esp8266_exception_decoder
[env:esp32-wroom32] [env:esp32-wroom32]
platform = espressif32@6.4.0 platform = espressif32@6.5.0
board = lolin_d32 board = lolin_d32
build_flags = ${env.build_flags} build_flags = ${env.build_flags}
-DUSE_HSPI_FOR_EPD -DUSE_HSPI_FOR_EPD
@ -79,7 +80,7 @@ monitor_filters =
esp32_exception_decoder esp32_exception_decoder
[env:esp32-wroom32-prometheus] [env:esp32-wroom32-prometheus]
platform = espressif32@6.4.0 platform = espressif32@6.5.0
board = lolin_d32 board = lolin_d32
build_flags = ${env.build_flags} build_flags = ${env.build_flags}
-DUSE_HSPI_FOR_EPD -DUSE_HSPI_FOR_EPD
@ -98,8 +99,8 @@ lib_deps =
https://github.com/bertmelis/espMqttClient#v1.5.0 https://github.com/bertmelis/espMqttClient#v1.5.0
bblanchon/ArduinoJson @ ^6.21.3 bblanchon/ArduinoJson @ ^6.21.3
https://github.com/JChristensen/Timezone @ ^1.2.4 https://github.com/JChristensen/Timezone @ ^1.2.4
olikraus/U8g2 @ ^2.35.7 olikraus/U8g2 @ ^2.35.9
zinggjm/GxEPD2 @ ^1.5.2 https://github.com/zinggjm/GxEPD2 @ ^1.5.3
build_flags = ${env.build_flags} build_flags = ${env.build_flags}
-D ETHERNET -D ETHERNET
-DRELEASE -DRELEASE
@ -110,7 +111,7 @@ monitor_filters =
esp32_exception_decoder esp32_exception_decoder
[env:esp32-s2-mini] [env:esp32-s2-mini]
platform = espressif32@6.4.0 platform = espressif32@6.5.0
board = lolin_s2_mini board = lolin_s2_mini
build_flags = ${env.build_flags} build_flags = ${env.build_flags}
-DUSE_HSPI_FOR_EPD -DUSE_HSPI_FOR_EPD
@ -124,7 +125,7 @@ monitor_filters =
esp32_exception_decoder esp32_exception_decoder
[env:esp32-c3-mini] [env:esp32-c3-mini]
platform = espressif32@6.4.0 platform = espressif32@6.5.0
board = lolin_c3_mini board = lolin_c3_mini
build_flags = ${env.build_flags} build_flags = ${env.build_flags}
-DUSE_HSPI_FOR_EPD -DUSE_HSPI_FOR_EPD
@ -139,7 +140,7 @@ monitor_filters =
[env:opendtufusion] [env:opendtufusion]
platform = espressif32@6.4.0 platform = espressif32@6.5.0
board = esp32-s3-devkitc-1 board = esp32-s3-devkitc-1
upload_protocol = esp-builtin upload_protocol = esp-builtin
build_flags = ${env.build_flags} build_flags = ${env.build_flags}
@ -162,7 +163,7 @@ monitor_filters =
esp32_exception_decoder, colorize esp32_exception_decoder, colorize
[env:opendtufusion-ethernet] [env:opendtufusion-ethernet]
platform = espressif32@6.4.0 platform = espressif32@6.5.0
board = esp32-s3-devkitc-1 board = esp32-s3-devkitc-1
lib_deps = lib_deps =
khoih-prog/AsyncWebServer_ESP32_W5500 khoih-prog/AsyncWebServer_ESP32_W5500
@ -172,13 +173,12 @@ lib_deps =
https://github.com/bertmelis/espMqttClient#v1.5.0 https://github.com/bertmelis/espMqttClient#v1.5.0
bblanchon/ArduinoJson @ ^6.21.3 bblanchon/ArduinoJson @ ^6.21.3
https://github.com/JChristensen/Timezone @ ^1.2.4 https://github.com/JChristensen/Timezone @ ^1.2.4
olikraus/U8g2 @ ^2.35.7 olikraus/U8g2 @ ^2.35.9
zinggjm/GxEPD2 @ ^1.5.2 https://github.com/zinggjm/GxEPD2 @ ^1.5.3
upload_protocol = esp-builtin upload_protocol = esp-builtin
build_flags = ${env.build_flags} build_flags = ${env.build_flags}
-DETHERNET -DETHERNET
-DSPI_HAL -DSPI_HAL
-DUSE_HSPI_FOR_EPD
-DDEF_ETH_CS_PIN=42 -DDEF_ETH_CS_PIN=42
-DDEF_ETH_SCK_PIN=39 -DDEF_ETH_SCK_PIN=39
-DDEF_ETH_MISO_PIN=41 -DDEF_ETH_MISO_PIN=41
@ -205,7 +205,7 @@ monitor_filters =
esp32_exception_decoder, colorize esp32_exception_decoder, colorize
[env:opendtufusion-dev] [env:opendtufusion-dev]
platform = espressif32@6.4.0 platform = espressif32@6.5.0
board = esp32-s3-devkitc-1 board = esp32-s3-devkitc-1
lib_deps = lib_deps =
https://github.com/yubox-node-org/ESPAsyncWebServer https://github.com/yubox-node-org/ESPAsyncWebServer
@ -214,8 +214,8 @@ lib_deps =
https://github.com/bertmelis/espMqttClient#v1.5.0 https://github.com/bertmelis/espMqttClient#v1.5.0
bblanchon/ArduinoJson @ ^6.21.3 bblanchon/ArduinoJson @ ^6.21.3
https://github.com/JChristensen/Timezone @ ^1.2.4 https://github.com/JChristensen/Timezone @ ^1.2.4
olikraus/U8g2 @ ^2.35.7 olikraus/U8g2 @ ^2.35.9
https://github.com/zinggjm/GxEPD2 @ ^1.5.2 https://github.com/zinggjm/GxEPD2 @ ^1.5.3
upload_protocol = esp-builtin upload_protocol = esp-builtin
build_flags = ${env.build_flags} build_flags = ${env.build_flags}
-DDEF_NRF_CS_PIN=37 -DDEF_NRF_CS_PIN=37

2
src/plugins/Display/Display_ePaper.h

@ -9,11 +9,9 @@
// enable GxEPD2_GFX base class // enable GxEPD2_GFX base class
#define ENABLE_GxEPD2_GFX 1 #define ENABLE_GxEPD2_GFX 1
#include <GxEPD2_3C.h>
#include <GxEPD2_BW.h> #include <GxEPD2_BW.h>
#include <SPI.h> #include <SPI.h>
#include <map>
// FreeFonts from Adafruit_GFX // FreeFonts from Adafruit_GFX
#include <Fonts/FreeSans12pt7b.h> #include <Fonts/FreeSans12pt7b.h>
#include <Fonts/FreeSans18pt7b.h> #include <Fonts/FreeSans18pt7b.h>

Loading…
Cancel
Save