diff --git a/patches/GxEPD2_SW_SPI.patch b/patches/GxEPD2_SW_SPI.patch index 9697eec8..dc3fa9ca 100644 --- a/patches/GxEPD2_SW_SPI.patch +++ b/patches/GxEPD2_SW_SPI.patch @@ -1,5 +1,5 @@ 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 +++ b/src/GxEPD2_EPD.cpp @@ -19,9 +19,9 @@ @@ -71,7 +71,7 @@ index 1588444..592869b 100644 void GxEPD2_EPD::_reset() { 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) { @@ -304,7 +304,7 @@ index 1588444..592869b 100644 + _endTransaction(); } 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 +++ b/src/GxEPD2_EPD.h @@ -8,6 +8,10 @@ @@ -334,7 +334,7 @@ index ef2318f..50aa961 100644 protected: void _reset(); 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 _transfer(uint8_t value); void _endTransfer(); @@ -351,7 +351,9 @@ index ef2318f..50aa961 100644 bool _diag_enabled, _pulldown_rst_mode; - SPIClass* _pSPIx; 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; - void (*_busy_callback)(const void*); + void (*_busy_callback)(const void*); diff --git a/scripts/reduceGxEPD2.py b/scripts/reduceGxEPD2.py new file mode 100644 index 00000000..f05e5c3b --- /dev/null +++ b/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") diff --git a/src/CHANGES.md b/src/CHANGES.md index 9313dbee..e91179f7 100644 --- a/src/CHANGES.md +++ b/src/CHANGES.md @@ -1,5 +1,12 @@ # 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 * improved communication diff --git a/src/config/settings.h b/src/config/settings.h index 476f9fbf..8ce71167 100644 --- a/src/config/settings.h +++ b/src/config/settings.h @@ -308,18 +308,18 @@ class settings { DynamicJsonDocument json(MAX_ALLOWED_BUF_SIZE); JsonObject root = json.to(); json[F("version")] = CONFIG_VERSION; - jsonNetwork(root.createNestedObject(F("wifi")), true); - jsonNrf(root.createNestedObject(F("nrf")), true); + jsonNetwork(root[F("wifi")].to(), true); + jsonNrf(root[F("nrf")].to(), true); #if defined(ESP32) - jsonCmt(root.createNestedObject(F("cmt")), true); + jsonCmt(root[F("cmt")].to(), true); #endif - jsonNtp(root.createNestedObject(F("ntp")), true); - jsonSun(root.createNestedObject(F("sun")), true); - jsonSerial(root.createNestedObject(F("serial")), true); - jsonMqtt(root.createNestedObject(F("mqtt")), true); - jsonLed(root.createNestedObject(F("led")), true); - jsonPlugin(root.createNestedObject(F("plugin")), true); - jsonInst(root.createNestedObject(F("inst")), true); + jsonNtp(root[F("ntp")].to(), true); + jsonSun(root[F("sun")].to(), true); + jsonSerial(root[F("serial")].to(), true); + jsonMqtt(root[F("mqtt")].to(), true); + jsonLed(root[F("led")].to(), true); + jsonPlugin(root[F("plugin")].to(), true); + jsonInst(root[F("inst")].to(), true); DPRINT(DBG_INFO, F("memory usage: ")); DBGPRINTLN(String(json.memoryUsage())); diff --git a/src/defines.h b/src/defines.h index fcd3bbf7..87b4101d 100644 --- a/src/defines.h +++ b/src/defines.h @@ -13,7 +13,7 @@ //------------------------------------- #define VERSION_MAJOR 0 #define VERSION_MINOR 8 -#define VERSION_PATCH 46 +#define VERSION_PATCH 47 //------------------------------------- typedef struct { diff --git a/src/platformio.ini b/src/platformio.ini index 2b4b25cf..9b204f2e 100644 --- a/src/platformio.ini +++ b/src/platformio.ini @@ -22,6 +22,7 @@ extra_scripts = pre:../scripts/auto_firmware_version.py pre:../scripts/convertHtml.py pre:../scripts/applyPatches.py + pre:../scripts/reduceGxEPD2.py lib_deps = https://github.com/yubox-node-org/ESPAsyncWebServer @@ -30,8 +31,8 @@ lib_deps = https://github.com/bertmelis/espMqttClient#v1.5.0 bblanchon/ArduinoJson @ ^6.21.3 https://github.com/JChristensen/Timezone @ ^1.2.4 - olikraus/U8g2 @ ^2.35.7 - https://github.com/zinggjm/GxEPD2 @ ^1.5.2 + olikraus/U8g2 @ ^2.35.9 + https://github.com/zinggjm/GxEPD2 @ ^1.5.3 build_flags = -std=c++17 -std=gnu++17 @@ -71,7 +72,7 @@ monitor_filters = esp8266_exception_decoder [env:esp32-wroom32] -platform = espressif32@6.4.0 +platform = espressif32@6.5.0 board = lolin_d32 build_flags = ${env.build_flags} -DUSE_HSPI_FOR_EPD @@ -79,7 +80,7 @@ monitor_filters = esp32_exception_decoder [env:esp32-wroom32-prometheus] -platform = espressif32@6.4.0 +platform = espressif32@6.5.0 board = lolin_d32 build_flags = ${env.build_flags} -DUSE_HSPI_FOR_EPD @@ -98,8 +99,8 @@ lib_deps = https://github.com/bertmelis/espMqttClient#v1.5.0 bblanchon/ArduinoJson @ ^6.21.3 https://github.com/JChristensen/Timezone @ ^1.2.4 - olikraus/U8g2 @ ^2.35.7 - zinggjm/GxEPD2 @ ^1.5.2 + olikraus/U8g2 @ ^2.35.9 + https://github.com/zinggjm/GxEPD2 @ ^1.5.3 build_flags = ${env.build_flags} -D ETHERNET -DRELEASE @@ -110,7 +111,7 @@ monitor_filters = esp32_exception_decoder [env:esp32-s2-mini] -platform = espressif32@6.4.0 +platform = espressif32@6.5.0 board = lolin_s2_mini build_flags = ${env.build_flags} -DUSE_HSPI_FOR_EPD @@ -124,7 +125,7 @@ monitor_filters = esp32_exception_decoder [env:esp32-c3-mini] -platform = espressif32@6.4.0 +platform = espressif32@6.5.0 board = lolin_c3_mini build_flags = ${env.build_flags} -DUSE_HSPI_FOR_EPD @@ -139,7 +140,7 @@ monitor_filters = [env:opendtufusion] -platform = espressif32@6.4.0 +platform = espressif32@6.5.0 board = esp32-s3-devkitc-1 upload_protocol = esp-builtin build_flags = ${env.build_flags} @@ -162,7 +163,7 @@ monitor_filters = esp32_exception_decoder, colorize [env:opendtufusion-ethernet] -platform = espressif32@6.4.0 +platform = espressif32@6.5.0 board = esp32-s3-devkitc-1 lib_deps = khoih-prog/AsyncWebServer_ESP32_W5500 @@ -172,13 +173,12 @@ lib_deps = https://github.com/bertmelis/espMqttClient#v1.5.0 bblanchon/ArduinoJson @ ^6.21.3 https://github.com/JChristensen/Timezone @ ^1.2.4 - olikraus/U8g2 @ ^2.35.7 - zinggjm/GxEPD2 @ ^1.5.2 + olikraus/U8g2 @ ^2.35.9 + https://github.com/zinggjm/GxEPD2 @ ^1.5.3 upload_protocol = esp-builtin build_flags = ${env.build_flags} -DETHERNET -DSPI_HAL - -DUSE_HSPI_FOR_EPD -DDEF_ETH_CS_PIN=42 -DDEF_ETH_SCK_PIN=39 -DDEF_ETH_MISO_PIN=41 @@ -205,7 +205,7 @@ monitor_filters = esp32_exception_decoder, colorize [env:opendtufusion-dev] -platform = espressif32@6.4.0 +platform = espressif32@6.5.0 board = esp32-s3-devkitc-1 lib_deps = https://github.com/yubox-node-org/ESPAsyncWebServer @@ -214,8 +214,8 @@ lib_deps = https://github.com/bertmelis/espMqttClient#v1.5.0 bblanchon/ArduinoJson @ ^6.21.3 https://github.com/JChristensen/Timezone @ ^1.2.4 - olikraus/U8g2 @ ^2.35.7 - https://github.com/zinggjm/GxEPD2 @ ^1.5.2 + olikraus/U8g2 @ ^2.35.9 + https://github.com/zinggjm/GxEPD2 @ ^1.5.3 upload_protocol = esp-builtin build_flags = ${env.build_flags} -DDEF_NRF_CS_PIN=37 diff --git a/src/plugins/Display/Display_ePaper.h b/src/plugins/Display/Display_ePaper.h index c9a0fbf5..0e077601 100644 --- a/src/plugins/Display/Display_ePaper.h +++ b/src/plugins/Display/Display_ePaper.h @@ -9,11 +9,9 @@ // enable GxEPD2_GFX base class #define ENABLE_GxEPD2_GFX 1 -#include #include #include -#include // FreeFonts from Adafruit_GFX #include #include