diff --git a/platformio.ini b/platformio.ini index ea088c44..f30db4e0 100644 --- a/platformio.ini +++ b/platformio.ini @@ -49,6 +49,7 @@ extra_configs = # ------------------------------------------------------------------------------ arduino_core_2_6_3 = espressif8266@2.3.3 arduino_core_2_7_4 = espressif8266@2.6.2 +arduino_core_3_0_0 = espressif8266@3.0.0 # Development platforms arduino_core_develop = https://github.com/platformio/platform-espressif8266#develop @@ -132,6 +133,8 @@ ldscript_4m1m = eagle.flash.4m1m.ld build_flags = -DESP8266 -DFP_IN_IROM + ;-Wno-deprecated-declarations + ;-Wno-register ; NONOSDK22x_190703 = 2.2.2-dev(38a443e) -DPIO_FRAMEWORK_ARDUINO_ESPRESSIF_SDK22x_190703 ; lwIP 2 - Higher Bandwidth no Features diff --git a/usermods/EleksTube_IPS/TFTs.h b/usermods/EleksTube_IPS/TFTs.h index 160dc763..675129dc 100644 --- a/usermods/EleksTube_IPS/TFTs.h +++ b/usermods/EleksTube_IPS/TFTs.h @@ -41,6 +41,7 @@ private: //// BEGIN STOLEN CODE + // Draw directly from file stored in RGB565 format bool drawBin(const char *filename) { fs::File bmpFS; @@ -55,14 +56,25 @@ private: return(false); } - bool oldSwapBytes = getSwapBytes(); - setSwapBytes(true); + size_t sz = bmpFS.size(); + if (sz <= 64800) + { + bool oldSwapBytes = getSwapBytes(); + setSwapBytes(true); - bmpFS.read((uint8_t *) output_buffer,64800); + int16_t h = sz / (135 * 2); - pushImage(0, 0, 135, 240, (uint16_t *)output_buffer); + //draw img that is shorter than 240pix into the center + int16_t y = (height() - h) /2; - setSwapBytes(oldSwapBytes); + bmpFS.read((uint8_t *) output_buffer,sz); + + if (!realtimeMode || realtimeOverride) strip.service(); + + pushImage(0, y, 135, h, (uint16_t *)output_buffer); + + setSwapBytes(oldSwapBytes); + } bmpFS.close(); diff --git a/usermods/EleksTube_IPS/bmp/0.bmp b/usermods/EleksTube_IPS/bmp/0.bmp deleted file mode 100644 index e7d77856..00000000 Binary files a/usermods/EleksTube_IPS/bmp/0.bmp and /dev/null differ diff --git a/usermods/EleksTube_IPS/bmp/1.bmp b/usermods/EleksTube_IPS/bmp/1.bmp deleted file mode 100644 index 209529f9..00000000 Binary files a/usermods/EleksTube_IPS/bmp/1.bmp and /dev/null differ diff --git a/usermods/EleksTube_IPS/bmp/2.bmp b/usermods/EleksTube_IPS/bmp/2.bmp deleted file mode 100644 index d94a55d5..00000000 Binary files a/usermods/EleksTube_IPS/bmp/2.bmp and /dev/null differ diff --git a/usermods/EleksTube_IPS/bmp/3.bmp b/usermods/EleksTube_IPS/bmp/3.bmp deleted file mode 100644 index 40196117..00000000 Binary files a/usermods/EleksTube_IPS/bmp/3.bmp and /dev/null differ diff --git a/usermods/EleksTube_IPS/bmp/4.bmp b/usermods/EleksTube_IPS/bmp/4.bmp deleted file mode 100644 index 7b663d8a..00000000 Binary files a/usermods/EleksTube_IPS/bmp/4.bmp and /dev/null differ diff --git a/usermods/EleksTube_IPS/bmp/5.bmp b/usermods/EleksTube_IPS/bmp/5.bmp deleted file mode 100644 index b2776648..00000000 Binary files a/usermods/EleksTube_IPS/bmp/5.bmp and /dev/null differ diff --git a/usermods/EleksTube_IPS/bmp/6.bmp b/usermods/EleksTube_IPS/bmp/6.bmp deleted file mode 100644 index 04984b5c..00000000 Binary files a/usermods/EleksTube_IPS/bmp/6.bmp and /dev/null differ diff --git a/usermods/EleksTube_IPS/bmp/7.bmp b/usermods/EleksTube_IPS/bmp/7.bmp deleted file mode 100644 index 83d8e945..00000000 Binary files a/usermods/EleksTube_IPS/bmp/7.bmp and /dev/null differ diff --git a/usermods/EleksTube_IPS/bmp/8.bmp b/usermods/EleksTube_IPS/bmp/8.bmp deleted file mode 100644 index 565980e8..00000000 Binary files a/usermods/EleksTube_IPS/bmp/8.bmp and /dev/null differ diff --git a/usermods/EleksTube_IPS/bmp/9.bmp b/usermods/EleksTube_IPS/bmp/9.bmp deleted file mode 100644 index 88cc3004..00000000 Binary files a/usermods/EleksTube_IPS/bmp/9.bmp and /dev/null differ diff --git a/usermods/EleksTube_IPS/readme.md b/usermods/EleksTube_IPS/readme.md index a510ad6e..a08d69d2 100644 --- a/usermods/EleksTube_IPS/readme.md +++ b/usermods/EleksTube_IPS/readme.md @@ -5,7 +5,7 @@ It enables running all WLED effects on the background SK6812 lighting, while dis Code is largely based on https://github.com/SmittyHalibut/EleksTubeHAX by Mark Smith! Supported: -- Display with custom bitmaps from filesystem +- Display with custom bitmaps or raw RGB565 images (.bin) from filesystem - Background lighting - Power button - RTC (with RTC usermod) @@ -14,8 +14,18 @@ Supported: Not supported: - 3 navigation buttons, on-device setup +Your images must be exactly 135 pixels wide and 1-240 pixels high. + ## Installation Compile and upload to clock using the `elekstube_ips` PlatformIO environment -Once uploaded (the clock can be flashed like any ESP32 module), go to `[WLED-IP]/edit` and upload the 0-9.bmp files from the bmp folder. -Use LED pin 12, relay pin 27 and button pin 34. \ No newline at end of file +Once uploaded (the clock can be flashed like any ESP32 module), go to `[WLED-IP]/edit` and upload the 0-9.bin files from [here](https://github.com/Aircoookie/NixieThemes/tree/master/themes/RealisticNixie/bin). +You can find more clockfaces in the [NixieThemes](https://github.com/Aircoookie/NixieThemes/) repo. +Use LED pin 12, relay pin 27 and button pin 34. + +## Use of RGB565 images + +Binary 16-bit per pixel RGB565 format `.bin` images are now supported. This has the benefit of only using 2/3rds of the file size a `.bmp` has. +The drawback is that this format cannot be handled by common image programs and that an extra conversion step is needed. +You can use https://lvgl.io/tools/imageconverter to convert your .bmp to a .bin file (settings `True color` and `Binary RGB565`) +Thank you to @RedNax67 for adding .bin support. \ No newline at end of file diff --git a/wled00/bus_manager.h b/wled00/bus_manager.h index b461cc53..e8d569db 100644 --- a/wled00/bus_manager.h +++ b/wled00/bus_manager.h @@ -24,7 +24,7 @@ struct BusConfig { colorOrder = pcolorOrder; reversed = rev; skipAmount = skip; uint8_t nPins = 1; if (type > 47) nPins = 2; - else if (type > 41 && type < 46) nPins = NUM_PWM_PINS(type); + else if (type > 40 && type < 46) nPins = NUM_PWM_PINS(type); for (uint8_t i = 0; i < nPins; i++) pins[i] = ppins[i]; } }; diff --git a/wled00/const.h b/wled00/const.h index a199c563..85dbab0e 100644 --- a/wled00/const.h +++ b/wled00/const.h @@ -237,7 +237,11 @@ // string temp buffer (now stored in stack locally) #define OMAX 2048 -#define E131_MAX_UNIVERSE_COUNT 9 +#ifdef WLED_USE_ETHERNET +#define E131_MAX_UNIVERSE_COUNT 20 +#else +#define E131_MAX_UNIVERSE_COUNT 10 +#endif #define ABL_MILLIAMPS_DEFAULT 850 // auto lower brightness to stay close to milliampere limit diff --git a/wled00/set.cpp b/wled00/set.cpp index 73c2d9dc..e2e8e48e 100644 --- a/wled00/set.cpp +++ b/wled00/set.cpp @@ -833,7 +833,7 @@ bool handleSet(AsyncWebServerRequest *request, const String& req, bool apply) pos = req.indexOf(F("NX=")); //sets digits to code if (pos > 0) { - strlcpy(cronixieDisplay, req.substring(pos + 3, pos + 9).c_str(), 6); + strlcpy(cronixieDisplay, req.substring(pos + 3, pos + 9).c_str(), 7); setCronixie(); } diff --git a/wled00/wled.h b/wled00/wled.h index ee230add..adddf9fe 100644 --- a/wled00/wled.h +++ b/wled00/wled.h @@ -8,7 +8,7 @@ */ // version code in format yymmddb (b = daily build) -#define VERSION 2105200 +#define VERSION 2106070 //uncomment this if you have a "my_config.h" file you'd like to use //#define WLED_USE_MY_CONFIG @@ -249,7 +249,12 @@ WLED_GLOBAL byte apBehavior _INIT(AP_BEHAVIOR_BOOT_NO_CONN); // access poi WLED_GLOBAL IPAddress staticIP _INIT_N((( 0, 0, 0, 0))); // static IP of ESP WLED_GLOBAL IPAddress staticGateway _INIT_N((( 0, 0, 0, 0))); // gateway (router) IP WLED_GLOBAL IPAddress staticSubnet _INIT_N(((255, 255, 255, 0))); // most common subnet in home networks -WLED_GLOBAL bool noWifiSleep _INIT(false); // disabling modem sleep modes will increase heat output and power usage, but may help with connection issues +#ifdef ARDUINO_ARCH_ESP32 +WLED_GLOBAL bool noWifiSleep _INIT(true); // disabling modem sleep modes will increase heat output and power usage, but may help with connection issues +#else +WLED_GLOBAL bool noWifiSleep _INIT(false); +#endif + #ifdef WLED_USE_ETHERNET #ifdef WLED_ETH_DEFAULT // default ethernet board type if specified WLED_GLOBAL int ethernetType _INIT(WLED_ETH_DEFAULT); // ethernet board type