From 829e160d418284d20efb414bfd4a9afbc59d77e1 Mon Sep 17 00:00:00 2001 From: brentru Date: Wed, 26 Apr 2023 16:05:13 -0400 Subject: [PATCH 01/90] merge in display driver and FS overhead --- src/Wippersnapper.cpp | 15 +++ src/Wippersnapper.h | 13 +- src/display/ws_display_driver.cpp | 123 ++++++++++++++++++ src/display/ws_display_driver.h | 66 ++++++++++ src/provisioning/tinyusb/Wippersnapper_FS.cpp | 74 +++++++++++ src/provisioning/tinyusb/Wippersnapper_FS.h | 4 + 6 files changed, 291 insertions(+), 4 deletions(-) create mode 100644 src/display/ws_display_driver.cpp create mode 100644 src/display/ws_display_driver.h diff --git a/src/Wippersnapper.cpp b/src/Wippersnapper.cpp index 02c4a78e1..ef1b8b74e 100644 --- a/src/Wippersnapper.cpp +++ b/src/Wippersnapper.cpp @@ -106,6 +106,21 @@ void Wippersnapper::provision() { set_user_key(); // non-fs-backed, sets global credentials within network iface #endif + // TODO: Move parseSecrets() out to here so we can error check and correct + + // TODO: Implement parseDisplayConfig() in the filesystem class + displayConfig config = WS._fileSystem->parseDisplayConfig(); + // TODO: Need error boundary checks and signaling around + // display initialization if it doesnt exist! + WS._display = new ws_display_driver(config); + + if (!WS._display->begin()) + WS_DEBUG_PRINTLN( + "Unable to enable display driver and LVGL"); // TODO: Maybe fail out and + // revert to non-display? + // Where do we log this? + WS._display->enableLogging(); + set_ssid_pass(); } diff --git a/src/Wippersnapper.h b/src/Wippersnapper.h index cb6607116..b3dd24882 100644 --- a/src/Wippersnapper.h +++ b/src/Wippersnapper.h @@ -34,6 +34,9 @@ #include "Wippersnapper_Boards.h" #include "components/statusLED/Wippersnapper_StatusLED.h" +// Display +#include "display/ws_display_driver.h" + // Wippersnapper components #include "components/analogIO/Wippersnapper_AnalogIO.h" #include "components/digitalIO/Wippersnapper_DigitalGPIO.h" @@ -192,6 +195,7 @@ class Wippersnapper_DigitalGPIO; class Wippersnapper_AnalogIO; class Wippersnapper_FS; class WipperSnapper_LittleFS; +class ws_display_driver; class WipperSnapper_Component_I2C; #ifdef ARDUINO_ARCH_ESP32 class ws_ledc; @@ -309,10 +313,11 @@ class Wippersnapper { Wippersnapper_FS *_fileSystem; ///< Instance of Filesystem (native USB) WipperSnapper_LittleFS *_littleFS; ///< Instance of LittleFS Filesystem (non-native USB) - ws_pixels *_ws_pixelsComponent; ///< ptr to instance of ws_pixels class - ws_pwm *_pwmComponent; ///< Instance of pwm class - ws_servo *_servoComponent; ///< Instance of servo class - ws_ds18x20 *_ds18x20Component; ///< Instance of DS18x20 class + ws_display_driver *_display = nullptr; ///< Instance of display driver class + ws_pixels *_ws_pixelsComponent; ///< ptr to instance of ws_pixels class + ws_pwm *_pwmComponent; ///< Instance of pwm class + ws_servo *_servoComponent; ///< Instance of servo class + ws_ds18x20 *_ds18x20Component; ///< Instance of DS18x20 class uint8_t _macAddr[6]; /*!< Unique network iface identifier */ char sUID[13]; /*!< Unique network iface identifier */ diff --git a/src/display/ws_display_driver.cpp b/src/display/ws_display_driver.cpp new file mode 100644 index 000000000..f4d4ca6c8 --- /dev/null +++ b/src/display/ws_display_driver.cpp @@ -0,0 +1,123 @@ +/*! + * @file ws_display_driver.cpp + * + * Wippersnapper LVGL Display Driver + * + * Adafruit invests time and resources providing this open source code, + * please support Adafruit and open-source hardware by purchasing + * products from Adafruit! + * + * Copyright (c) Brent Rubell 2023 for Adafruit Industries. + * + * BSD license, all text here must be included in any redistribution. + * + */ +#include "ws_display_driver.h" + +/**************************************************************************/ +/*! + @brief Callback for LVGL logging through USB serial + @param buf + Data to write out to serial. +*/ +/**************************************************************************/ +static void my_log_cb(const char *buf) { Serial.printf(buf); } + +/**************************************************************************/ +/*! + @brief Creates a new WipperSnapper display driver object from a + configuration struct. + @param config + Configuration struct., from FS.parseDisplayConfig(); +*/ +/**************************************************************************/ +ws_display_driver::ws_display_driver(displayConfig config) { + // let's dynamically create the display driver from the configuration file + if (strcmp(config.driver, "ST7789") == 0) { + Serial.println("Configuring the Adafruit_ST7789 driver"); + _tft_st7789 = + new Adafruit_ST7789(config.pinCS, config.pinDC, config.pinRST); + } else { + Serial.println("ERROR: Display driver type not implemented!"); + } + + setResolution(config.width, config.height); + setRotation(config.rotation); +} + +/**************************************************************************/ +/*! + @brief Deletes a new WipperSnapper display driver object. +*/ +/**************************************************************************/ +ws_display_driver::~ws_display_driver() { + if (_tft_st7789 != nullptr) { + delete _tft_st7789; + } +} + +/**************************************************************************/ +/*! + @brief Sets the display resolution, must be called BEFORE begin()! + @param displayWidth + The width of the display, in pixels. + @param displayHeight + The height of the display, in pixels. +*/ +/**************************************************************************/ +void ws_display_driver::setResolution(uint16_t displayWidth, + uint16_t displayHeight) { + _displayWidth = displayWidth; + _displayHeight = displayHeight; +} + +/**************************************************************************/ +/*! + @brief Enables LVGL logging using the usb serial. Must be called + AFTER calling Serial.begin(). +*/ +/**************************************************************************/ +void ws_display_driver::enableLogging() { lv_log_register_print_cb(my_log_cb); } + +/**************************************************************************/ +/*! + @brief Sets the display's rotation mode. + @param rotationMode + The index for rotation (0-3 inclusive). +*/ +/**************************************************************************/ +void ws_display_driver::setRotation(uint8_t rotationMode) { + _displayRotationMode = rotationMode; +} + +/**************************************************************************/ +/*! + @brief Initializes the display and the lvgl_glue driver. + @returns True if LVGL_Glue began successfully, False otherwise. +*/ +/**************************************************************************/ +bool ws_display_driver::begin() { + LvGLStatus status; + // initialize display driver and lvgl_glue + if (_tft_st7789 != nullptr) { + _tft_st7789->init(_displayWidth, _displayHeight); + status = _glue.begin(_tft_st7789); + } else { + Serial.println("ERROR: Unable to initialize the display driver!"); + return false; + } + + // check if lvgl initialized correctly + if (status != LVGL_OK) { + Serial.printf("LVGL_Glue error %d\r\n", (int)status); + return false; + } + +// Hardware-specific display commands +#ifdef ARDUINO_FUNHOUSE_ESP32S2 + pinMode(TFT_BACKLIGHT, OUTPUT); + digitalWrite(TFT_BACKLIGHT, HIGH); +#endif // ARDUINO_FUNHOUSE_ESP32S2 + + return true; +} \ No newline at end of file diff --git a/src/display/ws_display_driver.h b/src/display/ws_display_driver.h new file mode 100644 index 000000000..602335261 --- /dev/null +++ b/src/display/ws_display_driver.h @@ -0,0 +1,66 @@ +/*! + * @file ws_display_driver.h + * + * Wippersnapper display driver + * + * Adafruit invests time and resources providing this open source code, + * please support Adafruit and open-source hardware by purchasing + * products from Adafruit! + * + * Copyright (c) Brent Rubell 2023 for Adafruit Industries. + * + * BSD license, all text here must be included in any redistribution. + * + */ +#ifndef WIPPERSNAPPER_DISPLAY_H +#define WIPPERSNAPPER_DISPLAY_H + +#include "Wippersnapper.h" + +#include // Always include this BEFORE lvgl.h! +#include +// #include +#include + +struct displayConfig { + char driver[10]; + int width; + int height; + int rotation; + bool isSPI; + bool isI2C; + uint8_t pinCS; + uint8_t pinDC; + uint8_t pinMOSI; + uint8_t pinSCK; + uint8_t pinRST; +}; + +class Wippersnapper; // friend class + +/***************************************************************************/ +/*! + @brief Display driver for LVGL and LVGL_Glue in WipperSnapper. +*/ +/***************************************************************************/ +class ws_display_driver { +public: + ws_display_driver(){}; + ws_display_driver(displayConfig config); + ~ws_display_driver(); + + bool begin(); + void setResolution(uint16_t displayWidth, uint16_t displayHeight); + void setRotation(uint8_t rotationMode); + void enableLogging(); + +private: + Adafruit_LvGL_Glue _glue; + Adafruit_ST7789 *_tft_st7789 = nullptr; + uint16_t _displayWidth; + uint16_t _displayHeight; + uint8_t _displayRotationMode; +}; +extern Wippersnapper WS; + +#endif // WIPPERSNAPPER_DISPLAY_H \ No newline at end of file diff --git a/src/provisioning/tinyusb/Wippersnapper_FS.cpp b/src/provisioning/tinyusb/Wippersnapper_FS.cpp index d699574ea..a835dd90a 100644 --- a/src/provisioning/tinyusb/Wippersnapper_FS.cpp +++ b/src/provisioning/tinyusb/Wippersnapper_FS.cpp @@ -479,6 +479,80 @@ void Wippersnapper_FS::fsHalt() { } } +void Wippersnapper_FS::createDisplayConfig() { + StaticJsonDocument<256> doc; + +#ifdef ARDUINO_FUNHOUSE_ESP32S2 + doc["driver"] = "ST7789"; + doc["width"] = 240; + doc["height"] = 240; + doc["rotation"] = 0; + doc["powerMode"] = 0; + JsonObject spi = doc.createNestedObject("spi"); + spi["spiMode"] = 1; + spi["pinCs"] = 40; + spi["pinDc"] = 39; + spi["pinMosi"] = 0; + spi["pinSck"] = 0; + spi["pinRst"] = 41; +#endif + + // Write the file out + File32 displayFile = wipperFatFs.open("/display_config.json", FILE_WRITE); + serializeJsonPretty(doc, displayFile); + displayFile.flush(); + displayFile.close(); + delay(2500); +} + +displayConfig Wippersnapper_FS::parseDisplayConfig() { + StaticJsonDocument<384> doc; + DeserializationError error; + + if (!wipperFatFs.exists("/display_config.json")) { + WS_DEBUG_PRINTLN("Could not find display_config.json, generating..."); + createDisplayConfig(); + } + + File32 file = wipperFatFs.open("/display_config.json", FILE_READ); + if (file) { + error = deserializeJson(doc, file); + file.close(); + } else { + WS_DEBUG_PRINTLN( + "FATAL ERROR: Unable to open display_config.json for parsing"); + while (1) + yield(); + } + + // let's parse the deserialized array into a displayConfig struct! + displayConfig displayFile; + // generic fields + strcpy(displayFile.driver, doc["driver"]); + displayFile.height = doc["height"]; + displayFile.width = doc["width"]; + displayFile.rotation = doc["rotation"]; + + // display driver uses SPI, copy all the fields from the json array + if (doc["spi"] != nullptr) { + displayFile.isSPI = true; + displayFile.pinCS = doc["spi"]["pinCs"]; + displayFile.pinDC = doc["spi"]["pinDc"]; + displayFile.pinMOSI = doc["spi"]["pinMosi"]; + displayFile.pinSCK = doc["spi"]["pinSck"]; + displayFile.pinRST = doc["spi"]["pinRst"]; + } else if (doc["i2c"] != nullptr) { + WS_DEBUG_PRINTLN("I2C display drivers are not implemented yet!"); + // TODO: Halt? + } else { + WS_DEBUG_PRINTLN( + "ERROR: Display device lacks a hardware interface, failing out..."); + // TODO: Halt? + } + + return displayFile; +} + /**************************************************************************/ /*! @brief Callback invoked when received READ10 command. Copies disk's diff --git a/src/provisioning/tinyusb/Wippersnapper_FS.h b/src/provisioning/tinyusb/Wippersnapper_FS.h index 193627817..373dcbbb8 100644 --- a/src/provisioning/tinyusb/Wippersnapper_FS.h +++ b/src/provisioning/tinyusb/Wippersnapper_FS.h @@ -27,6 +27,7 @@ // forward decl. class Wippersnapper; +struct displayConfig; // global TinyUSB callbacks int32_t qspi_msc_write_cb(uint32_t lba, uint8_t *buffer, uint32_t bufsize); @@ -58,6 +59,9 @@ class Wippersnapper_FS { void parseSecrets(); + displayConfig parseDisplayConfig(); + void createDisplayConfig(); + // NOTE: calculated capacity with maximum // length of usernames/passwords/tokens // is 382 bytes, rounded to nearest power of 2. From 9819ebe6b3ddf7afb8b0324bb9f6bfd93a2044d0 Mon Sep 17 00:00:00 2001 From: brentru Date: Wed, 26 Apr 2023 16:26:18 -0400 Subject: [PATCH 02/90] refactor provision --- src/Wippersnapper.cpp | 26 ++++++++++++------- src/provisioning/tinyusb/Wippersnapper_FS.cpp | 2 +- src/provisioning/tinyusb/Wippersnapper_FS.h | 2 +- 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/src/Wippersnapper.cpp b/src/Wippersnapper.cpp index ef1b8b74e..7f668cc1e 100644 --- a/src/Wippersnapper.cpp +++ b/src/Wippersnapper.cpp @@ -91,29 +91,25 @@ Wippersnapper::~Wippersnapper() { */ /**************************************************************************/ void Wippersnapper::provision() { - // Get MAC address from network interface + // Get MAC address from the network interface getMacAddr(); - // init. LED for status signaling + // Initialize the status LED initStatusLED(); + +// Initialize the filesystem #ifdef USE_TINYUSB _fileSystem = new Wippersnapper_FS(); - _fileSystem->parseSecrets(); #elif defined(USE_LITTLEFS) _littleFS = new WipperSnapper_LittleFS(); - _littleFS->parseSecrets(); -#else - set_user_key(); // non-fs-backed, sets global credentials within network iface #endif - // TODO: Move parseSecrets() out to here so we can error check and correct - - // TODO: Implement parseDisplayConfig() in the filesystem class + // Initialize the display displayConfig config = WS._fileSystem->parseDisplayConfig(); // TODO: Need error boundary checks and signaling around // display initialization if it doesnt exist! WS._display = new ws_display_driver(config); - + // Begin display if (!WS._display->begin()) WS_DEBUG_PRINTLN( "Unable to enable display driver and LVGL"); // TODO: Maybe fail out and @@ -121,6 +117,16 @@ void Wippersnapper::provision() { // Where do we log this? WS._display->enableLogging(); +// TODO: Add display error modes within parseSecrets() +#ifdef USE_TINYUSB + _fileSystem->parseSecrets(); +#elif defined(USE_LITTLEFS) + _littleFS->parseSecrets(); +#else + set_user_key(); // non-fs-backed, sets global credentials within network iface +#endif + + // Set device's wireless credentials set_ssid_pass(); } diff --git a/src/provisioning/tinyusb/Wippersnapper_FS.cpp b/src/provisioning/tinyusb/Wippersnapper_FS.cpp index a835dd90a..67fdfa9d7 100644 --- a/src/provisioning/tinyusb/Wippersnapper_FS.cpp +++ b/src/provisioning/tinyusb/Wippersnapper_FS.cpp @@ -7,7 +7,7 @@ * please support Adafruit and open-source hardware by purchasing * products from Adafruit! * - * Copyright (c) Brent Rubell 2022 for Adafruit Industries. + * Copyright (c) Brent Rubell 2023 for Adafruit Industries. * * BSD license, all text here must be included in any redistribution. * diff --git a/src/provisioning/tinyusb/Wippersnapper_FS.h b/src/provisioning/tinyusb/Wippersnapper_FS.h index 373dcbbb8..ec7067525 100644 --- a/src/provisioning/tinyusb/Wippersnapper_FS.h +++ b/src/provisioning/tinyusb/Wippersnapper_FS.h @@ -7,7 +7,7 @@ * please support Adafruit and open-source hardware by purchasing * products from Adafruit! * - * Copyright (c) Brent Rubell 2021 for Adafruit Industries. + * Copyright (c) Brent Rubell 2021-2023 for Adafruit Industries. * * BSD license, all text here must be included in any redistribution. * From df4453e93f00d9336628850c6ccb8051cf4dda83 Mon Sep 17 00:00:00 2001 From: brentru Date: Wed, 26 Apr 2023 17:19:15 -0400 Subject: [PATCH 03/90] init work --- src/Wippersnapper.cpp | 18 ++++++++++++++-- src/display/ws_display_driver.cpp | 36 +++++++++++++++++++++---------- src/display/ws_display_driver.h | 2 +- 3 files changed, 42 insertions(+), 14 deletions(-) diff --git a/src/Wippersnapper.cpp b/src/Wippersnapper.cpp index 7f668cc1e..ef80cc33a 100644 --- a/src/Wippersnapper.cpp +++ b/src/Wippersnapper.cpp @@ -104,7 +104,7 @@ void Wippersnapper::provision() { _littleFS = new WipperSnapper_LittleFS(); #endif - // Initialize the display +/* // Initialize the display displayConfig config = WS._fileSystem->parseDisplayConfig(); // TODO: Need error boundary checks and signaling around // display initialization if it doesnt exist! @@ -115,7 +115,7 @@ void Wippersnapper::provision() { "Unable to enable display driver and LVGL"); // TODO: Maybe fail out and // revert to non-display? // Where do we log this? - WS._display->enableLogging(); + WS._display->enableLogging(); */ // TODO: Add display error modes within parseSecrets() #ifdef USE_TINYUSB @@ -2299,6 +2299,20 @@ void printDeviceInfo() { void Wippersnapper::connect() { WS_DEBUG_PRINTLN("Adafruit.io WipperSnapper"); + // Initialize the display + displayConfig config = WS._fileSystem->parseDisplayConfig(); + // TODO: Need error boundary checks and signaling around + // display initialization if it doesnt exist! + WS._display = new ws_display_driver(config); + // Begin display + if (!WS._display->begin()) + WS_DEBUG_PRINTLN( + "Unable to enable display driver and LVGL"); // TODO: Maybe fail out and + // revert to non-display? + // Where do we log this? + WS._display->enableLogging(); + // lv_obj_set_style_bg_color(lv_scr_act(), lv_color_black(), LV_STATE_DEFAULT); + // Dump device info to the serial monitor printDeviceInfo(); diff --git a/src/display/ws_display_driver.cpp b/src/display/ws_display_driver.cpp index f4d4ca6c8..ca75fc912 100644 --- a/src/display/ws_display_driver.cpp +++ b/src/display/ws_display_driver.cpp @@ -32,11 +32,18 @@ static void my_log_cb(const char *buf) { Serial.printf(buf); } */ /**************************************************************************/ ws_display_driver::ws_display_driver(displayConfig config) { + WS_DEBUG_PRINT("Display Configuration: \n"); + WS_DEBUG_PRINTLN(config.pinCS); + WS_DEBUG_PRINTLN(config.pinDC); + WS_DEBUG_PRINTLN(config.pinRST); + WS_DEBUG_PRINTLN(config.width); + WS_DEBUG_PRINTLN(config.height); + // let's dynamically create the display driver from the configuration file if (strcmp(config.driver, "ST7789") == 0) { Serial.println("Configuring the Adafruit_ST7789 driver"); _tft_st7789 = - new Adafruit_ST7789(config.pinCS, config.pinDC, config.pinRST); + new Adafruit_ST7789(TFT_CS, TFT_DC, TFT_RESET); } else { Serial.println("ERROR: Display driver type not implemented!"); } @@ -97,27 +104,34 @@ void ws_display_driver::setRotation(uint8_t rotationMode) { */ /**************************************************************************/ bool ws_display_driver::begin() { - LvGLStatus status; - // initialize display driver and lvgl_glue + +// Hardware-specific display commands +#ifdef ARDUINO_FUNHOUSE_ESP32S2 + pinMode(TFT_BACKLIGHT, OUTPUT); + digitalWrite(TFT_BACKLIGHT, HIGH); +#endif // ARDUINO_FUNHOUSE_ESP32S2 + + // initialize display driver if (_tft_st7789 != nullptr) { - _tft_st7789->init(_displayWidth, _displayHeight); - status = _glue.begin(_tft_st7789); + WS_DEBUG_PRINTLN("INIT st7789 tft"); + //_tft_st7789->init(240, 240); } else { Serial.println("ERROR: Unable to initialize the display driver!"); return false; } + // initialize LVGL_glue +/* WS_DEBUG_PRINTLN("INIT lvgl_glue"); + LvGLStatus status = _glue.begin(_tft_st7789); + WS_DEBUG_PRINT("LVGL GLUE STATUS: "); + WS_DEBUG_PRINTLN((int) status); + // check if lvgl initialized correctly if (status != LVGL_OK) { Serial.printf("LVGL_Glue error %d\r\n", (int)status); return false; - } + } */ -// Hardware-specific display commands -#ifdef ARDUINO_FUNHOUSE_ESP32S2 - pinMode(TFT_BACKLIGHT, OUTPUT); - digitalWrite(TFT_BACKLIGHT, HIGH); -#endif // ARDUINO_FUNHOUSE_ESP32S2 return true; } \ No newline at end of file diff --git a/src/display/ws_display_driver.h b/src/display/ws_display_driver.h index 602335261..f8df3722b 100644 --- a/src/display/ws_display_driver.h +++ b/src/display/ws_display_driver.h @@ -55,7 +55,7 @@ class ws_display_driver { void enableLogging(); private: - Adafruit_LvGL_Glue _glue; + Adafruit_LvGL_Glue *_glue; Adafruit_ST7789 *_tft_st7789 = nullptr; uint16_t _displayWidth; uint16_t _displayHeight; From a6b267eedcdac2db676b683c8c96e2b9c8eb78cf Mon Sep 17 00:00:00 2001 From: brentru Date: Wed, 26 Apr 2023 17:26:57 -0400 Subject: [PATCH 04/90] try init backlight after tft --- src/Wippersnapper.cpp | 1 - src/display/ws_display_driver.cpp | 24 ++++++++++++++---------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/src/Wippersnapper.cpp b/src/Wippersnapper.cpp index ef80cc33a..7f2d6eb2e 100644 --- a/src/Wippersnapper.cpp +++ b/src/Wippersnapper.cpp @@ -2311,7 +2311,6 @@ void Wippersnapper::connect() { // revert to non-display? // Where do we log this? WS._display->enableLogging(); - // lv_obj_set_style_bg_color(lv_scr_act(), lv_color_black(), LV_STATE_DEFAULT); // Dump device info to the serial monitor printDeviceInfo(); diff --git a/src/display/ws_display_driver.cpp b/src/display/ws_display_driver.cpp index ca75fc912..29e1f40a3 100644 --- a/src/display/ws_display_driver.cpp +++ b/src/display/ws_display_driver.cpp @@ -105,23 +105,26 @@ void ws_display_driver::setRotation(uint8_t rotationMode) { /**************************************************************************/ bool ws_display_driver::begin() { -// Hardware-specific display commands -#ifdef ARDUINO_FUNHOUSE_ESP32S2 - pinMode(TFT_BACKLIGHT, OUTPUT); - digitalWrite(TFT_BACKLIGHT, HIGH); -#endif // ARDUINO_FUNHOUSE_ESP32S2 - // initialize display driver if (_tft_st7789 != nullptr) { WS_DEBUG_PRINTLN("INIT st7789 tft"); - //_tft_st7789->init(240, 240); + _tft_st7789->init(240, 240); } else { Serial.println("ERROR: Unable to initialize the display driver!"); return false; } + // Hardware-specific display commands + #ifdef ARDUINO_FUNHOUSE_ESP32S2 + pinMode(TFT_BACKLIGHT, OUTPUT); + digitalWrite(TFT_BACKLIGHT, HIGH); + #endif // ARDUINO_FUNHOUSE_ESP32S2 + + //WS_DEBUG_PRINTLN("Fill screen"); + //_tft_st7789->fillScreen(ST77XX_BLACK); + // initialize LVGL_glue -/* WS_DEBUG_PRINTLN("INIT lvgl_glue"); + WS_DEBUG_PRINTLN("INIT lvgl_glue"); LvGLStatus status = _glue.begin(_tft_st7789); WS_DEBUG_PRINT("LVGL GLUE STATUS: "); WS_DEBUG_PRINTLN((int) status); @@ -130,8 +133,9 @@ bool ws_display_driver::begin() { if (status != LVGL_OK) { Serial.printf("LVGL_Glue error %d\r\n", (int)status); return false; - } */ - + } + WS_DEBUG_PRINTLN("Setting screen BLACK"); + lv_obj_set_style_bg_color(lv_scr_act(), lv_color_black(), LV_STATE_DEFAULT); return true; } \ No newline at end of file From d35485633c5f8492b2279316b06b270d3f643e26 Mon Sep 17 00:00:00 2001 From: brentru Date: Wed, 26 Apr 2023 17:50:06 -0400 Subject: [PATCH 05/90] init differently --- src/display/ws_display_driver.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/display/ws_display_driver.cpp b/src/display/ws_display_driver.cpp index 29e1f40a3..2b5b9c757 100644 --- a/src/display/ws_display_driver.cpp +++ b/src/display/ws_display_driver.cpp @@ -21,7 +21,7 @@ Data to write out to serial. */ /**************************************************************************/ -static void my_log_cb(const char *buf) { Serial.printf(buf); } +static void my_log_cb(const char *buf) { WS_DEBUG_PRINTLN(buf); } /**************************************************************************/ /*! @@ -43,7 +43,7 @@ ws_display_driver::ws_display_driver(displayConfig config) { if (strcmp(config.driver, "ST7789") == 0) { Serial.println("Configuring the Adafruit_ST7789 driver"); _tft_st7789 = - new Adafruit_ST7789(TFT_CS, TFT_DC, TFT_RESET); + new Adafruit_ST7789(config.pinCS, config.pinDC, config.pinRST); } else { Serial.println("ERROR: Display driver type not implemented!"); } @@ -105,10 +105,12 @@ void ws_display_driver::setRotation(uint8_t rotationMode) { /**************************************************************************/ bool ws_display_driver::begin() { + // TODO: This function could use some cleanup around how it inits glue + // initialize display driver if (_tft_st7789 != nullptr) { WS_DEBUG_PRINTLN("INIT st7789 tft"); - _tft_st7789->init(240, 240); + _tft_st7789->init(_displayWidth, _displayHeight); } else { Serial.println("ERROR: Unable to initialize the display driver!"); return false; @@ -125,7 +127,8 @@ bool ws_display_driver::begin() { // initialize LVGL_glue WS_DEBUG_PRINTLN("INIT lvgl_glue"); - LvGLStatus status = _glue.begin(_tft_st7789); + _glue = new Adafruit_LvGL_Glue(); + LvGLStatus status = _glue->begin(_tft_st7789); WS_DEBUG_PRINT("LVGL GLUE STATUS: "); WS_DEBUG_PRINTLN((int) status); @@ -135,7 +138,8 @@ bool ws_display_driver::begin() { return false; } WS_DEBUG_PRINTLN("Setting screen BLACK"); - lv_obj_set_style_bg_color(lv_scr_act(), lv_color_black(), LV_STATE_DEFAULT); + lv_obj_set_style_bg_color(lv_scr_act(), lv_color_white(), LV_STATE_DEFAULT); + lv_task_handler(); return true; } \ No newline at end of file From 991efc9d0df963255c38d3206024bb68a61a18c8 Mon Sep 17 00:00:00 2001 From: brentru Date: Thu, 27 Apr 2023 13:54:47 -0400 Subject: [PATCH 06/90] add fonts/symbols and tooltips --- src/display/symbols/cloud_30px.c | 173 +++++++ src/display/symbols/errorTriangle.c | 676 ++++++++++++++++++++++++++++ src/display/symbols/file.c | 153 +++++++ src/display/symbols/turtle_30px.c | 166 +++++++ src/display/symbols/wifi_30px.c | 174 +++++++ src/display/ws_display_tooltips.h | 23 + 6 files changed, 1365 insertions(+) create mode 100644 src/display/symbols/cloud_30px.c create mode 100644 src/display/symbols/errorTriangle.c create mode 100644 src/display/symbols/file.c create mode 100644 src/display/symbols/turtle_30px.c create mode 100644 src/display/symbols/wifi_30px.c create mode 100644 src/display/ws_display_tooltips.h diff --git a/src/display/symbols/cloud_30px.c b/src/display/symbols/cloud_30px.c new file mode 100644 index 000000000..2341772bd --- /dev/null +++ b/src/display/symbols/cloud_30px.c @@ -0,0 +1,173 @@ +/******************************************************************************* + * Size: 30 px + * Bpp: 4 + * Opts: + ******************************************************************************/ + +#ifdef LV_LVGL_H_INCLUDE_SIMPLE +#include "lvgl.h" +#else +#include +#endif + +#ifndef CLOUD_30PX +#define CLOUD_30PX 1 +#endif + +#if CLOUD_30PX + +/*----------------- + * BITMAPS + *----------------*/ + +/*Store the image of the glyphs*/ +static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = { + /* U+F0C2 "" */ + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3, 0x67, + 0x63, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x19, 0xef, 0xff, 0xff, 0xe9, 0x10, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x5, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xf6, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x6f, 0xff, 0xfa, + 0x75, 0x7a, 0xff, 0xff, 0x73, 0x8a, 0x96, 0x10, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x4, + 0xff, 0xfc, 0x20, 0x0, 0x0, 0x1c, 0xff, 0xff, + 0xff, 0xff, 0xf7, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0xe, 0xff, 0x90, 0x0, 0x0, 0x0, + 0x0, 0x8f, 0xff, 0xff, 0xff, 0xff, 0xb0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x6f, 0xfd, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x9, 0xfc, 0x73, 0x49, + 0xff, 0xf7, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0xcf, 0xf3, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x30, 0x0, 0x0, 0x4f, 0xff, 0x20, 0x0, 0x0, + 0x0, 0x0, 0x0, 0xff, 0xd0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x8, 0xff, + 0x80, 0x0, 0x0, 0x0, 0x0, 0x2, 0xff, 0xa0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0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0, 0x5f, 0xf8, 0xbf, 0xf4, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x9f, 0xf6, 0x6f, + 0xfd, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, + 0xff, 0xf1, 0xe, 0xff, 0x90, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x1b, 0xff, 0x90, 0x4, 0xff, 0xfd, + 0x52, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x15, 0xef, 0xfe, 0x0, + 0x0, 0x6f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xe3, 0x0, 0x0, 0x4, 0xdf, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xfb, 0x10, 0x0, 0x0, 0x0, + 0x4, 0x9c, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, + 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xc9, 0x40, 0x0, + 0x0 +}; + + +/*--------------------- + * GLYPH DESCRIPTION + *--------------------*/ + +static const lv_font_fmt_txt_glyph_dsc_t glyph_dsc[] = { + {.bitmap_index = 0, .adv_w = 0, .box_w = 0, .box_h = 0, .ofs_x = 0, .ofs_y = 0} /* id = 0 reserved */, + {.bitmap_index = 0, .adv_w = 600, .box_w = 38, .box_h = 27, .ofs_x = 0, .ofs_y = -2} +}; + +/*--------------------- + * CHARACTER MAPPING + *--------------------*/ + + + +/*Collect the unicode lists and glyph_id offsets*/ +static const lv_font_fmt_txt_cmap_t cmaps[] = +{ + { + .range_start = 61634, .range_length = 1, .glyph_id_start = 1, + .unicode_list = NULL, .glyph_id_ofs_list = NULL, .list_length = 0, .type = LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY + } +}; + + + +/*-------------------- + * ALL CUSTOM DATA + *--------------------*/ + +#if LV_VERSION_CHECK(8, 0, 0) +/*Store all the custom data of the font*/ +static lv_font_fmt_txt_glyph_cache_t cache; +static const lv_font_fmt_txt_dsc_t font_dsc = { +#else +static lv_font_fmt_txt_dsc_t font_dsc = { +#endif + .glyph_bitmap = glyph_bitmap, + .glyph_dsc = glyph_dsc, + .cmaps = cmaps, + .kern_dsc = NULL, + .kern_scale = 0, + .cmap_num = 1, + .bpp = 4, + .kern_classes = 0, + .bitmap_format = 0, +#if LV_VERSION_CHECK(8, 0, 0) + .cache = &cache +#endif +}; + + +/*----------------- + * PUBLIC FONT + *----------------*/ + +/*Initialize a public general font descriptor*/ +#if LV_VERSION_CHECK(8, 0, 0) +const lv_font_t cloud_30px = { +#else +lv_font_t cloud_30px = { +#endif + .get_glyph_dsc = lv_font_get_glyph_dsc_fmt_txt, /*Function pointer to get glyph's data*/ + .get_glyph_bitmap = lv_font_get_bitmap_fmt_txt, /*Function pointer to get glyph's bitmap*/ + .line_height = 27, /*The maximum line height required by the font*/ + .base_line = 2, /*Baseline measured from the bottom of the line*/ +#if !(LVGL_VERSION_MAJOR == 6 && LVGL_VERSION_MINOR == 0) + .subpx = LV_FONT_SUBPX_NONE, +#endif +#if LV_VERSION_CHECK(7, 4, 0) || LVGL_VERSION_MAJOR >= 8 + .underline_position = 0, + .underline_thickness = 0, +#endif + .dsc = &font_dsc /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */ +}; + + + +#endif /*#if CLOUD_30PX*/ + diff --git a/src/display/symbols/errorTriangle.c b/src/display/symbols/errorTriangle.c new file mode 100644 index 000000000..a0bdd0c46 --- /dev/null +++ b/src/display/symbols/errorTriangle.c @@ -0,0 +1,676 @@ +/******************************************************************************* + * Size: 100 px + * Bpp: 4 + * Opts: + ******************************************************************************/ + +#ifdef LV_LVGL_H_INCLUDE_SIMPLE +#include "lvgl.h" +#else +#include +#endif + +#ifndef ERRORTRIANGLE +#define ERRORTRIANGLE 1 +#endif + +#if ERRORTRIANGLE + +/*----------------- + * BITMAPS + *----------------*/ + +/*Store the image of the glyphs*/ +static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = { + /* U+F071 "" */ + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x11, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x4, 0xbf, 0xff, 0xea, 0x30, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0xaf, 0xff, 0xff, + 0xff, 0xf8, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0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, 0x5f, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0x50, 0x0, 0x0, + 0x0, 0x5, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xf2, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xef, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0x50, 0x0, 0x0, 0x0, 0x5, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfb, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x50, 0x0, 0x0, 0x0, 0x5, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0x50, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x2f, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x50, 0x0, + 0x0, 0x0, 0x5, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xbf, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0x50, 0x0, 0x0, 0x0, 0x5, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xf8, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x4, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0x50, 0x0, 0x0, 0x0, + 0x5, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0x20, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0xd, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x50, + 0x0, 0x0, 0x0, 0x5, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xb0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x7f, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0x50, 0x0, 0x0, 0x0, 0x5, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xf4, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x1, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0x50, 0x0, 0x0, + 0x0, 0x5, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xfd, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0xa, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0x50, 0x0, 0x0, 0x0, 0x5, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0x70, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3f, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x50, 0x0, 0x0, 0x0, 0x5, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xf1, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0xdf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x50, 0x0, + 0x0, 0x0, 0x5, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfa, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x6, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0x50, 0x0, 0x0, 0x0, 0x5, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x30, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1e, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0x50, 0x0, 0x0, 0x0, + 0x5, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x9f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x50, + 0x0, 0x0, 0x0, 0x5, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xf6, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x3, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0x50, 0x0, 0x0, 0x0, 0x5, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xfe, 0x10, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0x50, 0x0, 0x0, + 0x0, 0x5, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0x90, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x5f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0x50, 0x0, 0x0, 0x0, 0x5, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xf2, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0xef, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x50, 0x0, 0x0, 0x0, 0x5, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x8, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0x0, + 0x0, 0x0, 0x8, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0x50, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x2f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xd0, 0x0, 0x0, 0x0, 0xd, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0xbf, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xf8, 0x0, 0x0, 0x0, + 0x9f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xf8, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x4, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xb4, 0x11, 0x4c, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0x20, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0xd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xb0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x7f, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xf4, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xfd, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0xa, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0x70, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x4f, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xf1, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xdf, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfa, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x6, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xc7, 0x44, 0x7d, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x30, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x1f, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf7, + 0x0, 0x0, 0x0, 0x8f, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xd0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x9f, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0x40, 0x0, 0x0, 0x0, 0x5, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xf6, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x3, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xf9, 0x0, 0x0, 0x0, + 0x0, 0x0, 0xaf, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xfe, 0x10, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0xc, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf2, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x1f, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0x90, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x6f, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xe0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0xd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xf3, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0xef, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0xc, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x8, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xf0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xe, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0x50, 0x0, 0x0, 0x0, 0x0, 0x2f, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xf2, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x2f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x0, 0x0, + 0x0, 0x0, 0xbf, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfa, 0x0, + 0x0, 0x0, 0x0, 0x0, 0xbf, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xf8, 0x0, 0x0, 0x0, 0x5, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0x60, 0x0, 0x0, 0x0, 0x7, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0x20, 0x0, 0x0, 0xe, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xf9, 0x0, 0x0, + 0x1, 0xaf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xb0, + 0x0, 0x0, 0x8f, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xfb, 0x88, 0xbf, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xf4, 0x0, 0x1, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xfd, 0x0, 0x7, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0x40, 0xc, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0x90, 0xf, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc0, + 0xf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xd0, 0xe, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xb0, 0xb, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0x80, 0x4, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x10, 0x0, 0xcf, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xf9, 0x0, 0x0, + 0x1e, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xc0, 0x0, 0x0, 0x1, 0xcf, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xfa, 0x0, 0x0, 0x0, 0x0, 0x5, + 0xbe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xea, 0x40, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0 +}; + + +/*--------------------- + * GLYPH DESCRIPTION + *--------------------*/ + +static const lv_font_fmt_txt_glyph_dsc_t glyph_dsc[] = { + {.bitmap_index = 0, .adv_w = 0, .box_w = 0, .box_h = 0, .ofs_x = 0, .ofs_y = 0} /* id = 0 reserved */, + {.bitmap_index = 0, .adv_w = 1600, .box_w = 102, .box_h = 89, .ofs_x = -1, .ofs_y = -7} +}; + +/*--------------------- + * CHARACTER MAPPING + *--------------------*/ + + + +/*Collect the unicode lists and glyph_id offsets*/ +static const lv_font_fmt_txt_cmap_t cmaps[] = +{ + { + .range_start = 61553, .range_length = 1, .glyph_id_start = 1, + .unicode_list = NULL, .glyph_id_ofs_list = NULL, .list_length = 0, .type = LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY + } +}; + + + +/*-------------------- + * ALL CUSTOM DATA + *--------------------*/ + +#if LV_VERSION_CHECK(8, 0, 0) +/*Store all the custom data of the font*/ +static lv_font_fmt_txt_glyph_cache_t cache; +static const lv_font_fmt_txt_dsc_t font_dsc = { +#else +static lv_font_fmt_txt_dsc_t font_dsc = { +#endif + .glyph_bitmap = glyph_bitmap, + .glyph_dsc = glyph_dsc, + .cmaps = cmaps, + .kern_dsc = NULL, + .kern_scale = 0, + .cmap_num = 1, + .bpp = 4, + .kern_classes = 0, + .bitmap_format = 0, +#if LV_VERSION_CHECK(8, 0, 0) + .cache = &cache +#endif +}; + + +/*----------------- + * PUBLIC FONT + *----------------*/ + +/*Initialize a public general font descriptor*/ +#if LV_VERSION_CHECK(8, 0, 0) +const lv_font_t errorTriangle = { +#else +lv_font_t errorTriangle = { +#endif + .get_glyph_dsc = lv_font_get_glyph_dsc_fmt_txt, /*Function pointer to get glyph's data*/ + .get_glyph_bitmap = lv_font_get_bitmap_fmt_txt, /*Function pointer to get glyph's bitmap*/ + .line_height = 89, /*The maximum line height required by the font*/ + .base_line = 7, /*Baseline measured from the bottom of the line*/ +#if !(LVGL_VERSION_MAJOR == 6 && LVGL_VERSION_MINOR == 0) + .subpx = LV_FONT_SUBPX_NONE, +#endif +#if LV_VERSION_CHECK(7, 4, 0) || LVGL_VERSION_MAJOR >= 8 + .underline_position = 0, + .underline_thickness = 0, +#endif + .dsc = &font_dsc /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */ +}; + + + +#endif /*#if ERRORTRIANGLE*/ + diff --git a/src/display/symbols/file.c b/src/display/symbols/file.c new file mode 100644 index 000000000..60b6af72c --- /dev/null +++ b/src/display/symbols/file.c @@ -0,0 +1,153 @@ +/******************************************************************************* + * Size: 30 px + * Bpp: 4 + * Opts: + ******************************************************************************/ + +#ifdef LV_LVGL_H_INCLUDE_SIMPLE +#include "lvgl.h" +#else +#include +#endif + +#ifndef FILE +#define FILE 1 +#endif + +#if FILE + +/*----------------- + * BITMAPS + *----------------*/ + +/*Store the image of the glyphs*/ +static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = { + /* U+F1C9 "" */ + 0x0, 0x3, 0x33, 0x33, 0x33, 0x33, 0x30, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x6f, 0xff, 0xff, 0xff, + 0xff, 0xff, 0x10, 0xb0, 0x0, 0x0, 0x0, 0x5f, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xf1, 0xf, 0xb0, + 0x0, 0x0, 0xc, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0x10, 0xff, 0xb0, 0x0, 0x0, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xf1, 0xf, 0xff, 0xb0, + 0x0, 0xf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0x10, 0xff, 0xff, 0xb0, 0x0, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xf1, 0xf, 0xff, 0xff, 0xb0, + 0xf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x10, + 0xff, 0xff, 0xff, 0xb0, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xf2, 0x3, 0x33, 0x33, 0x33, 0x1f, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xa0, 0x0, + 0x0, 0x0, 0x0, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xfd, 0xdd, 0xdd, 0xdd, 0x7f, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0x8f, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0x8f, 0xff, 0xff, 0xff, + 0x89, 0xff, 0xff, 0xd6, 0xcf, 0xff, 0xff, 0xf8, + 0xff, 0xff, 0xff, 0x40, 0xc, 0xff, 0xf3, 0x0, + 0xaf, 0xff, 0xff, 0x8f, 0xff, 0xff, 0x40, 0x1, + 0xff, 0xff, 0x70, 0x0, 0xaf, 0xff, 0xf8, 0xff, + 0xff, 0x40, 0x0, 0xcf, 0xff, 0xff, 0x50, 0x0, + 0xbf, 0xff, 0x8f, 0xff, 0xd0, 0x0, 0x9f, 0xff, + 0xff, 0xff, 0x20, 0x4, 0xff, 0xf8, 0xff, 0xff, + 0x30, 0x1, 0xdf, 0xff, 0xff, 0x60, 0x0, 0xaf, + 0xff, 0x8f, 0xff, 0xfe, 0x20, 0x1, 0xff, 0xff, + 0x80, 0x0, 0x9f, 0xff, 0xf8, 0xff, 0xff, 0xfe, + 0x20, 0xb, 0xff, 0xf3, 0x0, 0x9f, 0xff, 0xff, + 0x8f, 0xff, 0xff, 0xfe, 0x66, 0xff, 0xff, 0xb4, + 0xaf, 0xff, 0xff, 0xf8, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x8f, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x8e, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xf7, 0xaf, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0x31, 0xef, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0x80, 0x1, 0x8c, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, + 0xcc, 0xcc, 0xca, 0x50, 0x0 +}; + + +/*--------------------- + * GLYPH DESCRIPTION + *--------------------*/ + +static const lv_font_fmt_txt_glyph_dsc_t glyph_dsc[] = { + {.bitmap_index = 0, .adv_w = 0, .box_w = 0, .box_h = 0, .ofs_x = 0, .ofs_y = 0} /* id = 0 reserved */, + {.bitmap_index = 0, .adv_w = 360, .box_w = 23, .box_h = 31, .ofs_x = 0, .ofs_y = -4} +}; + +/*--------------------- + * CHARACTER MAPPING + *--------------------*/ + + + +/*Collect the unicode lists and glyph_id offsets*/ +static const lv_font_fmt_txt_cmap_t cmaps[] = +{ + { + .range_start = 61897, .range_length = 1, .glyph_id_start = 1, + .unicode_list = NULL, .glyph_id_ofs_list = NULL, .list_length = 0, .type = LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY + } +}; + + + +/*-------------------- + * ALL CUSTOM DATA + *--------------------*/ + +#if LV_VERSION_CHECK(8, 0, 0) +/*Store all the custom data of the font*/ +static lv_font_fmt_txt_glyph_cache_t cache; +static const lv_font_fmt_txt_dsc_t font_dsc = { +#else +static lv_font_fmt_txt_dsc_t font_dsc = { +#endif + .glyph_bitmap = glyph_bitmap, + .glyph_dsc = glyph_dsc, + .cmaps = cmaps, + .kern_dsc = NULL, + .kern_scale = 0, + .cmap_num = 1, + .bpp = 4, + .kern_classes = 0, + .bitmap_format = 0, +#if LV_VERSION_CHECK(8, 0, 0) + .cache = &cache +#endif +}; + + +/*----------------- + * PUBLIC FONT + *----------------*/ + +/*Initialize a public general font descriptor*/ +#if LV_VERSION_CHECK(8, 0, 0) +const lv_font_t file = { +#else +lv_font_t file = { +#endif + .get_glyph_dsc = lv_font_get_glyph_dsc_fmt_txt, /*Function pointer to get glyph's data*/ + .get_glyph_bitmap = lv_font_get_bitmap_fmt_txt, /*Function pointer to get glyph's bitmap*/ + .line_height = 31, /*The maximum line height required by the font*/ + .base_line = 4, /*Baseline measured from the bottom of the line*/ +#if !(LVGL_VERSION_MAJOR == 6 && LVGL_VERSION_MINOR == 0) + .subpx = LV_FONT_SUBPX_NONE, +#endif +#if LV_VERSION_CHECK(7, 4, 0) || LVGL_VERSION_MAJOR >= 8 + .underline_position = 0, + .underline_thickness = 0, +#endif + .dsc = &font_dsc /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */ +}; + + + +#endif /*#if FILE*/ + diff --git a/src/display/symbols/turtle_30px.c b/src/display/symbols/turtle_30px.c new file mode 100644 index 000000000..e9886bd6a --- /dev/null +++ b/src/display/symbols/turtle_30px.c @@ -0,0 +1,166 @@ +/******************************************************************************* + * Size: 30 px + * Bpp: 4 + * Opts: + ******************************************************************************/ + +#ifdef LV_LVGL_H_INCLUDE_SIMPLE +#include "lvgl.h" +#else +#include +#endif + +#ifndef TURTLE_30PX +#define TURTLE_30PX 1 +#endif + +#if TURTLE_30PX + +/*----------------- + * BITMAPS + *----------------*/ + +/*Store the image of the glyphs*/ +static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = { + /* U+F726 "" */ + 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x10, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x6b, 0xff, 0xff, + 0xd9, 0x30, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x6e, 0xff, 0xff, + 0xff, 0xff, 0xfa, 0x10, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x9, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xe3, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x9f, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x10, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x5, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc0, + 0x0, 0x0, 0x15, 0x63, 0x0, 0x0, 0x0, 0xe, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xf6, 0x0, 0x6, 0xff, 0xff, 0xd3, 0x0, 0x0, + 0x6f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xfd, 0x0, 0x3f, 0xff, 0xff, 0xff, 0x50, + 0x0, 0xbf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x20, 0x8f, 0xff, 0xff, 0xff, + 0xe1, 0x0, 0xef, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0x60, 0xaf, 0xff, 0xff, + 0xff, 0xf7, 0x0, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0x70, 0xaf, 0xff, + 0x87, 0xff, 0xfa, 0x1, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0xaf, + 0xff, 0x42, 0xff, 0xfc, 0x1, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80, + 0xaf, 0xff, 0xff, 0xff, 0xfb, 0x1, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0x80, 0xbf, 0xff, 0xff, 0xff, 0xf7, 0x0, 0xdf, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0x40, 0xef, 0xff, 0xff, 0xff, 0xc0, 0x0, + 0x2b, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, + 0xdd, 0xc6, 0x7, 0xff, 0xff, 0xdd, 0xb7, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x7f, 0xff, 0xf6, 0x0, 0x0, + 0x0, 0x18, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, + 0xaa, 0xaa, 0xaa, 0xbe, 0xff, 0xff, 0xd0, 0x0, + 0x0, 0x0, 0xbf, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x20, + 0x0, 0x0, 0x0, 0xef, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc2, + 0x0, 0x0, 0x0, 0x0, 0x6f, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xb5, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x14, 0xff, + 0xff, 0xff, 0xf5, 0x1d, 0xff, 0xff, 0xff, 0xb0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3, + 0xff, 0xff, 0xff, 0xf4, 0xd, 0xff, 0xff, 0xff, + 0xa0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x3, 0xff, 0xff, 0xff, 0xf4, 0xd, 0xff, 0xff, + 0xff, 0xa0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x2, 0xff, 0xff, 0xff, 0xf4, 0xc, 0xff, + 0xff, 0xff, 0xa0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0xdf, 0xff, 0xff, 0xe0, 0x8, + 0xff, 0xff, 0xff, 0x50, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x29, 0xbb, 0xb9, 0x20, + 0x0, 0x7b, 0xbb, 0xb5, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0 +}; + + +/*--------------------- + * GLYPH DESCRIPTION + *--------------------*/ + +static const lv_font_fmt_txt_glyph_dsc_t glyph_dsc[] = { + {.bitmap_index = 0, .adv_w = 0, .box_w = 0, .box_h = 0, .ofs_x = 0, .ofs_y = 0} /* id = 0 reserved */, + {.bitmap_index = 0, .adv_w = 540, .box_w = 34, .box_h = 27, .ofs_x = 0, .ofs_y = -2} +}; + +/*--------------------- + * CHARACTER MAPPING + *--------------------*/ + + + +/*Collect the unicode lists and glyph_id offsets*/ +static const lv_font_fmt_txt_cmap_t cmaps[] = +{ + { + .range_start = 63270, .range_length = 1, .glyph_id_start = 1, + .unicode_list = NULL, .glyph_id_ofs_list = NULL, .list_length = 0, .type = LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY + } +}; + + + +/*-------------------- + * ALL CUSTOM DATA + *--------------------*/ + +#if LV_VERSION_CHECK(8, 0, 0) +/*Store all the custom data of the font*/ +static lv_font_fmt_txt_glyph_cache_t cache; +static const lv_font_fmt_txt_dsc_t font_dsc = { +#else +static lv_font_fmt_txt_dsc_t font_dsc = { +#endif + .glyph_bitmap = glyph_bitmap, + .glyph_dsc = glyph_dsc, + .cmaps = cmaps, + .kern_dsc = NULL, + .kern_scale = 0, + .cmap_num = 1, + .bpp = 4, + .kern_classes = 0, + .bitmap_format = 0, +#if LV_VERSION_CHECK(8, 0, 0) + .cache = &cache +#endif +}; + + +/*----------------- + * PUBLIC FONT + *----------------*/ + +/*Initialize a public general font descriptor*/ +#if LV_VERSION_CHECK(8, 0, 0) +const lv_font_t turtle_30px = { +#else +lv_font_t turtle_30px = { +#endif + .get_glyph_dsc = lv_font_get_glyph_dsc_fmt_txt, /*Function pointer to get glyph's data*/ + .get_glyph_bitmap = lv_font_get_bitmap_fmt_txt, /*Function pointer to get glyph's bitmap*/ + .line_height = 27, /*The maximum line height required by the font*/ + .base_line = 2, /*Baseline measured from the bottom of the line*/ +#if !(LVGL_VERSION_MAJOR == 6 && LVGL_VERSION_MINOR == 0) + .subpx = LV_FONT_SUBPX_NONE, +#endif +#if LV_VERSION_CHECK(7, 4, 0) || LVGL_VERSION_MAJOR >= 8 + .underline_position = 0, + .underline_thickness = 0, +#endif + .dsc = &font_dsc /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */ +}; + + + +#endif /*#if TURTLE_30PX*/ + diff --git a/src/display/symbols/wifi_30px.c b/src/display/symbols/wifi_30px.c new file mode 100644 index 000000000..bea863712 --- /dev/null +++ b/src/display/symbols/wifi_30px.c @@ -0,0 +1,174 @@ +/******************************************************************************* + * Size: 30 px + * Bpp: 4 + * Opts: + ******************************************************************************/ + +#ifdef LV_LVGL_H_INCLUDE_SIMPLE +#include "lvgl.h" +#else +#include +#endif + +#ifndef WIFI_30PX +#define WIFI_30PX 1 +#endif + +#if WIFI_30PX + +/*----------------- + * BITMAPS + *----------------*/ + +/*Store the image of the glyphs*/ +static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = { + /* U+F1EB "" */ + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x12, 0x11, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x59, 0xce, 0xff, 0xff, 0xff, 0xdb, + 0x72, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x1, 0x6b, 0xff, 0xff, 0xff, + 0xdb, 0xce, 0xff, 0xff, 0xfd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 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0xf, 0xf0, 0x0, 0x7f, 0x50, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0xbf, 0x91, 0x3e, 0xf1, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2, + 0xff, 0xff, 0xf7, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x2, 0x9d, 0xb5, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 +}; + + +/*--------------------- + * GLYPH DESCRIPTION + *--------------------*/ + +static const lv_font_fmt_txt_glyph_dsc_t glyph_dsc[] = { + {.bitmap_index = 0, .adv_w = 0, .box_w = 0, .box_h = 0, .ofs_x = 0, .ofs_y = 0} /* id = 0 reserved */, + {.bitmap_index = 0, .adv_w = 600, .box_w = 39, .box_h = 27, .ofs_x = -1, .ofs_y = -2} +}; + +/*--------------------- + * CHARACTER MAPPING + *--------------------*/ + + + +/*Collect the unicode lists and glyph_id offsets*/ +static const lv_font_fmt_txt_cmap_t cmaps[] = +{ + { + .range_start = 61931, .range_length = 1, .glyph_id_start = 1, + .unicode_list = NULL, .glyph_id_ofs_list = NULL, .list_length = 0, .type = LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY + } +}; + + + +/*-------------------- + * ALL CUSTOM DATA + *--------------------*/ + +#if LV_VERSION_CHECK(8, 0, 0) +/*Store all the custom data of the font*/ +static lv_font_fmt_txt_glyph_cache_t cache; +static const lv_font_fmt_txt_dsc_t font_dsc = { +#else +static lv_font_fmt_txt_dsc_t font_dsc = { +#endif + .glyph_bitmap = glyph_bitmap, + .glyph_dsc = glyph_dsc, + .cmaps = cmaps, + .kern_dsc = NULL, + .kern_scale = 0, + .cmap_num = 1, + .bpp = 4, + .kern_classes = 0, + .bitmap_format = 0, +#if LV_VERSION_CHECK(8, 0, 0) + .cache = &cache +#endif +}; + + +/*----------------- + * PUBLIC FONT + *----------------*/ + +/*Initialize a public general font descriptor*/ +#if LV_VERSION_CHECK(8, 0, 0) +const lv_font_t wifi_30px = { +#else +lv_font_t wifi_30px = { +#endif + .get_glyph_dsc = lv_font_get_glyph_dsc_fmt_txt, /*Function pointer to get glyph's data*/ + .get_glyph_bitmap = lv_font_get_bitmap_fmt_txt, /*Function pointer to get glyph's bitmap*/ + .line_height = 27, /*The maximum line height required by the font*/ + .base_line = 2, /*Baseline measured from the bottom of the line*/ +#if !(LVGL_VERSION_MAJOR == 6 && LVGL_VERSION_MINOR == 0) + .subpx = LV_FONT_SUBPX_NONE, +#endif +#if LV_VERSION_CHECK(7, 4, 0) || LVGL_VERSION_MAJOR >= 8 + .underline_position = 0, + .underline_thickness = 0, +#endif + .dsc = &font_dsc /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */ +}; + + + +#endif /*#if WIFI_30PX*/ + diff --git a/src/display/ws_display_tooltips.h b/src/display/ws_display_tooltips.h new file mode 100644 index 000000000..4756dbe62 --- /dev/null +++ b/src/display/ws_display_tooltips.h @@ -0,0 +1,23 @@ +/*! + * @file ws_loading_tooltips.h + * + * Wippersnapper tooltips for the loading screen on a display + * + * Adafruit invests time and resources providing this open source code, + * please support Adafruit and open-source hardware by purchasing + * products from Adafruit! + * + * Copyright (c) Brent Rubell 2023 for Adafruit Industries. + * + * BSD license, all text here must be included in any redistribution. + * + */ +#ifndef WS_LOADING_TOOLTIPS_H +#define WS_LOADING_TOOLTIPS_H + +#define WS_LOADING_TIP_1 "Name components in IO using emojis to differentiate them!" +#define WS_LOADING_TIP_2 "WipperSnapper now supports TFT displays on some boards (more to come)." +#define WS_LOADING_TIP_3 "Getting throttle errors? Try reducing a sensor's polling time." +#define WS_LOADING_TIP_4 "\"Be quick, but don't hurry\" - John Wooden " + +#endif // WS_LOADING_TOOLTIPS_H \ No newline at end of file From 6f72c61de6cab80cd6de95ff2f336c13d693bb88 Mon Sep 17 00:00:00 2001 From: brentru Date: Thu, 27 Apr 2023 17:51:21 -0400 Subject: [PATCH 07/90] shows loading screen now --- src/Wippersnapper.cpp | 24 +-- src/Wippersnapper.h | 3 + src/display/ws_display_driver.h | 9 +- src/display/ws_display_ui_helper.cpp | 262 +++++++++++++++++++++++++++ src/display/ws_display_ui_helper.h | 101 +++++++++++ 5 files changed, 381 insertions(+), 18 deletions(-) create mode 100644 src/display/ws_display_ui_helper.cpp create mode 100644 src/display/ws_display_ui_helper.h diff --git a/src/Wippersnapper.cpp b/src/Wippersnapper.cpp index 7f2d6eb2e..6d4e544e4 100644 --- a/src/Wippersnapper.cpp +++ b/src/Wippersnapper.cpp @@ -104,7 +104,8 @@ void Wippersnapper::provision() { _littleFS = new WipperSnapper_LittleFS(); #endif -/* // Initialize the display + // TODO: Add checks around display init. + // Initialize the display displayConfig config = WS._fileSystem->parseDisplayConfig(); // TODO: Need error boundary checks and signaling around // display initialization if it doesnt exist! @@ -115,7 +116,14 @@ void Wippersnapper::provision() { "Unable to enable display driver and LVGL"); // TODO: Maybe fail out and // revert to non-display? // Where do we log this? - WS._display->enableLogging(); */ + WS._display->enableLogging(); + + // UI Setup + WS._ui_helper = new ws_display_ui_helper(); + WS._ui_helper->set_bg_black(); + WS._ui_helper->show_scr_load(); + lv_task_handler(); + // TODO: Add display error modes within parseSecrets() #ifdef USE_TINYUSB @@ -2299,18 +2307,6 @@ void printDeviceInfo() { void Wippersnapper::connect() { WS_DEBUG_PRINTLN("Adafruit.io WipperSnapper"); - // Initialize the display - displayConfig config = WS._fileSystem->parseDisplayConfig(); - // TODO: Need error boundary checks and signaling around - // display initialization if it doesnt exist! - WS._display = new ws_display_driver(config); - // Begin display - if (!WS._display->begin()) - WS_DEBUG_PRINTLN( - "Unable to enable display driver and LVGL"); // TODO: Maybe fail out and - // revert to non-display? - // Where do we log this? - WS._display->enableLogging(); // Dump device info to the serial monitor printDeviceInfo(); diff --git a/src/Wippersnapper.h b/src/Wippersnapper.h index b3dd24882..f90fe632e 100644 --- a/src/Wippersnapper.h +++ b/src/Wippersnapper.h @@ -36,6 +36,7 @@ // Display #include "display/ws_display_driver.h" +#include "display/ws_display_ui_helper.h" // Wippersnapper components #include "components/analogIO/Wippersnapper_AnalogIO.h" @@ -196,6 +197,7 @@ class Wippersnapper_AnalogIO; class Wippersnapper_FS; class WipperSnapper_LittleFS; class ws_display_driver; +class ws_display_ui_helper; class WipperSnapper_Component_I2C; #ifdef ARDUINO_ARCH_ESP32 class ws_ledc; @@ -314,6 +316,7 @@ class Wippersnapper { WipperSnapper_LittleFS *_littleFS; ///< Instance of LittleFS Filesystem (non-native USB) ws_display_driver *_display = nullptr; ///< Instance of display driver class + ws_display_ui_helper *_ui_helper = nullptr; ///< Instance of display UI helper class ws_pixels *_ws_pixelsComponent; ///< ptr to instance of ws_pixels class ws_pwm *_pwmComponent; ///< Instance of pwm class ws_servo *_servoComponent; ///< Instance of servo class diff --git a/src/display/ws_display_driver.h b/src/display/ws_display_driver.h index f8df3722b..ab7fc927b 100644 --- a/src/display/ws_display_driver.h +++ b/src/display/ws_display_driver.h @@ -19,7 +19,6 @@ #include // Always include this BEFORE lvgl.h! #include -// #include #include struct displayConfig { @@ -36,7 +35,9 @@ struct displayConfig { uint8_t pinRST; }; -class Wippersnapper; // friend class +LV_FONT_DECLARE(errorTriangle); + +class Wippersnapper; // fwd decl /***************************************************************************/ /*! @@ -53,9 +54,9 @@ class ws_display_driver { void setResolution(uint16_t displayWidth, uint16_t displayHeight); void setRotation(uint8_t rotationMode); void enableLogging(); - -private: Adafruit_LvGL_Glue *_glue; +private: + Adafruit_ST7789 *_tft_st7789 = nullptr; uint16_t _displayWidth; uint16_t _displayHeight; diff --git a/src/display/ws_display_ui_helper.cpp b/src/display/ws_display_ui_helper.cpp new file mode 100644 index 000000000..d9501b2cf --- /dev/null +++ b/src/display/ws_display_ui_helper.cpp @@ -0,0 +1,262 @@ +/*! + * @file ws_display_ui_helper.cpp + * + * LVGL "helper" class for WipperSnapper. + * + * Adafruit invests time and resources providing this open source code, + * please support Adafruit and open-source hardware by purchasing + * products from Adafruit! + * + * Copyright (c) Brent Rubell 2023 for Adafruit Industries. + * + * BSD license, all text here must be included in any redistribution. + * + */ + +#include "ws_display_ui_helper.h" + +/**************************************************************************/ +/*! + @brief Changes a label every 2 seconds to a new, random, tip. + @param timer + The lv_timer tied to this callback, timerLoadTips. +*/ +/**************************************************************************/ +void lv_timer_tips_cb(lv_timer_t *timer) { + Serial.println("Timer tips cb called"); + long tipNum = random(0, sizeof(loading_tips) / sizeof(loading_tips[0])); + lv_label_set_text(lblTipText, loading_tips[tipNum]); +} + +/**************************************************************************/ +/*! + @brief Callback for updating the status label on the loading screen. + @param event + Callback data. +*/ +/**************************************************************************/ +static void label_status_cb(lv_event_t *event) { + Serial.println("eventcb called!"); + const char **charPtr{static_cast(lv_event_get_param(event))}; + Serial.print("text: "); + Serial.println(*charPtr); + lv_label_set_text(lblStatusText, *charPtr); +} + +/**************************************************************************/ +/*! + @brief Sets the text of the status label on the loading screen. + @param text + Desired text to write to the status label. +*/ +/**************************************************************************/ +void ws_display_ui_helper::set_label_status(const char *text) { + Serial.print("set_label_status (text): "); + Serial.println(text); + lv_event_send(lblStatusText, LV_EVENT_REFRESH, &text); +} + +/**************************************************************************/ +/*! + @brief Pauses and deletes the loading tip callback timer. +*/ +/**************************************************************************/ +void ws_display_ui_helper::remove_tip_timer() { + lv_timer_pause(timerLoadTips); + lv_timer_del(timerLoadTips); +} + +/**************************************************************************/ +/*! + @brief Sets the screen's background to a black color. +*/ +/**************************************************************************/ +void ws_display_ui_helper::set_bg_black() { + lv_obj_set_style_bg_color(lv_scr_act(), lv_color_black(), LV_STATE_DEFAULT); +} + +/**************************************************************************/ +/*! + @brief Sets the color of an icon on the loading screen to green. + @param iconType + Desired icon. +*/ +/**************************************************************************/ +void ws_display_ui_helper::set_load_bar_icon_complete(loadBarIcons iconType) { + static lv_style_t *styleIcon; + static lv_obj_t *objIcon; + + switch (iconType) { + case loadBarIconFile: + styleIcon = &styleIconFile; + objIcon = lblIconFile; + break; + case loadBarIconWifi: + styleIcon = &styleIconWiFi; + objIcon = lblIconWiFi; + break; + case loadBarIconCloud: + styleIcon = &styleIconCloud; + objIcon = labelCloudBar; + break; + case loadBarIconTurtle: + styleIcon = &styleIconTurtle30px; + objIcon = labelTurtleBar; + break; + default: + Serial.println("ERROR: Undefined iconType!"); + return; + } + + // set icon's color and refresh + lv_style_set_text_color(styleIcon, lv_palette_main(LV_PALETTE_GREEN)); + lv_obj_refresh_style(objIcon, LV_PART_MAIN, LV_STYLE_PROP_ANY); + + lv_task_handler(); +} + +/**************************************************************************/ +/*! + @brief Builds and displays the loading screen. +*/ +/**************************************************************************/ +void ws_display_ui_helper::show_scr_load() { + + // Icon bar + const lv_coord_t iconBarXStart = + 20; // Coordinate where the icon bar begins, on the X axis + const lv_coord_t iconBarYOffset = 5; // Vertical offset from top of screen + const int iconBarXSpaces = 40; // Horizontal spaces between icons + + // add symbol_code (30px) to represent settings.json + lblIconFile = lv_label_create(lv_scr_act()); + lv_label_set_text(lblIconFile, SYMBOL_CODE); + // formatting + lv_style_init(&styleIconFile); + lv_style_set_text_color(&styleIconFile, lv_palette_main(LV_PALETTE_GREY)); + lv_style_set_text_font(&styleIconFile, &file); + lv_obj_add_style(lblIconFile, &styleIconFile, LV_PART_MAIN); + lv_obj_align(lblIconFile, LV_ALIGN_TOP_LEFT, iconBarXStart, iconBarYOffset); + + // add symbol_wifi (30px) to represent wifi connect + lblIconWiFi = lv_label_create(lv_scr_act()); + lv_label_set_text(lblIconWiFi, SYMBOL_WIFI); + lv_style_init(&styleIconWiFi); + lv_style_set_text_color(&styleIconWiFi, lv_palette_main(LV_PALETTE_GREY)); + lv_style_set_text_font(&styleIconWiFi, &wifi_30px); + lv_obj_add_style(lblIconWiFi, &styleIconWiFi, LV_PART_MAIN); + lv_obj_align(lblIconWiFi, LV_ALIGN_TOP_LEFT, iconBarXStart + iconBarXSpaces, + iconBarYOffset); + + // Add cloud + labelCloudBar = lv_label_create(lv_scr_act()); + lv_label_set_text(labelCloudBar, SYMBOL_CLOUD); + + lv_style_init(&styleIconCloud); + lv_style_set_text_color(&styleIconCloud, lv_palette_main(LV_PALETTE_GREY)); + lv_style_set_text_font(&styleIconCloud, &cloud_30px); + lv_obj_add_style(labelCloudBar, &styleIconCloud, LV_PART_MAIN); + lv_obj_align(labelCloudBar, LV_ALIGN_TOP_LEFT, 120, iconBarYOffset); + + // Add turtle + labelTurtleBar = lv_label_create(lv_scr_act()); + lv_label_set_text(labelTurtleBar, SYMBOL_TURTLE30PX); + + lv_style_init(&styleIconTurtle30px); + lv_style_set_text_color(&styleIconTurtle30px, + lv_palette_main(LV_PALETTE_GREY)); + lv_style_set_text_font(&styleIconTurtle30px, &turtle_30px); + lv_obj_add_style(labelTurtleBar, &styleIconTurtle30px, LV_PART_MAIN); + lv_obj_align(labelTurtleBar, LV_ALIGN_TOP_LEFT, 180, iconBarYOffset); + + // Add status text label underneath the top loading bar + lblStatusText = lv_label_create(lv_scr_act()); + lv_label_set_long_mode(lblStatusText, LV_LABEL_LONG_WRAP); + lv_obj_set_style_text_font(lblStatusText, &lv_font_montserrat_20, 0); + lv_obj_set_style_text_color(lblStatusText, lv_color_white(), LV_PART_MAIN); + lv_label_set_text(lblStatusText, "\0"); + lv_obj_align(lblStatusText, LV_ALIGN_TOP_MID, 0, 50); + lv_obj_add_event_cb(lblStatusText, label_status_cb, LV_EVENT_REFRESH, NULL); + + // Add loading tooltip text label + lblTipText = lv_label_create(lv_scr_act()); + lv_label_set_long_mode(lblTipText, LV_LABEL_LONG_WRAP); + lv_obj_set_style_text_font(lblTipText, &lv_font_montserrat_18, 0); + lv_obj_set_width(lblTipText, + 230); // TODO: This should match display width - 10px + lv_obj_set_style_text_color(lblTipText, lv_color_white(), LV_PART_MAIN); + lv_label_set_text(lblTipText, "\0"); + lv_obj_align(lblTipText, LV_ALIGN_BOTTOM_LEFT, 0, -40); + timerLoadTips = lv_timer_create(lv_timer_tips_cb, 500, NULL); +} + +/**************************************************************************/ +/*! + @brief Deletes all objects/styles off the load screen and frees + their resources. +*/ +/**************************************************************************/ +void ws_display_ui_helper::clear_scr_load() { + lv_obj_del(lblStatusText); + lv_obj_del(lblIconFile); + lv_obj_del(labelTurtleBar); + lv_obj_del(labelCloudBar); + // Clear all properties from styles and free all allocated memory + lv_style_reset(&styleIconWiFi); + lv_style_reset(&styleIconCloud); + lv_style_reset(&styleIconTurtle30px); + lv_style_reset(&styleIconCheckmark); + // Stop the loading tip timer and delete the label + remove_tip_timer(); + lv_obj_del(lblTipText); +} + +/**************************************************************************/ +/*! + @brief Build and display an error screen. + @param lblError + The generic error. + @param lblDesc + Instructions or steps to resolve the error. +*/ +/**************************************************************************/ +void ws_display_ui_helper::show_scr_error(const char *lblError, + const char *lblDesc) { + Serial.println("ws_display_ui_helper"); + // clear the active loading screen (for now, will eventually expand to take in + // a scr obj.) + clear_scr_load(); + + // Create error symbol + labelErrorTriangle = lv_label_create(lv_scr_act()); + lv_label_set_text(labelErrorTriangle, SYMBOL_ERROR_TRIANGLE); + + lv_style_init(&styleErrorTriangle); + lv_style_set_text_color(&styleErrorTriangle, lv_color_white()); + lv_style_set_text_font(&styleErrorTriangle, &errorTriangle); + lv_obj_add_style(labelErrorTriangle, &styleErrorTriangle, LV_PART_MAIN); + lv_obj_align(labelErrorTriangle, LV_ALIGN_TOP_MID, 0, 5); + + // Add error label (large) + labelErrorHeader = lv_label_create(lv_scr_act()); + lv_label_set_text(labelErrorHeader, lblError); + + lv_style_init(&styleLabelErrorLarge); + lv_style_set_text_color(&styleLabelErrorLarge, lv_color_white()); + lv_style_set_text_font(&styleLabelErrorLarge, &lv_font_montserrat_18); + lv_obj_add_style(labelErrorHeader, &styleLabelErrorLarge, LV_PART_MAIN); + lv_obj_align(labelErrorHeader, LV_ALIGN_CENTER, 0, -5); + + // Add error label (small) + labelErrorBody = lv_label_create(lv_scr_act()); + lv_label_set_long_mode(labelErrorBody, LV_LABEL_LONG_WRAP); + lv_label_set_text(labelErrorBody, lblDesc); + + lv_style_init(&styleLabelErrorSmall); + lv_style_set_text_color(&styleLabelErrorSmall, lv_color_white()); + lv_style_set_text_font(&styleLabelErrorSmall, &lv_font_montserrat_12); + lv_obj_add_style(labelErrorBody, &styleLabelErrorSmall, LV_PART_MAIN); + // set_width used by LABEL_LONG_WRAP + lv_obj_set_width(labelErrorBody, 220); + lv_obj_align(labelErrorBody, LV_ALIGN_CENTER, -3, 55); +} \ No newline at end of file diff --git a/src/display/ws_display_ui_helper.h b/src/display/ws_display_ui_helper.h new file mode 100644 index 000000000..a1e736b7f --- /dev/null +++ b/src/display/ws_display_ui_helper.h @@ -0,0 +1,101 @@ +/*! + * @file ws_display_ui_helper.h + * + * LVGL "helper" class for WipperSnapper. + * + * Adafruit invests time and resources providing this open source code, + * please support Adafruit and open-source hardware by purchasing + * products from Adafruit! + * + * Copyright (c) Brent Rubell 2023 for Adafruit Industries. + * + * BSD license, all text here must be included in any redistribution. + * + */ + +#ifndef WS_DISPLAY_UI_HELPER_H +#define WS_DISPLAY_UI_HELPER_H + +#include "Wippersnapper.h" +#include +#include "ws_display_driver.h" +#include "ws_display_tooltips.h" + +// External Fonts +#define SYMBOL_CODE "\xEF\x87\x89" ///< Symbol code for file icon +#define SYMBOL_WIFI "\xEF\x87\xAB" ///< Symbol code for WiFi icon +#define SYMBOL_TURTLE30PX "\xEF\x9C\xA6" ///< Symbol code for turtle icon +#define SYMBOL_CLOUD "\xEF\x83\x82" ///< Symbol code for cloud icon +#define SYMBOL_ERROR_TRIANGLE "\xEF\x81\xB1" ///< Symbol code for error triangle icon +LV_FONT_DECLARE(errorTriangle); +LV_FONT_DECLARE(file); +LV_FONT_DECLARE(wifi_30px); +LV_FONT_DECLARE(cloud_30px); +LV_FONT_DECLARE(turtle_30px); +LV_FONT_DECLARE(circle_30px); + +// Images +LV_IMG_DECLARE(ws_icon_100px); + +/* Screen: Loading */ +// Objects +static lv_obj_t *imgWSLogo; +static lv_obj_t *lblIconFile; +static lv_obj_t *lblIconWiFi; +static lv_obj_t *labelTurtleBar; +static lv_obj_t *labelCloudBar; +static lv_obj_t *labelCircleBar; +static lv_obj_t *lblStatusText; +static lv_obj_t *lblTipText; +// Styles +static lv_style_t styleIconFile; +static lv_style_t styleIconWiFi; +static lv_style_t styleIconTurtle30px; +static lv_style_t styleIconCloud; +static lv_style_t styleIconCheckmark; + +/* Screen: Error */ +// Objects +static lv_obj_t *labelErrorTriangle; +static lv_obj_t *labelErrorHeader; +static lv_obj_t *labelErrorBody; +// Styles +static lv_style_t styleErrorTriangle; +static lv_style_t styleLabelErrorLarge; +static lv_style_t styleLabelErrorSmall; + +enum loadBarIcons { + loadBarIconFile, + loadBarIconWifi, + loadBarIconCloud, + loadBarIconTurtle, + loadBarIconCheckmark +}; ///< Icon names for use by set_load_bar_icon_complete + +// holds all the loading tips +static const char* loading_tips[4] = { WS_LOADING_TIP_1, WS_LOADING_TIP_2, WS_LOADING_TIP_3, WS_LOADING_TIP_4 }; + +static lv_timer_t * timerLoadTips; + +/**************************************************************************/ +/*! + @brief Helps build and manage the LVGL objects and screens for + the application code. +*/ +/**************************************************************************/ +class ws_display_ui_helper { +public: + ws_display_ui_helper(){}; + ~ws_display_ui_helper(){}; + + void set_bg_black(); + + void show_scr_load(); + void clear_scr_load(); + void set_load_bar_icon_complete(loadBarIcons iconType); + void set_label_status(const char *text); // callback ui help? + void remove_tip_timer(); + + void show_scr_error(const char *lblError, const char *lblDesc); +}; +#endif // WS_DISPLAY_UI_HELPER_H From 607108df7053371c4b2d19ca0a693c15f1dc326e Mon Sep 17 00:00:00 2001 From: brentru Date: Fri, 5 May 2023 16:55:13 -0400 Subject: [PATCH 08/90] start pushing show_scren_error within FS, NOTE i removed the status LED colors here, that needs to be put back TODO --- src/Wippersnapper.cpp | 4 ++-- src/Wippersnapper.h | 1 + src/provisioning/tinyusb/Wippersnapper_FS.cpp | 4 +++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Wippersnapper.cpp b/src/Wippersnapper.cpp index 6d4e544e4..b1804e958 100644 --- a/src/Wippersnapper.cpp +++ b/src/Wippersnapper.cpp @@ -91,10 +91,10 @@ Wippersnapper::~Wippersnapper() { */ /**************************************************************************/ void Wippersnapper::provision() { - // Get MAC address from the network interface + // Filesystem should get the MAC address getMacAddr(); - // Initialize the status LED + // Initialize the status LED for signaling FS errors initStatusLED(); // Initialize the filesystem diff --git a/src/Wippersnapper.h b/src/Wippersnapper.h index f90fe632e..805c8a6c9 100644 --- a/src/Wippersnapper.h +++ b/src/Wippersnapper.h @@ -321,6 +321,7 @@ class Wippersnapper { ws_pwm *_pwmComponent; ///< Instance of pwm class ws_servo *_servoComponent; ///< Instance of servo class ws_ds18x20 *_ds18x20Component; ///< Instance of DS18x20 class + uint8_t _macAddr[6]; /*!< Unique network iface identifier */ char sUID[13]; /*!< Unique network iface identifier */ diff --git a/src/provisioning/tinyusb/Wippersnapper_FS.cpp b/src/provisioning/tinyusb/Wippersnapper_FS.cpp index 67fdfa9d7..cdb1a854c 100644 --- a/src/provisioning/tinyusb/Wippersnapper_FS.cpp +++ b/src/provisioning/tinyusb/Wippersnapper_FS.cpp @@ -360,6 +360,8 @@ void Wippersnapper_FS::parseSecrets() { "* ERROR: Default username found in secrets.json, please edit " "the secrets.json file and reset the board for the changes to take " "effect\n"); + WS._ui_helper->show_scr_error("INVALID USERNAME", "The \"io_username\" field within secrets.json is invalid, please change it to match your Adafruit IO username.\nConfused? Visit adafru.it/123456 for detailed instructions."); + lv_task_handler(); fsHalt(); } WS._username = io_username; @@ -473,7 +475,7 @@ void Wippersnapper_FS::writeToBootOut(PGM_P str) { /**************************************************************************/ void Wippersnapper_FS::fsHalt() { while (1) { - statusLEDSolid(WS_LED_STATUS_FS_WRITE); + //statusLEDSolid(WS_LED_STATUS_FS_WRITE); delay(1000); yield(); } From fc56ccab30c260166d3d18011fcf3c13b0a1e0aa Mon Sep 17 00:00:00 2001 From: brentru Date: Fri, 5 May 2023 17:06:23 -0400 Subject: [PATCH 09/90] clean up parseSecrets --- src/display/ws_display_ui_helper.cpp | 3 + src/provisioning/tinyusb/Wippersnapper_FS.cpp | 83 +++++-------------- 2 files changed, 25 insertions(+), 61 deletions(-) diff --git a/src/display/ws_display_ui_helper.cpp b/src/display/ws_display_ui_helper.cpp index d9501b2cf..e97390669 100644 --- a/src/display/ws_display_ui_helper.cpp +++ b/src/display/ws_display_ui_helper.cpp @@ -259,4 +259,7 @@ void ws_display_ui_helper::show_scr_error(const char *lblError, // set_width used by LABEL_LONG_WRAP lv_obj_set_width(labelErrorBody, 220); lv_obj_align(labelErrorBody, LV_ALIGN_CENTER, -3, 55); + + // call task handler + lv_task_handler(); } \ No newline at end of file diff --git a/src/provisioning/tinyusb/Wippersnapper_FS.cpp b/src/provisioning/tinyusb/Wippersnapper_FS.cpp index cdb1a854c..c97744de0 100644 --- a/src/provisioning/tinyusb/Wippersnapper_FS.cpp +++ b/src/provisioning/tinyusb/Wippersnapper_FS.cpp @@ -336,102 +336,55 @@ void Wippersnapper_FS::parseSecrets() { if (err) { WS_DEBUG_PRINT("ERROR: deserializeJson() failed with code "); WS_DEBUG_PRINTLN(err.c_str()); - - writeToBootOut("ERROR: deserializeJson() failed with code\n"); - writeToBootOut(err.c_str()); fsHalt(); } - // Get io username + // Parse io_username const char *io_username = doc["io_username"]; // error check against default values [ArduinoJSON, 3.3.3] - if (io_username == nullptr) { + if (io_username == nullptr || strcmp(io_username, "YOUR_IO_USERNAME_HERE") == 0) { WS_DEBUG_PRINTLN("ERROR: invalid io_username value in secrets.json!"); writeToBootOut("ERROR: invalid io_username value in secrets.json!\n"); - while (1) { - statusLEDSolid(WS_LED_STATUS_FS_WRITE); - yield(); - } - } - - // check if username is from templated json - if (doc["io_username"] == "YOUR_IO_USERNAME_HERE") { - writeToBootOut( - "* ERROR: Default username found in secrets.json, please edit " - "the secrets.json file and reset the board for the changes to take " - "effect\n"); WS._ui_helper->show_scr_error("INVALID USERNAME", "The \"io_username\" field within secrets.json is invalid, please change it to match your Adafruit IO username.\nConfused? Visit adafru.it/123456 for detailed instructions."); - lv_task_handler(); fsHalt(); } + // Set io_username WS._username = io_username; - writeToBootOut("Adafruit.io Username: "); - writeToBootOut(WS._username); - writeToBootOut("\n"); - - // Get io key + // Parse io_key const char *io_key = doc["io_key"]; - // error check against default values [ArduinoJSON, 3.3.3] if (io_key == nullptr) { WS_DEBUG_PRINTLN("ERROR: invalid io_key value in secrets.json!"); writeToBootOut("ERROR: invalid io_key value in secrets.json!\n"); + WS._ui_helper->show_scr_error("INVALID IO KEY", "The \"io_key\" field within secrets.json is invalid, please change it to match your Adafruit IO username.\nConfused? Visit adafru.it/123456 for detailed instructions."); fsHalt(); } WS._key = io_key; - // Parse WiFi Network SSID - // Check if network type is WiFi + // Parse WiFi SSID const char *network_type_wifi_ssid = doc["network_type_wifi"]["network_ssid"]; - if (network_type_wifi_ssid != nullptr) { - WS._network_ssid = network_type_wifi_ssid; - } - - // error check against default values [ArduinoJSON, 3.3.3] - if (WS._network_ssid == nullptr) { + if (network_type_wifi_ssid == nullptr || strcmp(network_type_wifi_ssid, "YOUR_WIFI_SSID_HERE") == 0) { WS_DEBUG_PRINTLN("ERROR: invalid network_ssid value in secrets.json!"); writeToBootOut("ERROR: invalid network_ssid value in secrets.json!\n"); - while (1) { - statusLEDSolid(WS_LED_STATUS_FS_WRITE); - yield(); - } - } - - // error check if SSID is the from templated json - if (strcmp(WS._network_ssid, "YOUR_WIFI_SSID_HERE") == 0) { - writeToBootOut( - "* ERROR: Default SSID found in secrets.json, please edit " - "the secrets.json file and reset the board for the changes to take " - "effect\n"); - fsHalt(); + WS._ui_helper->show_scr_error("INVALID SSID", "The \"network_ssid\" field within secrets.json is invalid, please change it to match your Adafruit IO username.\nConfused? Visit adafru.it/123456 for detailed instructions."); + fshalt(); } + // Set network SSID + WS._network_ssid = network_type_wifi_ssid; // Parse WiFi Network Password - // Check if network type is WiFi const char *network_type_wifi_password = doc["network_type_wifi"]["network_password"]; - if (network_type_wifi_password != nullptr) { - WS._network_pass = network_type_wifi_password; - } - - // error check against default values [ArduinoJSON, 3.3.3] - if (WS._network_pass == nullptr) { + if (network_type_wifi_password == nullptr || strcmp(network_type_wifi_password, "YOUR_WIFI_PASS_HERE") == 0) { WS_DEBUG_PRINTLN("ERROR: invalid network_type_wifi_password value in " "secrets.json!"); writeToBootOut("ERROR: invalid network_type_wifi_password value in " "secrets.json!\n"); + WS._ui_helper->show_scr_error("INVALID SSID", "The \"network_ssid\" field within secrets.json is invalid, please change it to match your Adafruit IO username.\nConfused? Visit adafru.it/123456 for detailed instructions."); fsHalt(); } - // error check if wifi password is from template - if (strcmp(WS._network_pass, "YOUR_WIFI_PASS_HERE") == 0) { - writeToBootOut("Default SSID found in secrets.json, please edit " - "the secrets.json file and reset the board\n"); - fsHalt(); - } + WS._network_pass = network_type_wifi_password; - writeToBootOut("WiFi Network: "); - writeToBootOut(WS._network_ssid); - writeToBootOut("\n"); // Optionally set the MQTT broker url (used to switch btween prod. and // staging) @@ -445,6 +398,14 @@ void Wippersnapper_FS::parseSecrets() { // clear the document and release all memory from the memory pool doc.clear(); + // Write configuration out to boot_out file + writeToBootOut("Adafruit.io Username: "); + writeToBootOut(WS._username); + writeToBootOut("\n"); + writeToBootOut("WiFi Network: "); + writeToBootOut(WS._network_ssid); + writeToBootOut("\n"); + // close the tempFile secretsFile.close(); } From 7c3f1d3712ef95a3ce0c271937699a6c6368db25 Mon Sep 17 00:00:00 2001 From: brentru Date: Fri, 5 May 2023 17:21:51 -0400 Subject: [PATCH 10/90] rewrite createConfigFileSkel to use arduinoJSON rather than pushing out to the file itself --- src/provisioning/tinyusb/Wippersnapper_FS.cpp | 80 ++++++++++++------- 1 file changed, 50 insertions(+), 30 deletions(-) diff --git a/src/provisioning/tinyusb/Wippersnapper_FS.cpp b/src/provisioning/tinyusb/Wippersnapper_FS.cpp index c97744de0..95256b364 100644 --- a/src/provisioning/tinyusb/Wippersnapper_FS.cpp +++ b/src/provisioning/tinyusb/Wippersnapper_FS.cpp @@ -180,7 +180,7 @@ bool Wippersnapper_FS::initFilesystem() { // Check if secrets.json file already exists if (!configFileExists()) { - // Create new secrets.json file + // Create new secrets.json file and halt createConfigFileSkel(); } @@ -294,28 +294,30 @@ bool Wippersnapper_FS::createBootFile() { */ /**************************************************************************/ void Wippersnapper_FS::createConfigFileSkel() { - // open for writing, create a new file if one doesnt exist + // Create JSON object + StaticJsonDocument<256> doc; + doc["io_username"] = "YOUR_IO_USERNAME_HERE"; + doc["io_key"] = "YOUR_IO_KEY_HERE"; + JsonObject network_type_wifi = doc.createNestedObject("network_type_wifi"); + network_type_wifi["network_ssid"] = "YOUR_WIFI_SSID_HERE"; + network_type_wifi["network_password"] = "YOUR_WIFI_PASS_HERE"; + doc["status_pixel_brightness"] = "0.0"; + + // Serialize JSON object and write secrets.json to file File32 secretsFile = wipperFatFs.open("/secrets.json", FILE_WRITE); - if (!secretsFile) { - setStatusLEDColor(RED); - while (1) - yield(); - } - // write out secrets file to USB-MSD - // NOTE: This was chunked into sep. lines, had issue with writing the entire - // file at once - secretsFile.print("{\n\t\"io_username\":\"YOUR_IO_USERNAME_HERE\",\n\t\"io_" - "key\":\"YOUR_IO_KEY_"); - secretsFile.flush(); - secretsFile.print("HERE\",\n\t\"network_type_wifi\":{\n\t\t\"network_" - "ssid\":\"YOUR_WIFI_SSID_"); - secretsFile.flush(); - secretsFile.print("HERE\",\n\t\t\"network_password\":\"YOUR_WIFI_PASS_" - "HERE\"\n\t},\n\t\"status_pixel_brightness\":\"0.5\"\n}"); - secretsFile.flush(); - secretsFile.close(); + serializeJsonPretty(doc, secretsFile); + displayFile.flush(); + displayFile.close(); + delay(2500); + writeToBootOut( "* Please edit the secrets.json file. Then, reset your board.\n"); + WS._ui_helper->show_scr_error( + "INVALID SETTINGS FILE", + "The settings.json file on the WIPPER drive contains default values. " + "Please edit it to reflect your Adafruit IO and network credentials. " + "When you're done, press RESET on the board."); + fsHalt(); } /**************************************************************************/ @@ -342,10 +344,15 @@ void Wippersnapper_FS::parseSecrets() { // Parse io_username const char *io_username = doc["io_username"]; // error check against default values [ArduinoJSON, 3.3.3] - if (io_username == nullptr || strcmp(io_username, "YOUR_IO_USERNAME_HERE") == 0) { + if (io_username == nullptr || + strcmp(io_username, "YOUR_IO_USERNAME_HERE") == 0) { WS_DEBUG_PRINTLN("ERROR: invalid io_username value in secrets.json!"); writeToBootOut("ERROR: invalid io_username value in secrets.json!\n"); - WS._ui_helper->show_scr_error("INVALID USERNAME", "The \"io_username\" field within secrets.json is invalid, please change it to match your Adafruit IO username.\nConfused? Visit adafru.it/123456 for detailed instructions."); + WS._ui_helper->show_scr_error( + "INVALID USERNAME", + "The \"io_username\" field within secrets.json is invalid, please " + "change it to match your Adafruit IO username.\nConfused? Visit " + "adafru.it/123456 for detailed instructions."); fsHalt(); } // Set io_username @@ -356,18 +363,27 @@ void Wippersnapper_FS::parseSecrets() { if (io_key == nullptr) { WS_DEBUG_PRINTLN("ERROR: invalid io_key value in secrets.json!"); writeToBootOut("ERROR: invalid io_key value in secrets.json!\n"); - WS._ui_helper->show_scr_error("INVALID IO KEY", "The \"io_key\" field within secrets.json is invalid, please change it to match your Adafruit IO username.\nConfused? Visit adafru.it/123456 for detailed instructions."); + WS._ui_helper->show_scr_error( + "INVALID IO KEY", + "The \"io_key\" field within secrets.json is invalid, please change it " + "to match your Adafruit IO username.\nConfused? Visit adafru.it/123456 " + "for detailed instructions."); fsHalt(); } WS._key = io_key; // Parse WiFi SSID const char *network_type_wifi_ssid = doc["network_type_wifi"]["network_ssid"]; - if (network_type_wifi_ssid == nullptr || strcmp(network_type_wifi_ssid, "YOUR_WIFI_SSID_HERE") == 0) { + if (network_type_wifi_ssid == nullptr || + strcmp(network_type_wifi_ssid, "YOUR_WIFI_SSID_HERE") == 0) { WS_DEBUG_PRINTLN("ERROR: invalid network_ssid value in secrets.json!"); writeToBootOut("ERROR: invalid network_ssid value in secrets.json!\n"); - WS._ui_helper->show_scr_error("INVALID SSID", "The \"network_ssid\" field within secrets.json is invalid, please change it to match your Adafruit IO username.\nConfused? Visit adafru.it/123456 for detailed instructions."); - fshalt(); + WS._ui_helper->show_scr_error( + "INVALID SSID", + "The \"network_ssid\" field within secrets.json is invalid, please " + "change it to match your Adafruit IO username.\nConfused? Visit " + "adafru.it/123456 for detailed instructions."); + fsHalt(); } // Set network SSID WS._network_ssid = network_type_wifi_ssid; @@ -375,17 +391,21 @@ void Wippersnapper_FS::parseSecrets() { // Parse WiFi Network Password const char *network_type_wifi_password = doc["network_type_wifi"]["network_password"]; - if (network_type_wifi_password == nullptr || strcmp(network_type_wifi_password, "YOUR_WIFI_PASS_HERE") == 0) { + if (network_type_wifi_password == nullptr || + strcmp(network_type_wifi_password, "YOUR_WIFI_PASS_HERE") == 0) { WS_DEBUG_PRINTLN("ERROR: invalid network_type_wifi_password value in " "secrets.json!"); writeToBootOut("ERROR: invalid network_type_wifi_password value in " "secrets.json!\n"); - WS._ui_helper->show_scr_error("INVALID SSID", "The \"network_ssid\" field within secrets.json is invalid, please change it to match your Adafruit IO username.\nConfused? Visit adafru.it/123456 for detailed instructions."); + WS._ui_helper->show_scr_error( + "INVALID SSID", + "The \"network_ssid\" field within secrets.json is invalid, please " + "change it to match your Adafruit IO username.\nConfused? Visit " + "adafru.it/123456 for detailed instructions."); fsHalt(); } WS._network_pass = network_type_wifi_password; - // Optionally set the MQTT broker url (used to switch btween prod. and // staging) WS._mqttBrokerURL = doc["io_url"]; @@ -436,7 +456,7 @@ void Wippersnapper_FS::writeToBootOut(PGM_P str) { /**************************************************************************/ void Wippersnapper_FS::fsHalt() { while (1) { - //statusLEDSolid(WS_LED_STATUS_FS_WRITE); + // statusLEDSolid(WS_LED_STATUS_FS_WRITE); delay(1000); yield(); } From b8385cb9848af31b92ee3283368d635fc8526e59 Mon Sep 17 00:00:00 2001 From: brentru Date: Fri, 5 May 2023 17:24:49 -0400 Subject: [PATCH 11/90] rename skel to secrets, default brightness reflects what is on IO now --- src/provisioning/tinyusb/Wippersnapper_FS.cpp | 12 ++++++------ src/provisioning/tinyusb/Wippersnapper_FS.h | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/provisioning/tinyusb/Wippersnapper_FS.cpp b/src/provisioning/tinyusb/Wippersnapper_FS.cpp index 95256b364..6de2aace3 100644 --- a/src/provisioning/tinyusb/Wippersnapper_FS.cpp +++ b/src/provisioning/tinyusb/Wippersnapper_FS.cpp @@ -181,7 +181,7 @@ bool Wippersnapper_FS::initFilesystem() { // Check if secrets.json file already exists if (!configFileExists()) { // Create new secrets.json file and halt - createConfigFileSkel(); + createSecretsFile(); } return true; @@ -290,10 +290,10 @@ bool Wippersnapper_FS::createBootFile() { /**************************************************************************/ /*! - @brief Creates a skeleton secret.json file on the filesystem. + @brief Creates a default secrets.json file on the filesystem. */ /**************************************************************************/ -void Wippersnapper_FS::createConfigFileSkel() { +void Wippersnapper_FS::createSecretsFile() { // Create JSON object StaticJsonDocument<256> doc; doc["io_username"] = "YOUR_IO_USERNAME_HERE"; @@ -301,13 +301,13 @@ void Wippersnapper_FS::createConfigFileSkel() { JsonObject network_type_wifi = doc.createNestedObject("network_type_wifi"); network_type_wifi["network_ssid"] = "YOUR_WIFI_SSID_HERE"; network_type_wifi["network_password"] = "YOUR_WIFI_PASS_HERE"; - doc["status_pixel_brightness"] = "0.0"; + doc["status_pixel_brightness"] = "0.2"; // Serialize JSON object and write secrets.json to file File32 secretsFile = wipperFatFs.open("/secrets.json", FILE_WRITE); serializeJsonPretty(doc, secretsFile); - displayFile.flush(); - displayFile.close(); + secretsFile.flush(); + secretsFile.close(); delay(2500); writeToBootOut( diff --git a/src/provisioning/tinyusb/Wippersnapper_FS.h b/src/provisioning/tinyusb/Wippersnapper_FS.h index ec7067525..846f0eac9 100644 --- a/src/provisioning/tinyusb/Wippersnapper_FS.h +++ b/src/provisioning/tinyusb/Wippersnapper_FS.h @@ -52,7 +52,7 @@ class Wippersnapper_FS { void eraseBootFile(); bool configFileExists(); - void createConfigFileSkel(); + void createSecretsFile(); bool createBootFile(); void writeToBootOut(PGM_P str); void fsHalt(); From dfac9d03573ef40f37a95c0894959307b0b8e01f Mon Sep 17 00:00:00 2001 From: brentru Date: Mon, 8 May 2023 12:58:18 -0400 Subject: [PATCH 12/90] optimization notes --- src/Wippersnapper.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Wippersnapper.h b/src/Wippersnapper.h index 805c8a6c9..c22c5dd37 100644 --- a/src/Wippersnapper.h +++ b/src/Wippersnapper.h @@ -94,7 +94,7 @@ #endif #define WS_VERSION \ - "1.0.0-beta.62" ///< WipperSnapper app. version (semver-formatted) + "1.0.0-beta.64" ///< WipperSnapper app. version (semver-formatted) // Reserved Adafruit IO MQTT topics #define TOPIC_IO_THROTTLE "/throttle" ///< Adafruit IO Throttle MQTT Topic @@ -310,6 +310,8 @@ class Wippersnapper { ws_board_status_t _boardStatus = WS_BOARD_DEF_IDLE; ///< Hardware's registration status + // TODO: We really should look at making these static definitions, not dynamic + // to free up space on the heap Wippersnapper_DigitalGPIO *_digitalGPIO; ///< Instance of digital gpio class Wippersnapper_AnalogIO *_analogIO; ///< Instance of analog io class Wippersnapper_FS *_fileSystem; ///< Instance of Filesystem (native USB) @@ -321,8 +323,9 @@ class Wippersnapper { ws_pwm *_pwmComponent; ///< Instance of pwm class ws_servo *_servoComponent; ///< Instance of servo class ws_ds18x20 *_ds18x20Component; ///< Instance of DS18x20 class - + + // TODO: does this really need to be global? uint8_t _macAddr[6]; /*!< Unique network iface identifier */ char sUID[13]; /*!< Unique network iface identifier */ const char *_boardId; /*!< Adafruit IO+ board string */ @@ -339,6 +342,7 @@ class Wippersnapper { const char *_network_ssid = NULL; /*!< WiFi network SSID */ const char *_network_pass = NULL; /*!< WiFi network password*/ + // TODO: Does this need to be within this class? int32_t totalDigitalPins; /*!< Total number of digital-input capable pins */ char *_topic_description = NULL; /*!< MQTT topic for the device description */ From d3c78b239d813db83f76940db2e17b46ca31ad35 Mon Sep 17 00:00:00 2001 From: brentru Date: Mon, 8 May 2023 13:19:16 -0400 Subject: [PATCH 13/90] adding loading bar overhead --- src/Wippersnapper.cpp | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/src/Wippersnapper.cpp b/src/Wippersnapper.cpp index b1804e958..e5d71e5e9 100644 --- a/src/Wippersnapper.cpp +++ b/src/Wippersnapper.cpp @@ -122,6 +122,7 @@ void Wippersnapper::provision() { WS._ui_helper = new ws_display_ui_helper(); WS._ui_helper->set_bg_black(); WS._ui_helper->show_scr_load(); + WS._ui_helper->set_label_status("Validating Credentials..."); lv_task_handler(); @@ -136,6 +137,9 @@ void Wippersnapper::provision() { // Set device's wireless credentials set_ssid_pass(); + + WS._ui_helper->set_label_status(""); + WS._ui_helper->set_load_bar_icon_complete(loadBarIconFile); } /**************************************************************************/ @@ -1985,7 +1989,9 @@ void Wippersnapper::runNetFSM() { switch (fsmNetwork) { case FSM_NET_CHECK_MQTT: if (WS._mqtt->connected()) { - // WS_DEBUG_PRINTLN("Connected to Adafruit IO!"); + WS._ui_helper->set_load_bar_icon_complete(loadBarIconCloud); + WS._ui_helper->set_label_status("Registering device with IO..."); + WS_DEBUG_PRINTLN("Connected to Adafruit IO!"); fsmNetwork = FSM_NET_CONNECTED; return; } @@ -1993,7 +1999,7 @@ void Wippersnapper::runNetFSM() { break; case FSM_NET_CHECK_NETWORK: if (networkStatus() == WS_NET_CONNECTED) { - // WS_DEBUG_PRINTLN("Connected to WiFi!"); + WS_DEBUG_PRINTLN("Connected to WiFi!"); fsmNetwork = FSM_NET_ESTABLISH_MQTT; break; } @@ -2001,12 +2007,16 @@ void Wippersnapper::runNetFSM() { break; case FSM_NET_ESTABLISH_NETWORK: WS_DEBUG_PRINTLN("Attempting to connect to WiFi"); + // TODO: Pass in SSID as a string + WS._ui_helper->set_label_status("Scanning for SSID..."); + lv_task_handler(); // Perform a WiFi scan and check if SSID within // secrets.json is within the scanned SSIDs if (!check_valid_ssid()) haltError("ERROR: Unable to find WiFi network, rebooting soon...", WS_LED_STATUS_WIFI_CONNECTING); - + WS._ui_helper->set_label_status("Connecting to WiFi..."); + lv_task_handler(); // Attempt to connect to wireless network maxAttempts = 5; while (maxAttempts > 0) { @@ -2032,7 +2042,10 @@ void Wippersnapper::runNetFSM() { fsmNetwork = FSM_NET_CHECK_NETWORK; break; case FSM_NET_ESTABLISH_MQTT: - WS_DEBUG_PRINTLN("Attempting to connect to Adafruit IO..."); + WS_DEBUG_PRINTLN("Attempting to connect to IO..."); + WS._ui_helper->set_load_bar_icon_complete(loadBarIconWifi); + WS._ui_helper->set_label_status("Connecting to IO..."); + lv_task_handler(); WS._mqtt->setKeepAliveInterval(WS_KEEPALIVE_INTERVAL_MS / 1000); // Attempt to connect maxAttempts = 5; From afd7f6bd79d2eff8f35ef88b884df8de7f90f66d Mon Sep 17 00:00:00 2001 From: brentru Date: Mon, 8 May 2023 13:42:09 -0400 Subject: [PATCH 14/90] no stalling --- src/Wippersnapper.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/Wippersnapper.cpp b/src/Wippersnapper.cpp index e5d71e5e9..834343a33 100644 --- a/src/Wippersnapper.cpp +++ b/src/Wippersnapper.cpp @@ -1991,6 +1991,8 @@ void Wippersnapper::runNetFSM() { if (WS._mqtt->connected()) { WS._ui_helper->set_load_bar_icon_complete(loadBarIconCloud); WS._ui_helper->set_label_status("Registering device with IO..."); + delay(10); + lv_task_handler(); WS_DEBUG_PRINTLN("Connected to Adafruit IO!"); fsmNetwork = FSM_NET_CONNECTED; return; @@ -2000,6 +2002,9 @@ void Wippersnapper::runNetFSM() { case FSM_NET_CHECK_NETWORK: if (networkStatus() == WS_NET_CONNECTED) { WS_DEBUG_PRINTLN("Connected to WiFi!"); + WS._ui_helper->set_load_bar_icon_complete(loadBarIconWifi); + delay(10); + lv_task_handler(); fsmNetwork = FSM_NET_ESTABLISH_MQTT; break; } @@ -2008,15 +2013,14 @@ void Wippersnapper::runNetFSM() { case FSM_NET_ESTABLISH_NETWORK: WS_DEBUG_PRINTLN("Attempting to connect to WiFi"); // TODO: Pass in SSID as a string - WS._ui_helper->set_label_status("Scanning for SSID..."); + WS._ui_helper->set_label_status("Connecting to WiFi..."); + delay(10); lv_task_handler(); // Perform a WiFi scan and check if SSID within // secrets.json is within the scanned SSIDs if (!check_valid_ssid()) haltError("ERROR: Unable to find WiFi network, rebooting soon...", WS_LED_STATUS_WIFI_CONNECTING); - WS._ui_helper->set_label_status("Connecting to WiFi..."); - lv_task_handler(); // Attempt to connect to wireless network maxAttempts = 5; while (maxAttempts > 0) { @@ -2043,9 +2047,10 @@ void Wippersnapper::runNetFSM() { break; case FSM_NET_ESTABLISH_MQTT: WS_DEBUG_PRINTLN("Attempting to connect to IO..."); - WS._ui_helper->set_load_bar_icon_complete(loadBarIconWifi); +/* WS._ui_helper->set_load_bar_icon_complete(loadBarIconWifi); WS._ui_helper->set_label_status("Connecting to IO..."); - lv_task_handler(); + delay(10); + lv_task_handler(); */ WS._mqtt->setKeepAliveInterval(WS_KEEPALIVE_INTERVAL_MS / 1000); // Attempt to connect maxAttempts = 5; From 3aee9707ce84b87b585ab4eb142b71eb70d4e631 Mon Sep 17 00:00:00 2001 From: brentru Date: Mon, 8 May 2023 13:49:38 -0400 Subject: [PATCH 15/90] fix error, lv_style_reset --- src/Wippersnapper.cpp | 7 ++++++- src/display/ws_display_ui_helper.cpp | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Wippersnapper.cpp b/src/Wippersnapper.cpp index 834343a33..16ca85763 100644 --- a/src/Wippersnapper.cpp +++ b/src/Wippersnapper.cpp @@ -2067,10 +2067,15 @@ void Wippersnapper::runNetFSM() { delay(1800); maxAttempts--; } - if (fsmNetwork != FSM_NET_CHECK_MQTT) + if (fsmNetwork != FSM_NET_CHECK_MQTT) { + WS._ui_helper->show_scr_error("CONNECTION ERROR", "Unable to connect to Adafruit.io, rebooting in N seconds..."); + delay(10); + lv_task_handler(); haltError( "ERROR: Unable to connect to Adafruit.IO MQTT, rebooting soon...", WS_LED_STATUS_MQTT_CONNECTING); + } + break; default: break; diff --git a/src/display/ws_display_ui_helper.cpp b/src/display/ws_display_ui_helper.cpp index e97390669..b460511e1 100644 --- a/src/display/ws_display_ui_helper.cpp +++ b/src/display/ws_display_ui_helper.cpp @@ -205,7 +205,6 @@ void ws_display_ui_helper::clear_scr_load() { lv_style_reset(&styleIconWiFi); lv_style_reset(&styleIconCloud); lv_style_reset(&styleIconTurtle30px); - lv_style_reset(&styleIconCheckmark); // Stop the loading tip timer and delete the label remove_tip_timer(); lv_obj_del(lblTipText); @@ -225,6 +224,7 @@ void ws_display_ui_helper::show_scr_error(const char *lblError, Serial.println("ws_display_ui_helper"); // clear the active loading screen (for now, will eventually expand to take in // a scr obj.) + clear_scr_load(); // Create error symbol From a8753814a4247b19f29214a1f0a8c43cc8e9dc19 Mon Sep 17 00:00:00 2001 From: brentru Date: Tue, 9 May 2023 13:49:52 -0400 Subject: [PATCH 16/90] load wifi, trying to fix mqtt error --- src/Wippersnapper.cpp | 12 ++++++++++-- src/display/ws_display_ui_helper.cpp | 2 +- src/network_interfaces/Wippersnapper_ESP32.h | 4 ++-- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/Wippersnapper.cpp b/src/Wippersnapper.cpp index 16ca85763..4c5827158 100644 --- a/src/Wippersnapper.cpp +++ b/src/Wippersnapper.cpp @@ -121,8 +121,11 @@ void Wippersnapper::provision() { // UI Setup WS._ui_helper = new ws_display_ui_helper(); WS._ui_helper->set_bg_black(); + lv_task_handler(); WS._ui_helper->show_scr_load(); + lv_task_handler(); WS._ui_helper->set_label_status("Validating Credentials..."); + delay(10); lv_task_handler(); @@ -140,6 +143,8 @@ void Wippersnapper::provision() { WS._ui_helper->set_label_status(""); WS._ui_helper->set_load_bar_icon_complete(loadBarIconFile); + delay(10); + lv_task_handler(); } /**************************************************************************/ @@ -2047,10 +2052,13 @@ void Wippersnapper::runNetFSM() { break; case FSM_NET_ESTABLISH_MQTT: WS_DEBUG_PRINTLN("Attempting to connect to IO..."); -/* WS._ui_helper->set_load_bar_icon_complete(loadBarIconWifi); + WS_DEBUG_PRINTLN(WS._username); + WS_DEBUG_PRINTLN(WS._key); + + WS._ui_helper->set_load_bar_icon_complete(loadBarIconWifi); WS._ui_helper->set_label_status("Connecting to IO..."); delay(10); - lv_task_handler(); */ + lv_task_handler(); WS._mqtt->setKeepAliveInterval(WS_KEEPALIVE_INTERVAL_MS / 1000); // Attempt to connect maxAttempts = 5; diff --git a/src/display/ws_display_ui_helper.cpp b/src/display/ws_display_ui_helper.cpp index b460511e1..536da5d46 100644 --- a/src/display/ws_display_ui_helper.cpp +++ b/src/display/ws_display_ui_helper.cpp @@ -187,7 +187,7 @@ void ws_display_ui_helper::show_scr_load() { lv_obj_set_style_text_color(lblTipText, lv_color_white(), LV_PART_MAIN); lv_label_set_text(lblTipText, "\0"); lv_obj_align(lblTipText, LV_ALIGN_BOTTOM_LEFT, 0, -40); - timerLoadTips = lv_timer_create(lv_timer_tips_cb, 500, NULL); + timerLoadTips = lv_timer_create(lv_timer_tips_cb, 2000, NULL); } /**************************************************************************/ diff --git a/src/network_interfaces/Wippersnapper_ESP32.h b/src/network_interfaces/Wippersnapper_ESP32.h index c8635bf85..0b50adcaf 100644 --- a/src/network_interfaces/Wippersnapper_ESP32.h +++ b/src/network_interfaces/Wippersnapper_ESP32.h @@ -146,15 +146,15 @@ class Wippersnapper_ESP32 : public Wippersnapper { /********************************************************/ void setupMQTTClient(const char *clientID) { if (WS._mqttBrokerURL == nullptr) { + WS_DEBUG_PRINT("Setting io.adafruit.com and root cert..."); WS._mqttBrokerURL = "io.adafruit.com"; _mqtt_client->setCACert(_aio_root_ca_prod); } else { _mqtt_client->setCACert(_aio_root_ca_staging); } - WS._mqtt = new Adafruit_MQTT_Client(_mqtt_client, WS._mqttBrokerURL, WS._mqtt_port, - clientID, WS._username, WS._key); + clientID, "brubell", "aio_wyjT377nvCaZQApeYk4WcG1lSeOp"); } /********************************************************/ From f4c556083919d90e154700d307679c426c6e3776 Mon Sep 17 00:00:00 2001 From: brentru Date: Tue, 9 May 2023 14:27:56 -0400 Subject: [PATCH 17/90] diff --- src/Wippersnapper.cpp | 13 ++++--------- src/network_interfaces/Wippersnapper_ESP32.h | 5 ++--- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/src/Wippersnapper.cpp b/src/Wippersnapper.cpp index 4c5827158..976ffaf24 100644 --- a/src/Wippersnapper.cpp +++ b/src/Wippersnapper.cpp @@ -2052,18 +2052,13 @@ void Wippersnapper::runNetFSM() { break; case FSM_NET_ESTABLISH_MQTT: WS_DEBUG_PRINTLN("Attempting to connect to IO..."); - WS_DEBUG_PRINTLN(WS._username); - WS_DEBUG_PRINTLN(WS._key); - - WS._ui_helper->set_load_bar_icon_complete(loadBarIconWifi); - WS._ui_helper->set_label_status("Connecting to IO..."); - delay(10); - lv_task_handler(); - WS._mqtt->setKeepAliveInterval(WS_KEEPALIVE_INTERVAL_MS / 1000); + WS_DEBUG_PRINT("NETWORK STATUS: "); WS_DEBUG_PRINTLN(networkStatus()); + // WS._mqtt->setKeepAliveInterval(WS_KEEPALIVE_INTERVAL_MS / 1000); // Attempt to connect maxAttempts = 5; while (maxAttempts > 0) { - statusLEDBlink(WS_LED_STATUS_MQTT_CONNECTING); + // statusLEDBlink(WS_LED_STATUS_MQTT_CONNECTING); + WS_DEBUG_PRINT("NETWORK STATUS: "); WS_DEBUG_PRINTLN(networkStatus()); int8_t mqttRC = WS._mqtt->connect(); if (mqttRC == WS_MQTT_CONNECTED) { fsmNetwork = FSM_NET_CHECK_MQTT; diff --git a/src/network_interfaces/Wippersnapper_ESP32.h b/src/network_interfaces/Wippersnapper_ESP32.h index 0b50adcaf..d565425bd 100644 --- a/src/network_interfaces/Wippersnapper_ESP32.h +++ b/src/network_interfaces/Wippersnapper_ESP32.h @@ -146,15 +146,14 @@ class Wippersnapper_ESP32 : public Wippersnapper { /********************************************************/ void setupMQTTClient(const char *clientID) { if (WS._mqttBrokerURL == nullptr) { - WS_DEBUG_PRINT("Setting io.adafruit.com and root cert..."); WS._mqttBrokerURL = "io.adafruit.com"; _mqtt_client->setCACert(_aio_root_ca_prod); } else { _mqtt_client->setCACert(_aio_root_ca_staging); } WS._mqtt = - new Adafruit_MQTT_Client(_mqtt_client, WS._mqttBrokerURL, WS._mqtt_port, - clientID, "brubell", "aio_wyjT377nvCaZQApeYk4WcG1lSeOp"); + new Adafruit_MQTT_Client(_mqtt_client, WS._mqttBrokerURL, 8883, + clientID, WS._username , WS._key); } /********************************************************/ From 4701ed54fc30494649fbfabc6ecae43bb8884437 Mon Sep 17 00:00:00 2001 From: brentru Date: Tue, 9 May 2023 14:33:40 -0400 Subject: [PATCH 18/90] put network iface back --- src/Wippersnapper.cpp | 20 ++++++++++---------- src/network_interfaces/Wippersnapper_ESP32.h | 5 +++-- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/src/Wippersnapper.cpp b/src/Wippersnapper.cpp index 976ffaf24..6c32b5de8 100644 --- a/src/Wippersnapper.cpp +++ b/src/Wippersnapper.cpp @@ -1994,10 +1994,10 @@ void Wippersnapper::runNetFSM() { switch (fsmNetwork) { case FSM_NET_CHECK_MQTT: if (WS._mqtt->connected()) { - WS._ui_helper->set_load_bar_icon_complete(loadBarIconCloud); - WS._ui_helper->set_label_status("Registering device with IO..."); - delay(10); - lv_task_handler(); + //WS._ui_helper->set_load_bar_icon_complete(loadBarIconCloud); + //WS._ui_helper->set_label_status("Registering device with IO..."); + //delay(10); + //lv_task_handler(); WS_DEBUG_PRINTLN("Connected to Adafruit IO!"); fsmNetwork = FSM_NET_CONNECTED; return; @@ -2007,9 +2007,9 @@ void Wippersnapper::runNetFSM() { case FSM_NET_CHECK_NETWORK: if (networkStatus() == WS_NET_CONNECTED) { WS_DEBUG_PRINTLN("Connected to WiFi!"); - WS._ui_helper->set_load_bar_icon_complete(loadBarIconWifi); - delay(10); - lv_task_handler(); + //WS._ui_helper->set_load_bar_icon_complete(loadBarIconWifi); + //delay(10); + //lv_task_handler(); fsmNetwork = FSM_NET_ESTABLISH_MQTT; break; } @@ -2018,9 +2018,9 @@ void Wippersnapper::runNetFSM() { case FSM_NET_ESTABLISH_NETWORK: WS_DEBUG_PRINTLN("Attempting to connect to WiFi"); // TODO: Pass in SSID as a string - WS._ui_helper->set_label_status("Connecting to WiFi..."); - delay(10); - lv_task_handler(); + //WS._ui_helper->set_label_status("Connecting to WiFi..."); + //delay(10); + //lv_task_handler(); // Perform a WiFi scan and check if SSID within // secrets.json is within the scanned SSIDs if (!check_valid_ssid()) diff --git a/src/network_interfaces/Wippersnapper_ESP32.h b/src/network_interfaces/Wippersnapper_ESP32.h index d565425bd..c8635bf85 100644 --- a/src/network_interfaces/Wippersnapper_ESP32.h +++ b/src/network_interfaces/Wippersnapper_ESP32.h @@ -151,9 +151,10 @@ class Wippersnapper_ESP32 : public Wippersnapper { } else { _mqtt_client->setCACert(_aio_root_ca_staging); } + WS._mqtt = - new Adafruit_MQTT_Client(_mqtt_client, WS._mqttBrokerURL, 8883, - clientID, WS._username , WS._key); + new Adafruit_MQTT_Client(_mqtt_client, WS._mqttBrokerURL, WS._mqtt_port, + clientID, WS._username, WS._key); } /********************************************************/ From bd8bbc45610515d1888f36dc5cab9672158964c9 Mon Sep 17 00:00:00 2001 From: brentru Date: Wed, 10 May 2023 16:56:20 -0400 Subject: [PATCH 19/90] freeRTOS work --- src/Wippersnapper.cpp | 47 ++++++++++++------- src/display/ws_display_driver.cpp | 12 ++++- src/display/ws_display_driver.h | 2 + src/display/ws_display_ui_helper.cpp | 2 + src/provisioning/tinyusb/Wippersnapper_FS.cpp | 20 ++++---- 5 files changed, 55 insertions(+), 28 deletions(-) diff --git a/src/Wippersnapper.cpp b/src/Wippersnapper.cpp index 6c32b5de8..5de0c70ee 100644 --- a/src/Wippersnapper.cpp +++ b/src/Wippersnapper.cpp @@ -84,6 +84,13 @@ Wippersnapper::~Wippersnapper() { free(_throttle_sub); } +void stats_timer(lv_timer_t * timer) { + Serial.printf("Size: %d\tFree: %d\tMaxAlloc: %d\t PSFree: %d\n", ESP.getHeapSize(), ESP.getFreeHeap(), \ + ESP.getMaxAllocHeap(), \ + ESP.getFreePsram()); ///< ESP32 memory check macro + lv_timer_reset(timer); +} + /**************************************************************************/ /*! @brief Provisions a WipperSnapper device with its network @@ -118,16 +125,20 @@ void Wippersnapper::provision() { // Where do we log this? WS._display->enableLogging(); - // UI Setup - WS._ui_helper = new ws_display_ui_helper(); - WS._ui_helper->set_bg_black(); - lv_task_handler(); - WS._ui_helper->show_scr_load(); - lv_task_handler(); - WS._ui_helper->set_label_status("Validating Credentials..."); - delay(10); - lv_task_handler(); + //lv_timer_t * timer = lv_timer_create(stats_timer, 100, NULL); + // UI Setup + //WS._ui_helper = new ws_display_ui_helper(); + // lvgl_port_lock(); + //WS._ui_helper->set_bg_black(); + //lv_task_handler(); + // lvgl_port_unlock(); + + //WS._ui_helper->show_scr_load(); + //lv_task_handler(); + //WS._ui_helper->set_label_status("Validating Credentials..."); + //delay(10); + //lv_task_handler(); // TODO: Add display error modes within parseSecrets() #ifdef USE_TINYUSB @@ -140,11 +151,10 @@ void Wippersnapper::provision() { // Set device's wireless credentials set_ssid_pass(); - - WS._ui_helper->set_label_status(""); - WS._ui_helper->set_load_bar_icon_complete(loadBarIconFile); - delay(10); - lv_task_handler(); + //WS._ui_helper->set_label_status(""); + //WS._ui_helper->set_load_bar_icon_complete(loadBarIconFile); + //delay(10); + //lv_task_handler(); } /**************************************************************************/ @@ -2053,6 +2063,7 @@ void Wippersnapper::runNetFSM() { case FSM_NET_ESTABLISH_MQTT: WS_DEBUG_PRINTLN("Attempting to connect to IO..."); WS_DEBUG_PRINT("NETWORK STATUS: "); WS_DEBUG_PRINTLN(networkStatus()); + MEMCK; // WS._mqtt->setKeepAliveInterval(WS_KEEPALIVE_INTERVAL_MS / 1000); // Attempt to connect maxAttempts = 5; @@ -2071,9 +2082,11 @@ void Wippersnapper::runNetFSM() { maxAttempts--; } if (fsmNetwork != FSM_NET_CHECK_MQTT) { - WS._ui_helper->show_scr_error("CONNECTION ERROR", "Unable to connect to Adafruit.io, rebooting in N seconds..."); - delay(10); - lv_task_handler(); + // lvgl_port_lock(); + //WS._ui_helper->show_scr_error("CONNECTION ERROR", "Unable to connect to Adafruit.io, rebooting in N seconds..."); + //delay(10); + // lv_task_handler(); + // lvgl_port_unlock(); haltError( "ERROR: Unable to connect to Adafruit.IO MQTT, rebooting soon...", WS_LED_STATUS_MQTT_CONNECTING); diff --git a/src/display/ws_display_driver.cpp b/src/display/ws_display_driver.cpp index 2b5b9c757..e7c2d2e28 100644 --- a/src/display/ws_display_driver.cpp +++ b/src/display/ws_display_driver.cpp @@ -137,9 +137,19 @@ bool ws_display_driver::begin() { Serial.printf("LVGL_Glue error %d\r\n", (int)status); return false; } + WS_DEBUG_PRINTLN("Setting screen BLACK"); + esp32_lvgl_acquire(); lv_obj_set_style_bg_color(lv_scr_act(), lv_color_white(), LV_STATE_DEFAULT); - lv_task_handler(); + esp32_lvgl_release(); return true; +} + +void ws_display_driver::esp32_lvgl_acquire() { + _glue->lvgl_acquire(); +} + +void ws_display_driver::esp32_lvgl_release() { + _glue->lvgl_release(); } \ No newline at end of file diff --git a/src/display/ws_display_driver.h b/src/display/ws_display_driver.h index ab7fc927b..649571d60 100644 --- a/src/display/ws_display_driver.h +++ b/src/display/ws_display_driver.h @@ -55,6 +55,8 @@ class ws_display_driver { void setRotation(uint8_t rotationMode); void enableLogging(); Adafruit_LvGL_Glue *_glue; + void esp32_lvgl_acquire(); + void esp32_lvgl_release(); private: Adafruit_ST7789 *_tft_st7789 = nullptr; diff --git a/src/display/ws_display_ui_helper.cpp b/src/display/ws_display_ui_helper.cpp index 536da5d46..3d569f98a 100644 --- a/src/display/ws_display_ui_helper.cpp +++ b/src/display/ws_display_ui_helper.cpp @@ -15,6 +15,8 @@ #include "ws_display_ui_helper.h" + + /**************************************************************************/ /*! @brief Changes a label every 2 seconds to a new, random, tip. diff --git a/src/provisioning/tinyusb/Wippersnapper_FS.cpp b/src/provisioning/tinyusb/Wippersnapper_FS.cpp index 6de2aace3..7ca414d1b 100644 --- a/src/provisioning/tinyusb/Wippersnapper_FS.cpp +++ b/src/provisioning/tinyusb/Wippersnapper_FS.cpp @@ -312,11 +312,11 @@ void Wippersnapper_FS::createSecretsFile() { writeToBootOut( "* Please edit the secrets.json file. Then, reset your board.\n"); - WS._ui_helper->show_scr_error( +/* WS._ui_helper->show_scr_error( "INVALID SETTINGS FILE", "The settings.json file on the WIPPER drive contains default values. " "Please edit it to reflect your Adafruit IO and network credentials. " - "When you're done, press RESET on the board."); + "When you're done, press RESET on the board."); */ fsHalt(); } @@ -348,11 +348,11 @@ void Wippersnapper_FS::parseSecrets() { strcmp(io_username, "YOUR_IO_USERNAME_HERE") == 0) { WS_DEBUG_PRINTLN("ERROR: invalid io_username value in secrets.json!"); writeToBootOut("ERROR: invalid io_username value in secrets.json!\n"); - WS._ui_helper->show_scr_error( +/* WS._ui_helper->show_scr_error( "INVALID USERNAME", "The \"io_username\" field within secrets.json is invalid, please " "change it to match your Adafruit IO username.\nConfused? Visit " - "adafru.it/123456 for detailed instructions."); + "adafru.it/123456 for detailed instructions."); */ fsHalt(); } // Set io_username @@ -363,11 +363,11 @@ void Wippersnapper_FS::parseSecrets() { if (io_key == nullptr) { WS_DEBUG_PRINTLN("ERROR: invalid io_key value in secrets.json!"); writeToBootOut("ERROR: invalid io_key value in secrets.json!\n"); - WS._ui_helper->show_scr_error( +/* WS._ui_helper->show_scr_error( "INVALID IO KEY", "The \"io_key\" field within secrets.json is invalid, please change it " "to match your Adafruit IO username.\nConfused? Visit adafru.it/123456 " - "for detailed instructions."); + "for detailed instructions."); */ fsHalt(); } WS._key = io_key; @@ -378,11 +378,11 @@ void Wippersnapper_FS::parseSecrets() { strcmp(network_type_wifi_ssid, "YOUR_WIFI_SSID_HERE") == 0) { WS_DEBUG_PRINTLN("ERROR: invalid network_ssid value in secrets.json!"); writeToBootOut("ERROR: invalid network_ssid value in secrets.json!\n"); - WS._ui_helper->show_scr_error( +/* WS._ui_helper->show_scr_error( "INVALID SSID", "The \"network_ssid\" field within secrets.json is invalid, please " "change it to match your Adafruit IO username.\nConfused? Visit " - "adafru.it/123456 for detailed instructions."); + "adafru.it/123456 for detailed instructions."); */ fsHalt(); } // Set network SSID @@ -397,11 +397,11 @@ void Wippersnapper_FS::parseSecrets() { "secrets.json!"); writeToBootOut("ERROR: invalid network_type_wifi_password value in " "secrets.json!\n"); - WS._ui_helper->show_scr_error( +/* WS._ui_helper->show_scr_error( "INVALID SSID", "The \"network_ssid\" field within secrets.json is invalid, please " "change it to match your Adafruit IO username.\nConfused? Visit " - "adafru.it/123456 for detailed instructions."); + "adafru.it/123456 for detailed instructions."); */ fsHalt(); } WS._network_pass = network_type_wifi_password; From 9a323ebcb07178d9fef87e12e6d274b038e2626e Mon Sep 17 00:00:00 2001 From: brentru Date: Wed, 10 May 2023 17:16:10 -0400 Subject: [PATCH 20/90] use lvgl release --- src/Wippersnapper.cpp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/Wippersnapper.cpp b/src/Wippersnapper.cpp index 5de0c70ee..2025fbf1b 100644 --- a/src/Wippersnapper.cpp +++ b/src/Wippersnapper.cpp @@ -123,22 +123,17 @@ void Wippersnapper::provision() { "Unable to enable display driver and LVGL"); // TODO: Maybe fail out and // revert to non-display? // Where do we log this? - WS._display->enableLogging(); + // WS._display->enableLogging(); //lv_timer_t * timer = lv_timer_create(stats_timer, 100, NULL); // UI Setup //WS._ui_helper = new ws_display_ui_helper(); - // lvgl_port_lock(); + //WS._display->esp32_lvgl_acquire(); //WS._ui_helper->set_bg_black(); - //lv_task_handler(); - // lvgl_port_unlock(); - //WS._ui_helper->show_scr_load(); - //lv_task_handler(); //WS._ui_helper->set_label_status("Validating Credentials..."); - //delay(10); - //lv_task_handler(); + //WS._display->esp32_lvgl_release(); // TODO: Add display error modes within parseSecrets() #ifdef USE_TINYUSB From 985e80f696791d7e7362dc1f678db683be0054f8 Mon Sep 17 00:00:00 2001 From: brentru Date: Thu, 11 May 2023 12:54:28 -0400 Subject: [PATCH 21/90] pass _display driver into ui helper to allow the helper methods to automatically handle the mutex sync object lock/unlock rather than app code --- src/Wippersnapper.cpp | 63 ++++++++----------- src/display/ws_display_ui_helper.cpp | 24 ++++--- src/display/ws_display_ui_helper.h | 26 +++++--- src/provisioning/tinyusb/Wippersnapper_FS.cpp | 20 +++--- 4 files changed, 67 insertions(+), 66 deletions(-) diff --git a/src/Wippersnapper.cpp b/src/Wippersnapper.cpp index 2025fbf1b..8d13217d7 100644 --- a/src/Wippersnapper.cpp +++ b/src/Wippersnapper.cpp @@ -84,11 +84,11 @@ Wippersnapper::~Wippersnapper() { free(_throttle_sub); } -void stats_timer(lv_timer_t * timer) { - Serial.printf("Size: %d\tFree: %d\tMaxAlloc: %d\t PSFree: %d\n", ESP.getHeapSize(), ESP.getFreeHeap(), \ - ESP.getMaxAllocHeap(), \ - ESP.getFreePsram()); ///< ESP32 memory check macro - lv_timer_reset(timer); +void stats_timer(lv_timer_t *timer) { + Serial.printf("Size: %d\tFree: %d\tMaxAlloc: %d\t PSFree: %d\n", + ESP.getHeapSize(), ESP.getFreeHeap(), ESP.getMaxAllocHeap(), + ESP.getFreePsram()); ///< ESP32 memory check macro + lv_timer_reset(timer); } /**************************************************************************/ @@ -123,17 +123,15 @@ void Wippersnapper::provision() { "Unable to enable display driver and LVGL"); // TODO: Maybe fail out and // revert to non-display? // Where do we log this? - // WS._display->enableLogging(); + WS._display->enableLogging(); - //lv_timer_t * timer = lv_timer_create(stats_timer, 100, NULL); + // lv_timer_t * timer = lv_timer_create(stats_timer, 100, NULL); // UI Setup - //WS._ui_helper = new ws_display_ui_helper(); - //WS._display->esp32_lvgl_acquire(); - //WS._ui_helper->set_bg_black(); - //WS._ui_helper->show_scr_load(); - //WS._ui_helper->set_label_status("Validating Credentials..."); - //WS._display->esp32_lvgl_release(); + WS._ui_helper = new ws_display_ui_helper(WS._display); + WS._ui_helper->set_bg_black(); + WS._ui_helper->show_scr_load(); + WS._ui_helper->set_label_status("Validating Credentials..."); // TODO: Add display error modes within parseSecrets() #ifdef USE_TINYUSB @@ -146,10 +144,8 @@ void Wippersnapper::provision() { // Set device's wireless credentials set_ssid_pass(); - //WS._ui_helper->set_label_status(""); - //WS._ui_helper->set_load_bar_icon_complete(loadBarIconFile); - //delay(10); - //lv_task_handler(); + WS._ui_helper->set_label_status(""); + WS._ui_helper->set_load_bar_icon_complete(loadBarIconFile); } /**************************************************************************/ @@ -1999,10 +1995,8 @@ void Wippersnapper::runNetFSM() { switch (fsmNetwork) { case FSM_NET_CHECK_MQTT: if (WS._mqtt->connected()) { - //WS._ui_helper->set_load_bar_icon_complete(loadBarIconCloud); - //WS._ui_helper->set_label_status("Registering device with IO..."); - //delay(10); - //lv_task_handler(); + WS._ui_helper->set_load_bar_icon_complete(loadBarIconCloud); + WS._ui_helper->set_label_status("Registering device with IO..."); WS_DEBUG_PRINTLN("Connected to Adafruit IO!"); fsmNetwork = FSM_NET_CONNECTED; return; @@ -2012,9 +2006,7 @@ void Wippersnapper::runNetFSM() { case FSM_NET_CHECK_NETWORK: if (networkStatus() == WS_NET_CONNECTED) { WS_DEBUG_PRINTLN("Connected to WiFi!"); - //WS._ui_helper->set_load_bar_icon_complete(loadBarIconWifi); - //delay(10); - //lv_task_handler(); + WS._ui_helper->set_load_bar_icon_complete(loadBarIconWifi); fsmNetwork = FSM_NET_ESTABLISH_MQTT; break; } @@ -2023,11 +2015,10 @@ void Wippersnapper::runNetFSM() { case FSM_NET_ESTABLISH_NETWORK: WS_DEBUG_PRINTLN("Attempting to connect to WiFi"); // TODO: Pass in SSID as a string - //WS._ui_helper->set_label_status("Connecting to WiFi..."); - //delay(10); - //lv_task_handler(); + WS._ui_helper->set_label_status("Connecting to WiFi..."); // Perform a WiFi scan and check if SSID within // secrets.json is within the scanned SSIDs + // TODO: add signaling for display in check below if (!check_valid_ssid()) haltError("ERROR: Unable to find WiFi network, rebooting soon...", WS_LED_STATUS_WIFI_CONNECTING); @@ -2057,14 +2048,15 @@ void Wippersnapper::runNetFSM() { break; case FSM_NET_ESTABLISH_MQTT: WS_DEBUG_PRINTLN("Attempting to connect to IO..."); - WS_DEBUG_PRINT("NETWORK STATUS: "); WS_DEBUG_PRINTLN(networkStatus()); - MEMCK; - // WS._mqtt->setKeepAliveInterval(WS_KEEPALIVE_INTERVAL_MS / 1000); + WS_DEBUG_PRINT("NETWORK STATUS: "); + WS_DEBUG_PRINTLN(networkStatus()); + WS._mqtt->setKeepAliveInterval(WS_KEEPALIVE_INTERVAL_MS / 1000); // Attempt to connect maxAttempts = 5; while (maxAttempts > 0) { // statusLEDBlink(WS_LED_STATUS_MQTT_CONNECTING); - WS_DEBUG_PRINT("NETWORK STATUS: "); WS_DEBUG_PRINTLN(networkStatus()); + WS_DEBUG_PRINT("NETWORK STATUS: "); + WS_DEBUG_PRINTLN(networkStatus()); int8_t mqttRC = WS._mqtt->connect(); if (mqttRC == WS_MQTT_CONNECTED) { fsmNetwork = FSM_NET_CHECK_MQTT; @@ -2077,11 +2069,9 @@ void Wippersnapper::runNetFSM() { maxAttempts--; } if (fsmNetwork != FSM_NET_CHECK_MQTT) { - // lvgl_port_lock(); - //WS._ui_helper->show_scr_error("CONNECTION ERROR", "Unable to connect to Adafruit.io, rebooting in N seconds..."); - //delay(10); - // lv_task_handler(); - // lvgl_port_unlock(); + WS._ui_helper->show_scr_error( + "CONNECTION ERROR", + "Unable to connect to Adafruit.io, rebooting in N seconds..."); haltError( "ERROR: Unable to connect to Adafruit.IO MQTT, rebooting soon...", WS_LED_STATUS_MQTT_CONNECTING); @@ -2341,7 +2331,6 @@ void printDeviceInfo() { void Wippersnapper::connect() { WS_DEBUG_PRINTLN("Adafruit.io WipperSnapper"); - // Dump device info to the serial monitor printDeviceInfo(); diff --git a/src/display/ws_display_ui_helper.cpp b/src/display/ws_display_ui_helper.cpp index 3d569f98a..7a391d09d 100644 --- a/src/display/ws_display_ui_helper.cpp +++ b/src/display/ws_display_ui_helper.cpp @@ -15,8 +15,6 @@ #include "ws_display_ui_helper.h" - - /**************************************************************************/ /*! @brief Changes a label every 2 seconds to a new, random, tip. @@ -27,7 +25,9 @@ void lv_timer_tips_cb(lv_timer_t *timer) { Serial.println("Timer tips cb called"); long tipNum = random(0, sizeof(loading_tips) / sizeof(loading_tips[0])); + // _dispDriver->esp32_lvgl_acquire(); lv_label_set_text(lblTipText, loading_tips[tipNum]); + // _dispDriver->esp32_lvgl_release(); } /**************************************************************************/ @@ -55,7 +55,9 @@ static void label_status_cb(lv_event_t *event) { void ws_display_ui_helper::set_label_status(const char *text) { Serial.print("set_label_status (text): "); Serial.println(text); + _dispDriver->esp32_lvgl_acquire(); lv_event_send(lblStatusText, LV_EVENT_REFRESH, &text); + _dispDriver->esp32_lvgl_release(); } /**************************************************************************/ @@ -74,7 +76,9 @@ void ws_display_ui_helper::remove_tip_timer() { */ /**************************************************************************/ void ws_display_ui_helper::set_bg_black() { + _dispDriver->esp32_lvgl_acquire(); lv_obj_set_style_bg_color(lv_scr_act(), lv_color_black(), LV_STATE_DEFAULT); + _dispDriver->esp32_lvgl_release(); } /**************************************************************************/ @@ -109,12 +113,11 @@ void ws_display_ui_helper::set_load_bar_icon_complete(loadBarIcons iconType) { Serial.println("ERROR: Undefined iconType!"); return; } - + _dispDriver->esp32_lvgl_acquire(); // set icon's color and refresh lv_style_set_text_color(styleIcon, lv_palette_main(LV_PALETTE_GREEN)); lv_obj_refresh_style(objIcon, LV_PART_MAIN, LV_STYLE_PROP_ANY); - - lv_task_handler(); + _dispDriver->esp32_lvgl_release(); } /**************************************************************************/ @@ -123,7 +126,7 @@ void ws_display_ui_helper::set_load_bar_icon_complete(loadBarIcons iconType) { */ /**************************************************************************/ void ws_display_ui_helper::show_scr_load() { - + _dispDriver->esp32_lvgl_acquire(); // Icon bar const lv_coord_t iconBarXStart = 20; // Coordinate where the icon bar begins, on the X axis @@ -189,7 +192,9 @@ void ws_display_ui_helper::show_scr_load() { lv_obj_set_style_text_color(lblTipText, lv_color_white(), LV_PART_MAIN); lv_label_set_text(lblTipText, "\0"); lv_obj_align(lblTipText, LV_ALIGN_BOTTOM_LEFT, 0, -40); - timerLoadTips = lv_timer_create(lv_timer_tips_cb, 2000, NULL); + timerLoadTips = lv_timer_create(lv_timer_tips_cb, 3000, NULL); + + _dispDriver->esp32_lvgl_release(); } /**************************************************************************/ @@ -205,6 +210,7 @@ void ws_display_ui_helper::clear_scr_load() { lv_obj_del(labelCloudBar); // Clear all properties from styles and free all allocated memory lv_style_reset(&styleIconWiFi); + lv_style_reset(&styleIconFile); lv_style_reset(&styleIconCloud); lv_style_reset(&styleIconTurtle30px); // Stop the loading tip timer and delete the label @@ -227,6 +233,7 @@ void ws_display_ui_helper::show_scr_error(const char *lblError, // clear the active loading screen (for now, will eventually expand to take in // a scr obj.) + _dispDriver->esp32_lvgl_acquire(); clear_scr_load(); // Create error symbol @@ -262,6 +269,5 @@ void ws_display_ui_helper::show_scr_error(const char *lblError, lv_obj_set_width(labelErrorBody, 220); lv_obj_align(labelErrorBody, LV_ALIGN_CENTER, -3, 55); - // call task handler - lv_task_handler(); + _dispDriver->esp32_lvgl_release(); } \ No newline at end of file diff --git a/src/display/ws_display_ui_helper.h b/src/display/ws_display_ui_helper.h index a1e736b7f..ef0f2aafe 100644 --- a/src/display/ws_display_ui_helper.h +++ b/src/display/ws_display_ui_helper.h @@ -17,16 +17,17 @@ #define WS_DISPLAY_UI_HELPER_H #include "Wippersnapper.h" -#include #include "ws_display_driver.h" #include "ws_display_tooltips.h" +#include // External Fonts -#define SYMBOL_CODE "\xEF\x87\x89" ///< Symbol code for file icon -#define SYMBOL_WIFI "\xEF\x87\xAB" ///< Symbol code for WiFi icon -#define SYMBOL_TURTLE30PX "\xEF\x9C\xA6" ///< Symbol code for turtle icon -#define SYMBOL_CLOUD "\xEF\x83\x82" ///< Symbol code for cloud icon -#define SYMBOL_ERROR_TRIANGLE "\xEF\x81\xB1" ///< Symbol code for error triangle icon +#define SYMBOL_CODE "\xEF\x87\x89" ///< Symbol code for file icon +#define SYMBOL_WIFI "\xEF\x87\xAB" ///< Symbol code for WiFi icon +#define SYMBOL_TURTLE30PX "\xEF\x9C\xA6" ///< Symbol code for turtle icon +#define SYMBOL_CLOUD "\xEF\x83\x82" ///< Symbol code for cloud icon +#define SYMBOL_ERROR_TRIANGLE \ + "\xEF\x81\xB1" ///< Symbol code for error triangle icon LV_FONT_DECLARE(errorTriangle); LV_FONT_DECLARE(file); LV_FONT_DECLARE(wifi_30px); @@ -73,9 +74,12 @@ enum loadBarIcons { }; ///< Icon names for use by set_load_bar_icon_complete // holds all the loading tips -static const char* loading_tips[4] = { WS_LOADING_TIP_1, WS_LOADING_TIP_2, WS_LOADING_TIP_3, WS_LOADING_TIP_4 }; +static const char *loading_tips[4] = {WS_LOADING_TIP_1, WS_LOADING_TIP_2, + WS_LOADING_TIP_3, WS_LOADING_TIP_4}; + +static lv_timer_t *timerLoadTips; -static lv_timer_t * timerLoadTips; +class ws_display_driver; /**************************************************************************/ /*! @@ -85,11 +89,10 @@ static lv_timer_t * timerLoadTips; /**************************************************************************/ class ws_display_ui_helper { public: - ws_display_ui_helper(){}; + ws_display_ui_helper(ws_display_driver *drv) { _dispDriver = drv; }; ~ws_display_ui_helper(){}; void set_bg_black(); - void show_scr_load(); void clear_scr_load(); void set_load_bar_icon_complete(loadBarIcons iconType); @@ -97,5 +100,8 @@ class ws_display_ui_helper { void remove_tip_timer(); void show_scr_error(const char *lblError, const char *lblDesc); + +private: + ws_display_driver *_dispDriver = nullptr; }; #endif // WS_DISPLAY_UI_HELPER_H diff --git a/src/provisioning/tinyusb/Wippersnapper_FS.cpp b/src/provisioning/tinyusb/Wippersnapper_FS.cpp index 7ca414d1b..6de2aace3 100644 --- a/src/provisioning/tinyusb/Wippersnapper_FS.cpp +++ b/src/provisioning/tinyusb/Wippersnapper_FS.cpp @@ -312,11 +312,11 @@ void Wippersnapper_FS::createSecretsFile() { writeToBootOut( "* Please edit the secrets.json file. Then, reset your board.\n"); -/* WS._ui_helper->show_scr_error( + WS._ui_helper->show_scr_error( "INVALID SETTINGS FILE", "The settings.json file on the WIPPER drive contains default values. " "Please edit it to reflect your Adafruit IO and network credentials. " - "When you're done, press RESET on the board."); */ + "When you're done, press RESET on the board."); fsHalt(); } @@ -348,11 +348,11 @@ void Wippersnapper_FS::parseSecrets() { strcmp(io_username, "YOUR_IO_USERNAME_HERE") == 0) { WS_DEBUG_PRINTLN("ERROR: invalid io_username value in secrets.json!"); writeToBootOut("ERROR: invalid io_username value in secrets.json!\n"); -/* WS._ui_helper->show_scr_error( + WS._ui_helper->show_scr_error( "INVALID USERNAME", "The \"io_username\" field within secrets.json is invalid, please " "change it to match your Adafruit IO username.\nConfused? Visit " - "adafru.it/123456 for detailed instructions."); */ + "adafru.it/123456 for detailed instructions."); fsHalt(); } // Set io_username @@ -363,11 +363,11 @@ void Wippersnapper_FS::parseSecrets() { if (io_key == nullptr) { WS_DEBUG_PRINTLN("ERROR: invalid io_key value in secrets.json!"); writeToBootOut("ERROR: invalid io_key value in secrets.json!\n"); -/* WS._ui_helper->show_scr_error( + WS._ui_helper->show_scr_error( "INVALID IO KEY", "The \"io_key\" field within secrets.json is invalid, please change it " "to match your Adafruit IO username.\nConfused? Visit adafru.it/123456 " - "for detailed instructions."); */ + "for detailed instructions."); fsHalt(); } WS._key = io_key; @@ -378,11 +378,11 @@ void Wippersnapper_FS::parseSecrets() { strcmp(network_type_wifi_ssid, "YOUR_WIFI_SSID_HERE") == 0) { WS_DEBUG_PRINTLN("ERROR: invalid network_ssid value in secrets.json!"); writeToBootOut("ERROR: invalid network_ssid value in secrets.json!\n"); -/* WS._ui_helper->show_scr_error( + WS._ui_helper->show_scr_error( "INVALID SSID", "The \"network_ssid\" field within secrets.json is invalid, please " "change it to match your Adafruit IO username.\nConfused? Visit " - "adafru.it/123456 for detailed instructions."); */ + "adafru.it/123456 for detailed instructions."); fsHalt(); } // Set network SSID @@ -397,11 +397,11 @@ void Wippersnapper_FS::parseSecrets() { "secrets.json!"); writeToBootOut("ERROR: invalid network_type_wifi_password value in " "secrets.json!\n"); -/* WS._ui_helper->show_scr_error( + WS._ui_helper->show_scr_error( "INVALID SSID", "The \"network_ssid\" field within secrets.json is invalid, please " "change it to match your Adafruit IO username.\nConfused? Visit " - "adafru.it/123456 for detailed instructions."); */ + "adafru.it/123456 for detailed instructions."); fsHalt(); } WS._network_pass = network_type_wifi_password; From a57d2e3e62bfc762bcea1524a7202538d727750a Mon Sep 17 00:00:00 2001 From: brentru Date: Fri, 12 May 2023 11:08:01 -0400 Subject: [PATCH 22/90] insecure wific lient --- src/Wippersnapper.cpp | 3 +++ src/display/ws_display_driver.cpp | 2 +- src/network_interfaces/Wippersnapper_ESP32.h | 23 +++++++++++++------- 3 files changed, 19 insertions(+), 9 deletions(-) diff --git a/src/Wippersnapper.cpp b/src/Wippersnapper.cpp index 8d13217d7..0ef841d71 100644 --- a/src/Wippersnapper.cpp +++ b/src/Wippersnapper.cpp @@ -2057,6 +2057,9 @@ void Wippersnapper::runNetFSM() { // statusLEDBlink(WS_LED_STATUS_MQTT_CONNECTING); WS_DEBUG_PRINT("NETWORK STATUS: "); WS_DEBUG_PRINTLN(networkStatus()); + Serial.printf("Size: %d\tFree: %d\tMaxAlloc: %d\t PSFree: %d\n", + ESP.getHeapSize(), ESP.getFreeHeap(), ESP.getMaxAllocHeap(), + ESP.getFreePsram()); ///< ESP32 memory check macro int8_t mqttRC = WS._mqtt->connect(); if (mqttRC == WS_MQTT_CONNECTED) { fsmNetwork = FSM_NET_CHECK_MQTT; diff --git a/src/display/ws_display_driver.cpp b/src/display/ws_display_driver.cpp index e7c2d2e28..bcb7c3544 100644 --- a/src/display/ws_display_driver.cpp +++ b/src/display/ws_display_driver.cpp @@ -84,7 +84,7 @@ void ws_display_driver::setResolution(uint16_t displayWidth, AFTER calling Serial.begin(). */ /**************************************************************************/ -void ws_display_driver::enableLogging() { lv_log_register_print_cb(my_log_cb); } +void ws_display_driver::enableLogging() { } /**************************************************************************/ /*! diff --git a/src/network_interfaces/Wippersnapper_ESP32.h b/src/network_interfaces/Wippersnapper_ESP32.h index c8635bf85..ad830a3e2 100644 --- a/src/network_interfaces/Wippersnapper_ESP32.h +++ b/src/network_interfaces/Wippersnapper_ESP32.h @@ -42,7 +42,11 @@ class Wippersnapper_ESP32 : public Wippersnapper { Wippersnapper_ESP32() : Wippersnapper() { _ssid = 0; _pass = 0; + #ifndef CONFIG_IDF_TARGET_ESP32S2 _mqtt_client = new WiFiClientSecure; + #else + _mqtt_client = new WiFiClient; + #endif } /**************************************************************************/ @@ -145,15 +149,14 @@ class Wippersnapper_ESP32 : public Wippersnapper { */ /********************************************************/ void setupMQTTClient(const char *clientID) { - if (WS._mqttBrokerURL == nullptr) { - WS._mqttBrokerURL = "io.adafruit.com"; - _mqtt_client->setCACert(_aio_root_ca_prod); - } else { - _mqtt_client->setCACert(_aio_root_ca_staging); - } + WS._mqttBrokerURL = "io.adafruit.com"; + + #ifndef CONFIG_IDF_TARGET_ESP32S2 + _mqtt_client->setCACert(_aio_root_ca_prod); + #endif WS._mqtt = - new Adafruit_MQTT_Client(_mqtt_client, WS._mqttBrokerURL, WS._mqtt_port, + new Adafruit_MQTT_Client(_mqtt_client, WS._mqttBrokerURL, 1883, clientID, WS._username, WS._key); } @@ -188,7 +191,11 @@ class Wippersnapper_ESP32 : public Wippersnapper { const char *_ssid; ///< WiFi SSID const char *_pass; ///< WiFi password const char *_mqttBrokerURL; ///< MQTT broker URL - WiFiClientSecure *_mqtt_client; ///< Pointer to a secure MQTT client object + #ifndef CONFIG_IDF_TARGET_ESP32S2 + WiFiClientSecure *_mqtt_client; ///< Pointer to a WiFi client object (TLS/SSL) + #else + WiFiClient *_mqtt_client; ///< Pointer to a WiFi client object (non-TLS/SSL) + #endif const char *_aio_root_ca_staging = "-----BEGIN CERTIFICATE-----\n" From d6cb8603e8013a36e5512eae6c5222a459b0399c Mon Sep 17 00:00:00 2001 From: brentru Date: Wed, 17 May 2023 13:45:17 -0400 Subject: [PATCH 23/90] working OK! --- src/Wippersnapper.cpp | 69 ++++++++++---------- src/display/ws_display_ui_helper.cpp | 4 ++ src/display/ws_display_ui_helper.h | 1 - src/network_interfaces/Wippersnapper_ESP32.h | 13 +--- 4 files changed, 40 insertions(+), 47 deletions(-) diff --git a/src/Wippersnapper.cpp b/src/Wippersnapper.cpp index 0ef841d71..38adb3295 100644 --- a/src/Wippersnapper.cpp +++ b/src/Wippersnapper.cpp @@ -84,13 +84,6 @@ Wippersnapper::~Wippersnapper() { free(_throttle_sub); } -void stats_timer(lv_timer_t *timer) { - Serial.printf("Size: %d\tFree: %d\tMaxAlloc: %d\t PSFree: %d\n", - ESP.getHeapSize(), ESP.getFreeHeap(), ESP.getMaxAllocHeap(), - ESP.getFreePsram()); ///< ESP32 memory check macro - lv_timer_reset(timer); -} - /**************************************************************************/ /*! @brief Provisions a WipperSnapper device with its network @@ -125,14 +118,18 @@ void Wippersnapper::provision() { // Where do we log this? WS._display->enableLogging(); - // lv_timer_t * timer = lv_timer_create(stats_timer, 100, NULL); - // UI Setup WS._ui_helper = new ws_display_ui_helper(WS._display); WS._ui_helper->set_bg_black(); WS._ui_helper->show_scr_load(); WS._ui_helper->set_label_status("Validating Credentials..."); + if (psramInit()) { + WS_DEBUG_PRINTLN("PSRAM INIT: OK"); + } else { + WS_DEBUG_PRINTLN("PSRAM INIT: FAIL"); + } + // TODO: Add display error modes within parseSecrets() #ifdef USE_TINYUSB _fileSystem->parseSecrets(); @@ -1569,7 +1566,7 @@ void cbThrottleTopic(char *throttleData, uint16_t len) { /**************************************************************************/ bool Wippersnapper::generateWSErrorTopics() { // dynamically allocate memory for err topic - WS._err_topic = (char *)malloc( + WS._err_topic = (char *)ps_malloc( sizeof(char) * (strlen(WS._username) + strlen(TOPIC_IO_ERRORS) + 1)); if (WS._err_topic) { // build error topic @@ -1586,7 +1583,7 @@ bool Wippersnapper::generateWSErrorTopics() { _err_sub->setCallback(cbErrorTopic); // dynamically allocate memory for throttle topic - WS._throttle_topic = (char *)malloc( + WS._throttle_topic = (char *)ps_malloc( sizeof(char) * (strlen(WS._username) + strlen(TOPIC_IO_THROTTLE) + 1)); if (WS._throttle_topic) { // build throttle topic @@ -1640,7 +1637,7 @@ bool Wippersnapper::generateDeviceUID() { itoa(atoi(WS.sUID), mac_uid, 10); // Attempt to malloc a the device identifier string - _device_uid = (char *)malloc(sizeof(char) + strlen("io-wipper-") + + _device_uid = (char *)ps_malloc(sizeof(char) + strlen("io-wipper-") + strlen(WS._boardId) + strlen(mac_uid) + 1); if (_device_uid == NULL) { WS_DEBUG_PRINTLN("ERROR: Unable to create device uid, Malloc failure"); @@ -1664,7 +1661,7 @@ bool Wippersnapper::generateDeviceUID() { bool Wippersnapper::generateWSTopics() { // Create global registration topic WS._topic_description = - (char *)malloc(sizeof(char) * strlen(WS._username) + strlen("/wprsnpr") + + (char *)ps_malloc(sizeof(char) * strlen(WS._username) + strlen("/wprsnpr") + strlen(TOPIC_INFO) + strlen("status") + 1); if (WS._topic_description != NULL) { strcpy(WS._topic_description, WS._username); @@ -1678,7 +1675,7 @@ bool Wippersnapper::generateWSTopics() { // Create registration status topic WS._topic_description_status = - (char *)malloc(sizeof(char) * strlen(WS._username) + strlen("/wprsnpr/") + + (char *)ps_malloc(sizeof(char) * strlen(WS._username) + strlen("/wprsnpr/") + strlen(_device_uid) + strlen(TOPIC_INFO) + strlen("status/") + strlen("broker") + 1); if (WS._topic_description_status != NULL) { @@ -1701,7 +1698,7 @@ bool Wippersnapper::generateWSTopics() { // Create registration status complete topic WS._topic_description_status_complete = - (char *)malloc(sizeof(char) * strlen(WS._username) + strlen("/wprsnpr/") + + (char *)ps_malloc(sizeof(char) * strlen(WS._username) + strlen("/wprsnpr/") + strlen(_device_uid) + strlen(TOPIC_INFO) + strlen("status") + strlen("/device/complete") + 1); if (WS._topic_description_status_complete != NULL) { @@ -1717,7 +1714,7 @@ bool Wippersnapper::generateWSTopics() { } // Create device-to-broker signal topic - WS._topic_signal_device = (char *)malloc( + WS._topic_signal_device = (char *)ps_malloc( sizeof(char) * strlen(WS._username) + strlen("/wprsnpr/") + strlen(_device_uid) + strlen(TOPIC_SIGNALS) + strlen("device") + 1); if (WS._topic_signal_device != NULL) { @@ -1733,7 +1730,7 @@ bool Wippersnapper::generateWSTopics() { // Create pin configuration complete topic WS._topic_device_pin_config_complete = - (char *)malloc(sizeof(char) * strlen(WS._username) + strlen("/wprsnpr/") + + (char *)ps_malloc(sizeof(char) * strlen(WS._username) + strlen("/wprsnpr/") + strlen(_device_uid) + strlen(TOPIC_SIGNALS) + strlen("device/pinConfigComplete") + 1); if (WS._topic_device_pin_config_complete != NULL) { @@ -1749,7 +1746,7 @@ bool Wippersnapper::generateWSTopics() { } // Create broker-to-device signal topic - WS._topic_signal_brkr = (char *)malloc( + WS._topic_signal_brkr = (char *)ps_malloc( sizeof(char) * strlen(WS._username) + strlen("/wprsnpr/") + strlen(_device_uid) + strlen(TOPIC_SIGNALS) + strlen("broker") + 1); if (WS._topic_signal_brkr != NULL) { @@ -1770,7 +1767,7 @@ bool Wippersnapper::generateWSTopics() { _topic_signal_brkr_sub->setCallback(cbSignalTopic); // Create device-to-broker i2c signal topic - WS._topic_signal_i2c_brkr = (char *)malloc( + WS._topic_signal_i2c_brkr = (char *)ps_malloc( sizeof(char) * strlen(WS._username) + +strlen("/") + strlen(_device_uid) + strlen("/wprsnpr/") + strlen(TOPIC_SIGNALS) + strlen("broker") + strlen(TOPIC_I2C) + 1); @@ -1793,7 +1790,7 @@ bool Wippersnapper::generateWSTopics() { _topic_signal_i2c_sub->setCallback(cbSignalI2CReq); // Create broker-to-device i2c signal topic - WS._topic_signal_i2c_device = (char *)malloc( + WS._topic_signal_i2c_device = (char *)ps_malloc( sizeof(char) * strlen(WS._username) + +strlen("/") + strlen(_device_uid) + strlen("/wprsnpr/") + strlen(TOPIC_SIGNALS) + strlen("device") + strlen(TOPIC_I2C) + 1); @@ -1810,7 +1807,7 @@ bool Wippersnapper::generateWSTopics() { } // Create device-to-broker ds18x20 topic - WS._topic_signal_ds18_brkr = (char *)malloc( + WS._topic_signal_ds18_brkr = (char *)ps_malloc( sizeof(char) * strlen(WS._username) + +strlen("/") + strlen(_device_uid) + strlen("/wprsnpr/") + strlen(TOPIC_SIGNALS) + strlen("broker/") + strlen("ds18x20") + 1); @@ -1832,7 +1829,7 @@ bool Wippersnapper::generateWSTopics() { _topic_signal_ds18_sub->setCallback(cbSignalDSReq); // Create broker-to-device ds18x20 topic - WS._topic_signal_ds18_device = (char *)malloc( + WS._topic_signal_ds18_device = (char *)ps_malloc( sizeof(char) * strlen(WS._username) + +strlen("/") + strlen(_device_uid) + strlen("/wprsnpr/") + strlen(TOPIC_SIGNALS) + strlen("device/") + strlen("ds18x20") + 1); @@ -1848,7 +1845,7 @@ bool Wippersnapper::generateWSTopics() { } // Create device-to-broker servo signal topic - WS._topic_signal_servo_brkr = (char *)malloc( + WS._topic_signal_servo_brkr = (char *)ps_malloc( sizeof(char) * strlen(WS._username) + strlen("/") + strlen(_device_uid) + strlen("/wprsnpr/signals/broker/servo") + 1); if (WS._topic_signal_servo_brkr != NULL) { @@ -1869,7 +1866,7 @@ bool Wippersnapper::generateWSTopics() { _topic_signal_servo_sub->setCallback(cbServoMsg); // Create broker-to-device servo signal topic - WS._topic_signal_servo_device = (char *)malloc( + WS._topic_signal_servo_device = (char *)ps_malloc( sizeof(char) * strlen(WS._username) + strlen("/") + strlen(_device_uid) + strlen("/wprsnpr/signals/device/servo") + 1); if (WS._topic_signal_servo_device != NULL) { @@ -1884,7 +1881,7 @@ bool Wippersnapper::generateWSTopics() { } // Topic for pwm messages from broker->device - WS._topic_signal_pwm_brkr = (char *)malloc( + WS._topic_signal_pwm_brkr = (char *)ps_malloc( sizeof(char) * strlen(WS._username) + strlen("/") + strlen(_device_uid) + strlen("/wprsnpr/signals/broker/pwm") + 1); // Create device-to-broker pwm signal topic @@ -1906,7 +1903,7 @@ bool Wippersnapper::generateWSTopics() { _topic_signal_pwm_sub->setCallback(cbPWMMsg); // Topic for pwm messages from device->broker - WS._topic_signal_pwm_device = (char *)malloc( + WS._topic_signal_pwm_device = (char *)ps_malloc( sizeof(char) * strlen(WS._username) + strlen("/") + strlen(_device_uid) + strlen("/wprsnpr/signals/device/pwm") + 1); if (WS._topic_signal_pwm_device != NULL) { @@ -1921,7 +1918,7 @@ bool Wippersnapper::generateWSTopics() { } // Topic for pixel messages from broker->device - WS._topic_signal_pixels_brkr = (char *)malloc( + WS._topic_signal_pixels_brkr = (char *)ps_malloc( sizeof(char) * strlen(WS._username) + strlen("/") + strlen(_device_uid) + strlen("/wprsnpr/signals/broker/pixels") + 1); if (WS._topic_signal_pixels_brkr != NULL) { @@ -1941,7 +1938,7 @@ bool Wippersnapper::generateWSTopics() { _topic_signal_pixels_sub->setCallback(cbPixelsMsg); // Topic for pixel messages from device->broker - WS._topic_signal_pixels_device = (char *)malloc( + WS._topic_signal_pixels_device = (char *)ps_malloc( sizeof(char) * strlen(WS._username) + strlen("/") + strlen(_device_uid) + strlen("/wprsnpr/signals/device/pixels") + 1); if (WS._topic_signal_pixels_device != NULL) { @@ -1995,9 +1992,7 @@ void Wippersnapper::runNetFSM() { switch (fsmNetwork) { case FSM_NET_CHECK_MQTT: if (WS._mqtt->connected()) { - WS._ui_helper->set_load_bar_icon_complete(loadBarIconCloud); - WS._ui_helper->set_label_status("Registering device with IO..."); - WS_DEBUG_PRINTLN("Connected to Adafruit IO!"); + //WS_DEBUG_PRINTLN("Connected to Adafruit IO!"); fsmNetwork = FSM_NET_CONNECTED; return; } @@ -2057,9 +2052,9 @@ void Wippersnapper::runNetFSM() { // statusLEDBlink(WS_LED_STATUS_MQTT_CONNECTING); WS_DEBUG_PRINT("NETWORK STATUS: "); WS_DEBUG_PRINTLN(networkStatus()); - Serial.printf("Size: %d\tFree: %d\tMaxAlloc: %d\t PSFree: %d\n", - ESP.getHeapSize(), ESP.getFreeHeap(), ESP.getMaxAllocHeap(), - ESP.getFreePsram()); ///< ESP32 memory check macro + Serial.printf("Size: %d\tFree: %d\tMaxAlloc: %d\t PSFree: %d\n", + ESP.getHeapSize(), ESP.getFreeHeap(), ESP.getMaxAllocHeap(), + ESP.getFreePsram()); ///< ESP32 memory check macro int8_t mqttRC = WS._mqtt->connect(); if (mqttRC == WS_MQTT_CONNECTED) { fsmNetwork = FSM_NET_CHECK_MQTT; @@ -2363,6 +2358,9 @@ void Wippersnapper::connect() { runNetFSM(); WS.feedWDT(); + WS._ui_helper->set_load_bar_icon_complete(loadBarIconCloud); + WS._ui_helper->set_label_status("Registering device with IO..."); + // Register hardware with Wippersnapper WS_DEBUG_PRINTLN("Registering hardware with WipperSnapper...") if (!registerBoard()) { @@ -2385,6 +2383,9 @@ void Wippersnapper::connect() { WS_DEBUG_PRINTLN("Hardware configured successfully!"); // goto application + WS_DEBUG_PRINT("Clearing Screen..."); + WS._ui_helper->clear_scr_load(); + WS_DEBUG_PRINTLN("Cleared!"); statusLEDFade(GREEN, 3); WS_DEBUG_PRINTLN( "Registration and configuration complete!\nRunning application..."); diff --git a/src/display/ws_display_ui_helper.cpp b/src/display/ws_display_ui_helper.cpp index 7a391d09d..3f88b6727 100644 --- a/src/display/ws_display_ui_helper.cpp +++ b/src/display/ws_display_ui_helper.cpp @@ -204,7 +204,10 @@ void ws_display_ui_helper::show_scr_load() { */ /**************************************************************************/ void ws_display_ui_helper::clear_scr_load() { + _dispDriver->esp32_lvgl_acquire(); + // Delete icons lv_obj_del(lblStatusText); + lv_obj_del(lblIconWiFi); lv_obj_del(lblIconFile); lv_obj_del(labelTurtleBar); lv_obj_del(labelCloudBar); @@ -216,6 +219,7 @@ void ws_display_ui_helper::clear_scr_load() { // Stop the loading tip timer and delete the label remove_tip_timer(); lv_obj_del(lblTipText); + _dispDriver->esp32_lvgl_release(); } /**************************************************************************/ diff --git a/src/display/ws_display_ui_helper.h b/src/display/ws_display_ui_helper.h index ef0f2aafe..997587e6a 100644 --- a/src/display/ws_display_ui_helper.h +++ b/src/display/ws_display_ui_helper.h @@ -45,7 +45,6 @@ static lv_obj_t *lblIconFile; static lv_obj_t *lblIconWiFi; static lv_obj_t *labelTurtleBar; static lv_obj_t *labelCloudBar; -static lv_obj_t *labelCircleBar; static lv_obj_t *lblStatusText; static lv_obj_t *lblTipText; // Styles diff --git a/src/network_interfaces/Wippersnapper_ESP32.h b/src/network_interfaces/Wippersnapper_ESP32.h index ad830a3e2..790a6418f 100644 --- a/src/network_interfaces/Wippersnapper_ESP32.h +++ b/src/network_interfaces/Wippersnapper_ESP32.h @@ -42,11 +42,7 @@ class Wippersnapper_ESP32 : public Wippersnapper { Wippersnapper_ESP32() : Wippersnapper() { _ssid = 0; _pass = 0; - #ifndef CONFIG_IDF_TARGET_ESP32S2 _mqtt_client = new WiFiClientSecure; - #else - _mqtt_client = new WiFiClient; - #endif } /**************************************************************************/ @@ -150,13 +146,10 @@ class Wippersnapper_ESP32 : public Wippersnapper { /********************************************************/ void setupMQTTClient(const char *clientID) { WS._mqttBrokerURL = "io.adafruit.com"; - - #ifndef CONFIG_IDF_TARGET_ESP32S2 _mqtt_client->setCACert(_aio_root_ca_prod); - #endif WS._mqtt = - new Adafruit_MQTT_Client(_mqtt_client, WS._mqttBrokerURL, 1883, + new Adafruit_MQTT_Client(_mqtt_client, WS._mqttBrokerURL, 8883, clientID, WS._username, WS._key); } @@ -191,11 +184,7 @@ class Wippersnapper_ESP32 : public Wippersnapper { const char *_ssid; ///< WiFi SSID const char *_pass; ///< WiFi password const char *_mqttBrokerURL; ///< MQTT broker URL - #ifndef CONFIG_IDF_TARGET_ESP32S2 WiFiClientSecure *_mqtt_client; ///< Pointer to a WiFi client object (TLS/SSL) - #else - WiFiClient *_mqtt_client; ///< Pointer to a WiFi client object (non-TLS/SSL) - #endif const char *_aio_root_ca_staging = "-----BEGIN CERTIFICATE-----\n" From 7e1c62af5b1467e30d25d34c9aec8565e1202c0a Mon Sep 17 00:00:00 2001 From: brentru Date: Wed, 17 May 2023 13:54:34 -0400 Subject: [PATCH 24/90] inclusion of USE_DISPLAY preproc directive for devices with builtind isplays --- src/Wippersnapper.cpp | 24 +++++++++++++------ src/Wippersnapper_Boards.h | 1 + src/provisioning/tinyusb/Wippersnapper_FS.cpp | 10 ++++++++ 3 files changed, 28 insertions(+), 7 deletions(-) diff --git a/src/Wippersnapper.cpp b/src/Wippersnapper.cpp index 38adb3295..3538347c5 100644 --- a/src/Wippersnapper.cpp +++ b/src/Wippersnapper.cpp @@ -104,11 +104,10 @@ void Wippersnapper::provision() { _littleFS = new WipperSnapper_LittleFS(); #endif - // TODO: Add checks around display init. + + #ifdef USE_DISPLAY // Initialize the display displayConfig config = WS._fileSystem->parseDisplayConfig(); - // TODO: Need error boundary checks and signaling around - // display initialization if it doesnt exist! WS._display = new ws_display_driver(config); // Begin display if (!WS._display->begin()) @@ -117,12 +116,12 @@ void Wippersnapper::provision() { // revert to non-display? // Where do we log this? WS._display->enableLogging(); - // UI Setup WS._ui_helper = new ws_display_ui_helper(WS._display); WS._ui_helper->set_bg_black(); WS._ui_helper->show_scr_load(); WS._ui_helper->set_label_status("Validating Credentials..."); + #endif if (psramInit()) { WS_DEBUG_PRINTLN("PSRAM INIT: OK"); @@ -141,8 +140,11 @@ void Wippersnapper::provision() { // Set device's wireless credentials set_ssid_pass(); + + #ifdef USE_DISPLAY WS._ui_helper->set_label_status(""); WS._ui_helper->set_load_bar_icon_complete(loadBarIconFile); + #endif } /**************************************************************************/ @@ -2001,7 +2003,9 @@ void Wippersnapper::runNetFSM() { case FSM_NET_CHECK_NETWORK: if (networkStatus() == WS_NET_CONNECTED) { WS_DEBUG_PRINTLN("Connected to WiFi!"); + #ifdef USE_DISPLAY WS._ui_helper->set_load_bar_icon_complete(loadBarIconWifi); + #endif fsmNetwork = FSM_NET_ESTABLISH_MQTT; break; } @@ -2010,7 +2014,9 @@ void Wippersnapper::runNetFSM() { case FSM_NET_ESTABLISH_NETWORK: WS_DEBUG_PRINTLN("Attempting to connect to WiFi"); // TODO: Pass in SSID as a string + #ifdef USE_DISPLAY WS._ui_helper->set_label_status("Connecting to WiFi..."); + #endif // Perform a WiFi scan and check if SSID within // secrets.json is within the scanned SSIDs // TODO: add signaling for display in check below @@ -2067,9 +2073,11 @@ void Wippersnapper::runNetFSM() { maxAttempts--; } if (fsmNetwork != FSM_NET_CHECK_MQTT) { + #ifdef USE_DISPLAY WS._ui_helper->show_scr_error( "CONNECTION ERROR", - "Unable to connect to Adafruit.io, rebooting in N seconds..."); + "Unable to connect to Adafruit.io, rebooting in 5 seconds..."); + #endif haltError( "ERROR: Unable to connect to Adafruit.IO MQTT, rebooting soon...", WS_LED_STATUS_MQTT_CONNECTING); @@ -2358,8 +2366,10 @@ void Wippersnapper::connect() { runNetFSM(); WS.feedWDT(); + #ifdef USE_DISPLAY WS._ui_helper->set_load_bar_icon_complete(loadBarIconCloud); WS._ui_helper->set_label_status("Registering device with IO..."); + #endif // Register hardware with Wippersnapper WS_DEBUG_PRINTLN("Registering hardware with WipperSnapper...") @@ -2383,9 +2393,9 @@ void Wippersnapper::connect() { WS_DEBUG_PRINTLN("Hardware configured successfully!"); // goto application - WS_DEBUG_PRINT("Clearing Screen..."); + #ifdef USE_DISPLAY WS._ui_helper->clear_scr_load(); - WS_DEBUG_PRINTLN("Cleared!"); + #endif statusLEDFade(GREEN, 3); WS_DEBUG_PRINTLN( "Registration and configuration complete!\nRunning application..."); diff --git a/src/Wippersnapper_Boards.h b/src/Wippersnapper_Boards.h index 38bfb1c9f..cea046ac6 100644 --- a/src/Wippersnapper_Boards.h +++ b/src/Wippersnapper_Boards.h @@ -32,6 +32,7 @@ #define BOARD_ID "funhouse" #define USE_TINYUSB #define USE_STATUS_DOTSTAR +#define USE_DISPLAY #define STATUS_DOTSTAR_PIN_DATA PIN_DOTSTAR_DATA #define STATUS_DOTSTAR_PIN_CLK PIN_DOTSTAR_CLOCK #define STATUS_DOTSTAR_NUM 5 diff --git a/src/provisioning/tinyusb/Wippersnapper_FS.cpp b/src/provisioning/tinyusb/Wippersnapper_FS.cpp index 6de2aace3..c426f0227 100644 --- a/src/provisioning/tinyusb/Wippersnapper_FS.cpp +++ b/src/provisioning/tinyusb/Wippersnapper_FS.cpp @@ -312,11 +312,13 @@ void Wippersnapper_FS::createSecretsFile() { writeToBootOut( "* Please edit the secrets.json file. Then, reset your board.\n"); + #ifdef USE_DISPLAY WS._ui_helper->show_scr_error( "INVALID SETTINGS FILE", "The settings.json file on the WIPPER drive contains default values. " "Please edit it to reflect your Adafruit IO and network credentials. " "When you're done, press RESET on the board."); + #endif fsHalt(); } @@ -348,11 +350,13 @@ void Wippersnapper_FS::parseSecrets() { strcmp(io_username, "YOUR_IO_USERNAME_HERE") == 0) { WS_DEBUG_PRINTLN("ERROR: invalid io_username value in secrets.json!"); writeToBootOut("ERROR: invalid io_username value in secrets.json!\n"); + #ifdef USE_DISPLAY WS._ui_helper->show_scr_error( "INVALID USERNAME", "The \"io_username\" field within secrets.json is invalid, please " "change it to match your Adafruit IO username.\nConfused? Visit " "adafru.it/123456 for detailed instructions."); + #endif fsHalt(); } // Set io_username @@ -363,11 +367,13 @@ void Wippersnapper_FS::parseSecrets() { if (io_key == nullptr) { WS_DEBUG_PRINTLN("ERROR: invalid io_key value in secrets.json!"); writeToBootOut("ERROR: invalid io_key value in secrets.json!\n"); + #ifdef USE_DISPLAY WS._ui_helper->show_scr_error( "INVALID IO KEY", "The \"io_key\" field within secrets.json is invalid, please change it " "to match your Adafruit IO username.\nConfused? Visit adafru.it/123456 " "for detailed instructions."); + #endif fsHalt(); } WS._key = io_key; @@ -378,11 +384,13 @@ void Wippersnapper_FS::parseSecrets() { strcmp(network_type_wifi_ssid, "YOUR_WIFI_SSID_HERE") == 0) { WS_DEBUG_PRINTLN("ERROR: invalid network_ssid value in secrets.json!"); writeToBootOut("ERROR: invalid network_ssid value in secrets.json!\n"); + #ifdef USE_DISPLAY WS._ui_helper->show_scr_error( "INVALID SSID", "The \"network_ssid\" field within secrets.json is invalid, please " "change it to match your Adafruit IO username.\nConfused? Visit " "adafru.it/123456 for detailed instructions."); + #endif fsHalt(); } // Set network SSID @@ -397,11 +405,13 @@ void Wippersnapper_FS::parseSecrets() { "secrets.json!"); writeToBootOut("ERROR: invalid network_type_wifi_password value in " "secrets.json!\n"); + #ifdef USE_DISPLAY WS._ui_helper->show_scr_error( "INVALID SSID", "The \"network_ssid\" field within secrets.json is invalid, please " "change it to match your Adafruit IO username.\nConfused? Visit " "adafru.it/123456 for detailed instructions."); + #endif fsHalt(); } WS._network_pass = network_type_wifi_password; From 28f2ab0ed093f3a273df97344e9d9fac80c3e833 Mon Sep 17 00:00:00 2001 From: brentru Date: Wed, 17 May 2023 14:22:19 -0400 Subject: [PATCH 25/90] release status LED if using display --- src/Wippersnapper.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Wippersnapper.cpp b/src/Wippersnapper.cpp index 3538347c5..628d1d288 100644 --- a/src/Wippersnapper.cpp +++ b/src/Wippersnapper.cpp @@ -116,6 +116,7 @@ void Wippersnapper::provision() { // revert to non-display? // Where do we log this? WS._display->enableLogging(); + releaseStatusLED(); // don't use status LED if we are using the display // UI Setup WS._ui_helper = new ws_display_ui_helper(WS._display); WS._ui_helper->set_bg_black(); From b711b0a3626009eb1d3a9d4a28aaddc3bd92a102 Mon Sep 17 00:00:00 2001 From: brentru Date: Wed, 17 May 2023 14:37:22 -0400 Subject: [PATCH 26/90] remove psram init, duplicate maybe --- src/Wippersnapper.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/Wippersnapper.cpp b/src/Wippersnapper.cpp index 628d1d288..4b8876075 100644 --- a/src/Wippersnapper.cpp +++ b/src/Wippersnapper.cpp @@ -124,11 +124,6 @@ void Wippersnapper::provision() { WS._ui_helper->set_label_status("Validating Credentials..."); #endif - if (psramInit()) { - WS_DEBUG_PRINTLN("PSRAM INIT: OK"); - } else { - WS_DEBUG_PRINTLN("PSRAM INIT: FAIL"); - } // TODO: Add display error modes within parseSecrets() #ifdef USE_TINYUSB From 8ad37a8e48c6a443ebc8e57f7c44f0e4784ed5bb Mon Sep 17 00:00:00 2001 From: brentru Date: Wed, 17 May 2023 16:27:33 -0400 Subject: [PATCH 27/90] handle begin() failure --- src/Wippersnapper.cpp | 115 ++++++++++++++++++++++-------------------- 1 file changed, 59 insertions(+), 56 deletions(-) diff --git a/src/Wippersnapper.cpp b/src/Wippersnapper.cpp index 4b8876075..d7d943c21 100644 --- a/src/Wippersnapper.cpp +++ b/src/Wippersnapper.cpp @@ -104,17 +104,17 @@ void Wippersnapper::provision() { _littleFS = new WipperSnapper_LittleFS(); #endif - - #ifdef USE_DISPLAY +#ifdef USE_DISPLAY // Initialize the display displayConfig config = WS._fileSystem->parseDisplayConfig(); WS._display = new ws_display_driver(config); // Begin display - if (!WS._display->begin()) - WS_DEBUG_PRINTLN( - "Unable to enable display driver and LVGL"); // TODO: Maybe fail out and - // revert to non-display? - // Where do we log this? + if (!WS._display->begin()) { + WS_DEBUG_PRINTLN("Unable to enable display driver and LVGL"); + haltError("Unable to enable display driver, please check the json " + "configuration!"); + } + WS._display->enableLogging(); releaseStatusLED(); // don't use status LED if we are using the display // UI Setup @@ -122,10 +122,9 @@ void Wippersnapper::provision() { WS._ui_helper->set_bg_black(); WS._ui_helper->show_scr_load(); WS._ui_helper->set_label_status("Validating Credentials..."); - #endif - +#endif -// TODO: Add display error modes within parseSecrets() + // Parse secrets.json file #ifdef USE_TINYUSB _fileSystem->parseSecrets(); #elif defined(USE_LITTLEFS) @@ -133,14 +132,13 @@ void Wippersnapper::provision() { #else set_user_key(); // non-fs-backed, sets global credentials within network iface #endif - // Set device's wireless credentials set_ssid_pass(); - #ifdef USE_DISPLAY +#ifdef USE_DISPLAY WS._ui_helper->set_label_status(""); WS._ui_helper->set_load_bar_icon_complete(loadBarIconFile); - #endif +#endif } /**************************************************************************/ @@ -1636,7 +1634,7 @@ bool Wippersnapper::generateDeviceUID() { // Attempt to malloc a the device identifier string _device_uid = (char *)ps_malloc(sizeof(char) + strlen("io-wipper-") + - strlen(WS._boardId) + strlen(mac_uid) + 1); + strlen(WS._boardId) + strlen(mac_uid) + 1); if (_device_uid == NULL) { WS_DEBUG_PRINTLN("ERROR: Unable to create device uid, Malloc failure"); return false; @@ -1658,9 +1656,9 @@ bool Wippersnapper::generateDeviceUID() { /**************************************************************************/ bool Wippersnapper::generateWSTopics() { // Create global registration topic - WS._topic_description = - (char *)ps_malloc(sizeof(char) * strlen(WS._username) + strlen("/wprsnpr") + - strlen(TOPIC_INFO) + strlen("status") + 1); + WS._topic_description = (char *)ps_malloc( + sizeof(char) * strlen(WS._username) + strlen("/wprsnpr") + + strlen(TOPIC_INFO) + strlen("status") + 1); if (WS._topic_description != NULL) { strcpy(WS._topic_description, WS._username); strcat(WS._topic_description, "/wprsnpr"); @@ -1672,10 +1670,10 @@ bool Wippersnapper::generateWSTopics() { } // Create registration status topic - WS._topic_description_status = - (char *)ps_malloc(sizeof(char) * strlen(WS._username) + strlen("/wprsnpr/") + - strlen(_device_uid) + strlen(TOPIC_INFO) + - strlen("status/") + strlen("broker") + 1); + WS._topic_description_status = (char *)ps_malloc( + sizeof(char) * strlen(WS._username) + strlen("/wprsnpr/") + + strlen(_device_uid) + strlen(TOPIC_INFO) + strlen("status/") + + strlen("broker") + 1); if (WS._topic_description_status != NULL) { strcpy(WS._topic_description_status, WS._username); strcat(WS._topic_description_status, "/wprsnpr/"); @@ -1695,10 +1693,10 @@ bool Wippersnapper::generateWSTopics() { _topic_description_sub->setCallback(cbRegistrationStatus); // Create registration status complete topic - WS._topic_description_status_complete = - (char *)ps_malloc(sizeof(char) * strlen(WS._username) + strlen("/wprsnpr/") + - strlen(_device_uid) + strlen(TOPIC_INFO) + - strlen("status") + strlen("/device/complete") + 1); + WS._topic_description_status_complete = (char *)ps_malloc( + sizeof(char) * strlen(WS._username) + strlen("/wprsnpr/") + + strlen(_device_uid) + strlen(TOPIC_INFO) + strlen("status") + + strlen("/device/complete") + 1); if (WS._topic_description_status_complete != NULL) { strcpy(WS._topic_description_status_complete, WS._username); strcat(WS._topic_description_status_complete, "/wprsnpr/"); @@ -1727,10 +1725,10 @@ bool Wippersnapper::generateWSTopics() { } // Create pin configuration complete topic - WS._topic_device_pin_config_complete = - (char *)ps_malloc(sizeof(char) * strlen(WS._username) + strlen("/wprsnpr/") + - strlen(_device_uid) + strlen(TOPIC_SIGNALS) + - strlen("device/pinConfigComplete") + 1); + WS._topic_device_pin_config_complete = (char *)ps_malloc( + sizeof(char) * strlen(WS._username) + strlen("/wprsnpr/") + + strlen(_device_uid) + strlen(TOPIC_SIGNALS) + + strlen("device/pinConfigComplete") + 1); if (WS._topic_device_pin_config_complete != NULL) { strcpy(WS._topic_device_pin_config_complete, WS._username); strcat(WS._topic_device_pin_config_complete, "/wprsnpr/"); @@ -1990,7 +1988,7 @@ void Wippersnapper::runNetFSM() { switch (fsmNetwork) { case FSM_NET_CHECK_MQTT: if (WS._mqtt->connected()) { - //WS_DEBUG_PRINTLN("Connected to Adafruit IO!"); + // WS_DEBUG_PRINTLN("Connected to Adafruit IO!"); fsmNetwork = FSM_NET_CONNECTED; return; } @@ -1999,26 +1997,30 @@ void Wippersnapper::runNetFSM() { case FSM_NET_CHECK_NETWORK: if (networkStatus() == WS_NET_CONNECTED) { WS_DEBUG_PRINTLN("Connected to WiFi!"); - #ifdef USE_DISPLAY +#ifdef USE_DISPLAY WS._ui_helper->set_load_bar_icon_complete(loadBarIconWifi); - #endif +#endif fsmNetwork = FSM_NET_ESTABLISH_MQTT; break; } fsmNetwork = FSM_NET_ESTABLISH_NETWORK; break; case FSM_NET_ESTABLISH_NETWORK: - WS_DEBUG_PRINTLN("Attempting to connect to WiFi"); - // TODO: Pass in SSID as a string - #ifdef USE_DISPLAY + WS_DEBUG_PRINTLN("Connecting to WiFi..."); +#ifdef USE_DISPLAY WS._ui_helper->set_label_status("Connecting to WiFi..."); - #endif +#endif // Perform a WiFi scan and check if SSID within // secrets.json is within the scanned SSIDs - // TODO: add signaling for display in check below - if (!check_valid_ssid()) + if (!check_valid_ssid()) { +#ifdef USE_DISPLAY + WS._ui_helper->show_scr_error("ERROR", + "Unable to find WiFi network listed in " + "the secrets file. Rebooting soon..."); +#endif haltError("ERROR: Unable to find WiFi network, rebooting soon...", WS_LED_STATUS_WIFI_CONNECTING); + } // Attempt to connect to wireless network maxAttempts = 5; while (maxAttempts > 0) { @@ -2039,24 +2041,26 @@ void Wippersnapper::runNetFSM() { // Validate connection if (networkStatus() != WS_NET_CONNECTED) - haltError("ERROR: Unable to connect to WiFi, rebooting soon...", - WS_LED_STATUS_WIFI_CONNECTING); +#ifdef USE_DISPLAY + WS._ui_helper->show_scr_error( + "CONNECTION ERROR", + "Unable to connect to WiFi Network. Please check that you entered " + "the WiFi credentials correctly. Rebooting in 5 seconds..."); +#endif + haltError("ERROR: Unable to connect to WiFi, rebooting soon...", + WS_LED_STATUS_WIFI_CONNECTING); fsmNetwork = FSM_NET_CHECK_NETWORK; break; case FSM_NET_ESTABLISH_MQTT: WS_DEBUG_PRINTLN("Attempting to connect to IO..."); - WS_DEBUG_PRINT("NETWORK STATUS: "); - WS_DEBUG_PRINTLN(networkStatus()); +#ifdef USE_DISPLAY + WS._ui_helper->set_label_status("Connecting to IO..."); +#endif WS._mqtt->setKeepAliveInterval(WS_KEEPALIVE_INTERVAL_MS / 1000); // Attempt to connect maxAttempts = 5; while (maxAttempts > 0) { - // statusLEDBlink(WS_LED_STATUS_MQTT_CONNECTING); - WS_DEBUG_PRINT("NETWORK STATUS: "); - WS_DEBUG_PRINTLN(networkStatus()); - Serial.printf("Size: %d\tFree: %d\tMaxAlloc: %d\t PSFree: %d\n", - ESP.getHeapSize(), ESP.getFreeHeap(), ESP.getMaxAllocHeap(), - ESP.getFreePsram()); ///< ESP32 memory check macro + statusLEDBlink(WS_LED_STATUS_MQTT_CONNECTING); int8_t mqttRC = WS._mqtt->connect(); if (mqttRC == WS_MQTT_CONNECTED) { fsmNetwork = FSM_NET_CHECK_MQTT; @@ -2069,16 +2073,15 @@ void Wippersnapper::runNetFSM() { maxAttempts--; } if (fsmNetwork != FSM_NET_CHECK_MQTT) { - #ifdef USE_DISPLAY +#ifdef USE_DISPLAY WS._ui_helper->show_scr_error( "CONNECTION ERROR", "Unable to connect to Adafruit.io, rebooting in 5 seconds..."); - #endif +#endif haltError( "ERROR: Unable to connect to Adafruit.IO MQTT, rebooting soon...", WS_LED_STATUS_MQTT_CONNECTING); } - break; default: break; @@ -2362,10 +2365,10 @@ void Wippersnapper::connect() { runNetFSM(); WS.feedWDT(); - #ifdef USE_DISPLAY +#ifdef USE_DISPLAY WS._ui_helper->set_load_bar_icon_complete(loadBarIconCloud); WS._ui_helper->set_label_status("Registering device with IO..."); - #endif +#endif // Register hardware with Wippersnapper WS_DEBUG_PRINTLN("Registering hardware with WipperSnapper...") @@ -2388,10 +2391,10 @@ void Wippersnapper::connect() { publishPinConfigComplete(); WS_DEBUG_PRINTLN("Hardware configured successfully!"); - // goto application - #ifdef USE_DISPLAY +// goto application +#ifdef USE_DISPLAY WS._ui_helper->clear_scr_load(); - #endif +#endif statusLEDFade(GREEN, 3); WS_DEBUG_PRINTLN( "Registration and configuration complete!\nRunning application..."); From 53321802a27b01fab8f8be5e55748338cf02f0b8 Mon Sep 17 00:00:00 2001 From: brentru Date: Tue, 30 May 2023 12:39:31 -0400 Subject: [PATCH 28/90] add halter --- src/Wippersnapper.cpp | 9 ++++++--- src/display/ws_display_ui_helper.cpp | 26 ++++++++++++++++++++++++++ src/display/ws_display_ui_helper.h | 1 + 3 files changed, 33 insertions(+), 3 deletions(-) diff --git a/src/Wippersnapper.cpp b/src/Wippersnapper.cpp index d7d943c21..d3e49f519 100644 --- a/src/Wippersnapper.cpp +++ b/src/Wippersnapper.cpp @@ -2040,15 +2040,17 @@ void Wippersnapper::runNetFSM() { } // Validate connection - if (networkStatus() != WS_NET_CONNECTED) + if (networkStatus() != WS_NET_CONNECTED) { #ifdef USE_DISPLAY WS._ui_helper->show_scr_error( "CONNECTION ERROR", "Unable to connect to WiFi Network. Please check that you entered " "the WiFi credentials correctly. Rebooting in 5 seconds..."); #endif - haltError("ERROR: Unable to connect to WiFi, rebooting soon...", - WS_LED_STATUS_WIFI_CONNECTING); + haltError("ERROR: Unable to connect to WiFi, rebooting soon...", + WS_LED_STATUS_WIFI_CONNECTING); + } + fsmNetwork = FSM_NET_CHECK_NETWORK; break; case FSM_NET_ESTABLISH_MQTT: @@ -2394,6 +2396,7 @@ void Wippersnapper::connect() { // goto application #ifdef USE_DISPLAY WS._ui_helper->clear_scr_load(); + WS._ui_helper->show_scr_activity(); #endif statusLEDFade(GREEN, 3); WS_DEBUG_PRINTLN( diff --git a/src/display/ws_display_ui_helper.cpp b/src/display/ws_display_ui_helper.cpp index 3f88b6727..362cc5e03 100644 --- a/src/display/ws_display_ui_helper.cpp +++ b/src/display/ws_display_ui_helper.cpp @@ -222,6 +222,32 @@ void ws_display_ui_helper::clear_scr_load() { _dispDriver->esp32_lvgl_release(); } + +/**************************************************************************/ +/*! + @brief Build and display the activity screen +*/ +/**************************************************************************/ +void ws_display_ui_helper::show_scr_activity() { + _dispDriver->esp32_lvgl_acquire(); + + // TODO + // Add a status bar to the top of the screen + + // Add a textarea to screen + lv_obj_t * ta = lv_textarea_create(lv_scr_act()); + // Set textarea properties + lv_obj_set_style_bg_color(ta, lv_color_black(), LV_STATE_DEFAULT); + lv_obj_set_style_bg_opa(ta, LV_OPA_COVER, 0); + lv_obj_align(ta, LV_ALIGN_TOP_MID, 0, 10); + + // try adding text + lv_textarea_add_text(ta, "insert this text\n"); + lv_textarea_add_text(ta, "insert this text2"); + + _dispDriver->esp32_lvgl_release(); +} + /**************************************************************************/ /*! @brief Build and display an error screen. diff --git a/src/display/ws_display_ui_helper.h b/src/display/ws_display_ui_helper.h index 997587e6a..f1261fd7a 100644 --- a/src/display/ws_display_ui_helper.h +++ b/src/display/ws_display_ui_helper.h @@ -94,6 +94,7 @@ class ws_display_ui_helper { void set_bg_black(); void show_scr_load(); void clear_scr_load(); + void show_scr_activity(); void set_load_bar_icon_complete(loadBarIcons iconType); void set_label_status(const char *text); // callback ui help? void remove_tip_timer(); From 47fe2c6df74628b87d1aa6f7f6170013a96c5d61 Mon Sep 17 00:00:00 2001 From: brentru Date: Thu, 8 Jun 2023 13:33:09 -0400 Subject: [PATCH 29/90] build activity screen --- src/Wippersnapper.cpp | 2 +- src/display/ws_display_ui_helper.cpp | 67 +++++++++++++++++++++------- src/display/ws_display_ui_helper.h | 14 +++++- 3 files changed, 64 insertions(+), 19 deletions(-) diff --git a/src/Wippersnapper.cpp b/src/Wippersnapper.cpp index d3e49f519..d1b1e58c7 100644 --- a/src/Wippersnapper.cpp +++ b/src/Wippersnapper.cpp @@ -2396,7 +2396,7 @@ void Wippersnapper::connect() { // goto application #ifdef USE_DISPLAY WS._ui_helper->clear_scr_load(); - WS._ui_helper->show_scr_activity(); + WS._ui_helper->build_scr_activity(); #endif statusLEDFade(GREEN, 3); WS_DEBUG_PRINTLN( diff --git a/src/display/ws_display_ui_helper.cpp b/src/display/ws_display_ui_helper.cpp index 362cc5e03..f2e83b748 100644 --- a/src/display/ws_display_ui_helper.cpp +++ b/src/display/ws_display_ui_helper.cpp @@ -222,30 +222,63 @@ void ws_display_ui_helper::clear_scr_load() { _dispDriver->esp32_lvgl_release(); } - /**************************************************************************/ /*! @brief Build and display the activity screen */ /**************************************************************************/ -void ws_display_ui_helper::show_scr_activity() { - _dispDriver->esp32_lvgl_acquire(); - - // TODO - // Add a status bar to the top of the screen - - // Add a textarea to screen - lv_obj_t * ta = lv_textarea_create(lv_scr_act()); - // Set textarea properties - lv_obj_set_style_bg_color(ta, lv_color_black(), LV_STATE_DEFAULT); - lv_obj_set_style_bg_opa(ta, LV_OPA_COVER, 0); - lv_obj_align(ta, LV_ALIGN_TOP_MID, 0, 10); +void ws_display_ui_helper::build_scr_activity() { + _dispDriver->esp32_lvgl_acquire(); - // try adding text - lv_textarea_add_text(ta, "insert this text\n"); - lv_textarea_add_text(ta, "insert this text2"); + // add canvas to create a status bar + canvasStatusBar = lv_canvas_create(lv_scr_act()); + static uint8_t buffer[LV_CANVAS_BUF_SIZE_TRUE_COLOR(240, 25)]; + lv_canvas_set_buffer(canvasStatusBar, buffer, 240, 25, LV_IMG_CF_TRUE_COLOR); + lv_canvas_fill_bg(canvasStatusBar, lv_color_black(), LV_OPA_COVER); + // draw rectangle on the canvas + rect_dsc->bg_color = lv_palette_main(LV_PALETTE_GREY); + rect_dsc->bg_opa = LV_OPA_COVER; + lv_draw_rect_dsc_init(rect_dsc); + lv_canvas_draw_rect(canvasStatusBar, 0, 0, 240, 25, rect_dsc); + + // add battery icon to status bar + // Future TODO: Optional timer cb funcn to check battery level on some boards + statusbar_icon_bat = lv_label_create(lv_scr_act()); + lv_label_set_text(statusbar_icon_bat, LV_SYMBOL_BATTERY_FULL); + lv_obj_align(statusbar_icon_bat, LV_ALIGN_TOP_RIGHT, -5, 6); + + // add WiFi icon to status bar + statusbar_icon_wifi = lv_label_create(lv_scr_act()); + lv_label_set_text(statusbar_icon_wifi, LV_SYMBOL_WIFI); + lv_obj_align(statusbar_icon_wifi, LV_ALIGN_TOP_RIGHT, -30, 5); + + // add turtle icon to status bar + // TODO: Maybe we'll just write WipperSnapper here instead? + /* lv_obj_t *labelTurtleBar = lv_label_create(lv_scr_act()); + lv_label_set_text(labelTurtleBar, SYMBOL_TURTLE); + static lv_style_t styleIconTurtle30px; + lv_style_init(&styleIconTurtle30px); + lv_style_set_text_color(&styleIconTurtle30px, + lv_palette_main(LV_PALETTE_GREEN)); + lv_style_set_text_font(&styleIconTurtle30px, &turtle_20); + lv_obj_add_style(labelTurtleBar, &styleIconTurtle30px, + LV_PART_MAIN); + lv_obj_align(labelTurtleBar, LV_ALIGN_TOP_LEFT, 5, 5); */ + + // add a label to hold the terminal text + // TODO: Still have overlap between the top console text and the + // status bar that we need to remove before release + terminalLabel = lv_label_create(lv_scr_act()); + lv_obj_align(terminalLabel, LV_ALIGN_BOTTOM_LEFT, 3, 0); + lv_obj_set_width(terminalLabel, 230); + lv_label_set_long_mode(terminalLabel, LV_LABEL_LONG_WRAP); + lv_style_init(styleTerminalLabel); + lv_style_set_text_color(styleTerminalLabel, lv_color_white()); + lv_obj_add_style(terminalLabel, styleTerminalLabel, LV_PART_MAIN); + lv_label_set_text_static(terminalLabel, consoleTextBuf); + lv_obj_move_background(terminalLabel); - _dispDriver->esp32_lvgl_release(); + _dispDriver->esp32_lvgl_release(); } /**************************************************************************/ diff --git a/src/display/ws_display_ui_helper.h b/src/display/ws_display_ui_helper.h index f1261fd7a..62ff1fdd4 100644 --- a/src/display/ws_display_ui_helper.h +++ b/src/display/ws_display_ui_helper.h @@ -64,6 +64,18 @@ static lv_style_t styleErrorTriangle; static lv_style_t styleLabelErrorLarge; static lv_style_t styleLabelErrorSmall; +/* Screen: Activity */ +#define MAX_CONSOLE_TEXT_LEN 430 +static char consoleTextBuf[MAX_CONSOLE_TEXT_LEN + 1]; // + '\0' +// Objects +static lv_obj_t *canvasStatusBar; +static lv_draw_rect_dsc_t *rect_dsc; +static lv_obj_t *statusbar_icon_bat; +static lv_obj_t *statusbar_icon_wifi; +static lv_obj_t *terminalLabel; +// Styles +static lv_style_t *styleTerminalLabel; + enum loadBarIcons { loadBarIconFile, loadBarIconWifi, @@ -94,7 +106,7 @@ class ws_display_ui_helper { void set_bg_black(); void show_scr_load(); void clear_scr_load(); - void show_scr_activity(); + void build_scr_activity(); void set_load_bar_icon_complete(loadBarIcons iconType); void set_label_status(const char *text); // callback ui help? void remove_tip_timer(); From c0b1efde45c25685fa9ffba35bc66f2228c91489 Mon Sep 17 00:00:00 2001 From: brentru Date: Thu, 8 Jun 2023 13:47:25 -0400 Subject: [PATCH 30/90] organize .h like lvgl example --- src/display/ws_display_ui_helper.cpp | 108 +++++++++++++-------------- src/display/ws_display_ui_helper.h | 57 +++++++------- 2 files changed, 85 insertions(+), 80 deletions(-) diff --git a/src/display/ws_display_ui_helper.cpp b/src/display/ws_display_ui_helper.cpp index f2e83b748..d0cc75ac9 100644 --- a/src/display/ws_display_ui_helper.cpp +++ b/src/display/ws_display_ui_helper.cpp @@ -222,6 +222,60 @@ void ws_display_ui_helper::clear_scr_load() { _dispDriver->esp32_lvgl_release(); } +/**************************************************************************/ +/*! + @brief Build and display an error screen. + @param lblError + The generic error. + @param lblDesc + Instructions or steps to resolve the error. +*/ +/**************************************************************************/ +void ws_display_ui_helper::show_scr_error(const char *lblError, + const char *lblDesc) { + Serial.println("ws_display_ui_helper"); + // clear the active loading screen (for now, will eventually expand to take in + // a scr obj.) + + _dispDriver->esp32_lvgl_acquire(); + clear_scr_load(); + + // Create error symbol + labelErrorTriangle = lv_label_create(lv_scr_act()); + lv_label_set_text(labelErrorTriangle, SYMBOL_ERROR_TRIANGLE); + + lv_style_init(&styleErrorTriangle); + lv_style_set_text_color(&styleErrorTriangle, lv_color_white()); + lv_style_set_text_font(&styleErrorTriangle, &errorTriangle); + lv_obj_add_style(labelErrorTriangle, &styleErrorTriangle, LV_PART_MAIN); + lv_obj_align(labelErrorTriangle, LV_ALIGN_TOP_MID, 0, 5); + + // Add error label (large) + labelErrorHeader = lv_label_create(lv_scr_act()); + lv_label_set_text(labelErrorHeader, lblError); + + lv_style_init(&styleLabelErrorLarge); + lv_style_set_text_color(&styleLabelErrorLarge, lv_color_white()); + lv_style_set_text_font(&styleLabelErrorLarge, &lv_font_montserrat_18); + lv_obj_add_style(labelErrorHeader, &styleLabelErrorLarge, LV_PART_MAIN); + lv_obj_align(labelErrorHeader, LV_ALIGN_CENTER, 0, -5); + + // Add error label (small) + labelErrorBody = lv_label_create(lv_scr_act()); + lv_label_set_long_mode(labelErrorBody, LV_LABEL_LONG_WRAP); + lv_label_set_text(labelErrorBody, lblDesc); + + lv_style_init(&styleLabelErrorSmall); + lv_style_set_text_color(&styleLabelErrorSmall, lv_color_white()); + lv_style_set_text_font(&styleLabelErrorSmall, &lv_font_montserrat_12); + lv_obj_add_style(labelErrorBody, &styleLabelErrorSmall, LV_PART_MAIN); + // set_width used by LABEL_LONG_WRAP + lv_obj_set_width(labelErrorBody, 220); + lv_obj_align(labelErrorBody, LV_ALIGN_CENTER, -3, 55); + + _dispDriver->esp32_lvgl_release(); +} + /**************************************************************************/ /*! @brief Build and display the activity screen @@ -278,59 +332,5 @@ void ws_display_ui_helper::build_scr_activity() { lv_label_set_text_static(terminalLabel, consoleTextBuf); lv_obj_move_background(terminalLabel); - _dispDriver->esp32_lvgl_release(); -} - -/**************************************************************************/ -/*! - @brief Build and display an error screen. - @param lblError - The generic error. - @param lblDesc - Instructions or steps to resolve the error. -*/ -/**************************************************************************/ -void ws_display_ui_helper::show_scr_error(const char *lblError, - const char *lblDesc) { - Serial.println("ws_display_ui_helper"); - // clear the active loading screen (for now, will eventually expand to take in - // a scr obj.) - - _dispDriver->esp32_lvgl_acquire(); - clear_scr_load(); - - // Create error symbol - labelErrorTriangle = lv_label_create(lv_scr_act()); - lv_label_set_text(labelErrorTriangle, SYMBOL_ERROR_TRIANGLE); - - lv_style_init(&styleErrorTriangle); - lv_style_set_text_color(&styleErrorTriangle, lv_color_white()); - lv_style_set_text_font(&styleErrorTriangle, &errorTriangle); - lv_obj_add_style(labelErrorTriangle, &styleErrorTriangle, LV_PART_MAIN); - lv_obj_align(labelErrorTriangle, LV_ALIGN_TOP_MID, 0, 5); - - // Add error label (large) - labelErrorHeader = lv_label_create(lv_scr_act()); - lv_label_set_text(labelErrorHeader, lblError); - - lv_style_init(&styleLabelErrorLarge); - lv_style_set_text_color(&styleLabelErrorLarge, lv_color_white()); - lv_style_set_text_font(&styleLabelErrorLarge, &lv_font_montserrat_18); - lv_obj_add_style(labelErrorHeader, &styleLabelErrorLarge, LV_PART_MAIN); - lv_obj_align(labelErrorHeader, LV_ALIGN_CENTER, 0, -5); - - // Add error label (small) - labelErrorBody = lv_label_create(lv_scr_act()); - lv_label_set_long_mode(labelErrorBody, LV_LABEL_LONG_WRAP); - lv_label_set_text(labelErrorBody, lblDesc); - - lv_style_init(&styleLabelErrorSmall); - lv_style_set_text_color(&styleLabelErrorSmall, lv_color_white()); - lv_style_set_text_font(&styleLabelErrorSmall, &lv_font_montserrat_12); - lv_obj_add_style(labelErrorBody, &styleLabelErrorSmall, LV_PART_MAIN); - // set_width used by LABEL_LONG_WRAP - lv_obj_set_width(labelErrorBody, 220); - lv_obj_align(labelErrorBody, LV_ALIGN_CENTER, -3, 55); - _dispDriver->esp32_lvgl_release(); } \ No newline at end of file diff --git a/src/display/ws_display_ui_helper.h b/src/display/ws_display_ui_helper.h index 62ff1fdd4..3a5f9eb8d 100644 --- a/src/display/ws_display_ui_helper.h +++ b/src/display/ws_display_ui_helper.h @@ -21,25 +21,22 @@ #include "ws_display_tooltips.h" #include -// External Fonts +/********************** + * MACROS + **********************/ +#define MAX_CONSOLE_TEXT_LEN 430 ///< Maximum text length on the console +/* External fonts and symbols */ #define SYMBOL_CODE "\xEF\x87\x89" ///< Symbol code for file icon #define SYMBOL_WIFI "\xEF\x87\xAB" ///< Symbol code for WiFi icon #define SYMBOL_TURTLE30PX "\xEF\x9C\xA6" ///< Symbol code for turtle icon #define SYMBOL_CLOUD "\xEF\x83\x82" ///< Symbol code for cloud icon #define SYMBOL_ERROR_TRIANGLE \ "\xEF\x81\xB1" ///< Symbol code for error triangle icon -LV_FONT_DECLARE(errorTriangle); -LV_FONT_DECLARE(file); -LV_FONT_DECLARE(wifi_30px); -LV_FONT_DECLARE(cloud_30px); -LV_FONT_DECLARE(turtle_30px); -LV_FONT_DECLARE(circle_30px); - -// Images -LV_IMG_DECLARE(ws_icon_100px); -/* Screen: Loading */ -// Objects +/********************** + * STATIC VARIABLES + **********************/ +/* Loading screen */ static lv_obj_t *imgWSLogo; static lv_obj_t *lblIconFile; static lv_obj_t *lblIconWiFi; @@ -47,35 +44,43 @@ static lv_obj_t *labelTurtleBar; static lv_obj_t *labelCloudBar; static lv_obj_t *lblStatusText; static lv_obj_t *lblTipText; -// Styles static lv_style_t styleIconFile; static lv_style_t styleIconWiFi; static lv_style_t styleIconTurtle30px; static lv_style_t styleIconCloud; static lv_style_t styleIconCheckmark; -/* Screen: Error */ -// Objects +/* Error screen */ static lv_obj_t *labelErrorTriangle; static lv_obj_t *labelErrorHeader; static lv_obj_t *labelErrorBody; -// Styles static lv_style_t styleErrorTriangle; static lv_style_t styleLabelErrorLarge; static lv_style_t styleLabelErrorSmall; -/* Screen: Activity */ -#define MAX_CONSOLE_TEXT_LEN 430 -static char consoleTextBuf[MAX_CONSOLE_TEXT_LEN + 1]; // + '\0' -// Objects +/* Activity screen */ static lv_obj_t *canvasStatusBar; static lv_draw_rect_dsc_t *rect_dsc; static lv_obj_t *statusbar_icon_bat; static lv_obj_t *statusbar_icon_wifi; static lv_obj_t *terminalLabel; -// Styles static lv_style_t *styleTerminalLabel; +/********************** + * IMAGE DECLARE + **********************/ +LV_FONT_DECLARE(errorTriangle); +LV_FONT_DECLARE(file); +LV_FONT_DECLARE(wifi_30px); +LV_FONT_DECLARE(cloud_30px); +LV_FONT_DECLARE(turtle_30px); +LV_FONT_DECLARE(circle_30px); + +/********************** + * Timers + **********************/ +static lv_timer_t *timerLoadTips; + enum loadBarIcons { loadBarIconFile, loadBarIconWifi, @@ -84,11 +89,11 @@ enum loadBarIcons { loadBarIconCheckmark }; ///< Icon names for use by set_load_bar_icon_complete -// holds all the loading tips -static const char *loading_tips[4] = {WS_LOADING_TIP_1, WS_LOADING_TIP_2, - WS_LOADING_TIP_3, WS_LOADING_TIP_4}; - -static lv_timer_t *timerLoadTips; +static const char *loading_tips[4] = { + WS_LOADING_TIP_1, WS_LOADING_TIP_2, WS_LOADING_TIP_3, + WS_LOADING_TIP_4}; ///< Holds the loading "tips" +static char consoleTextBuf[MAX_CONSOLE_TEXT_LEN + + 1]; ///< Contains all text displayed on the terminal class ws_display_driver; From 16baebeec21a197d732df3ce7639e62560833259 Mon Sep 17 00:00:00 2001 From: brentru Date: Thu, 8 Jun 2023 14:24:49 -0400 Subject: [PATCH 31/90] add text to terminal --- src/display/ws_display_ui_helper.cpp | 62 +++++++++++++++++++++++++++- src/display/ws_display_ui_helper.h | 6 ++- 2 files changed, 65 insertions(+), 3 deletions(-) diff --git a/src/display/ws_display_ui_helper.cpp b/src/display/ws_display_ui_helper.cpp index d0cc75ac9..6ab23dde5 100644 --- a/src/display/ws_display_ui_helper.cpp +++ b/src/display/ws_display_ui_helper.cpp @@ -329,8 +329,68 @@ void ws_display_ui_helper::build_scr_activity() { lv_style_init(styleTerminalLabel); lv_style_set_text_color(styleTerminalLabel, lv_color_white()); lv_obj_add_style(terminalLabel, styleTerminalLabel, LV_PART_MAIN); - lv_label_set_text_static(terminalLabel, consoleTextBuf); + lv_label_set_text_static(terminalLabel, terminalTextBuffer); lv_obj_move_background(terminalLabel); + _dispDriver->esp32_lvgl_release(); +} + +/**************************************************************************/ +/*! + @brief Adds a line of text on the terminal label and displays it. + @param text + A line of text to display on the terminal. + @note Reference: + https://github.com/lvgl/lv_demos/blob/release/v6/lv_apps/terminal/terminal.c +*/ +/**************************************************************************/ +void ws_display_ui_helper::addToTerminal(const char *text) { + // Calculate text size + size_t txt_len = strlen(text); + size_t old_len = strlen(terminalTextBuffer); + + // If the data is longer then the terminal ax size show the last part of data + if (txt_len > MAX_CONSOLE_TEXT_LEN) { + text += (txt_len - MAX_CONSOLE_TEXT_LEN); + txt_len = MAX_CONSOLE_TEXT_LEN; + old_len = 0; + } + + // If the text become too long 'forget' the oldest lines + else if (old_len + txt_len > MAX_CONSOLE_TEXT_LEN) { + uint16_t new_start; + for (new_start = 0; new_start < old_len; new_start++) { + if (terminalTextBuffer[new_start] == '\n') { + if (new_start >= txt_len) { + while (terminalTextBuffer[new_start] == '\n' || + terminalTextBuffer[new_start] == '\r') + new_start++; + break; + } + } + } + + // If it wasn't able to make enough space on line breaks simply forget the + // oldest characters + if (new_start == old_len) { + new_start = old_len - (MAX_CONSOLE_TEXT_LEN - txt_len); + } + + // Move the remaining text to the beginning + uint16_t j; + for (j = new_start; j < old_len; j++) { + terminalTextBuffer[j - new_start] = terminalTextBuffer[j]; + } + old_len = old_len - new_start; + terminalTextBuffer[old_len] = '\0'; + } + + // Copy new text to the text buffer + memcpy(&terminalTextBuffer[old_len], text, txt_len); + terminalTextBuffer[old_len + txt_len] = '\0'; + + // Update terminal label + _dispDriver->esp32_lvgl_acquire(); + lv_label_set_text_static(terminalLabel, terminalTextBuffer); _dispDriver->esp32_lvgl_release(); } \ No newline at end of file diff --git a/src/display/ws_display_ui_helper.h b/src/display/ws_display_ui_helper.h index 3a5f9eb8d..d09860fe1 100644 --- a/src/display/ws_display_ui_helper.h +++ b/src/display/ws_display_ui_helper.h @@ -92,8 +92,9 @@ enum loadBarIcons { static const char *loading_tips[4] = { WS_LOADING_TIP_1, WS_LOADING_TIP_2, WS_LOADING_TIP_3, WS_LOADING_TIP_4}; ///< Holds the loading "tips" -static char consoleTextBuf[MAX_CONSOLE_TEXT_LEN + - 1]; ///< Contains all text displayed on the terminal +static char + terminalTextBuffer[MAX_CONSOLE_TEXT_LEN + + 1]; ///< Contains all text displayed on the terminal class ws_display_driver; @@ -120,5 +121,6 @@ class ws_display_ui_helper { private: ws_display_driver *_dispDriver = nullptr; + void addToTerminal(const char *text); }; #endif // WS_DISPLAY_UI_HELPER_H From 2d3c3f8173d061cb3932fbcc13bb9a05743a8e6e Mon Sep 17 00:00:00 2001 From: brentru Date: Thu, 8 Jun 2023 14:30:51 -0400 Subject: [PATCH 32/90] add pipe for ping --- src/Wippersnapper.cpp | 1 + src/display/ws_display_ui_helper.cpp | 12 ++++++++++++ src/display/ws_display_ui_helper.h | 1 + 3 files changed, 14 insertions(+) diff --git a/src/Wippersnapper.cpp b/src/Wippersnapper.cpp index d1b1e58c7..a8b5819e0 100644 --- a/src/Wippersnapper.cpp +++ b/src/Wippersnapper.cpp @@ -2161,6 +2161,7 @@ void Wippersnapper::pingBroker() { if (millis() > (_prv_ping + (WS_KEEPALIVE_INTERVAL_MS - (WS_KEEPALIVE_INTERVAL_MS * 0.10)))) { WS_DEBUG_PRINTLN("PING!"); + WS._ui_helper->add_text_to_terminal("[NET] Pinging IO..OK!"); WS._mqtt->ping(); _prv_ping = millis(); } diff --git a/src/display/ws_display_ui_helper.cpp b/src/display/ws_display_ui_helper.cpp index 6ab23dde5..cf7b15851 100644 --- a/src/display/ws_display_ui_helper.cpp +++ b/src/display/ws_display_ui_helper.cpp @@ -335,6 +335,18 @@ void ws_display_ui_helper::build_scr_activity() { _dispDriver->esp32_lvgl_release(); } +/**************************************************************************/ +/*! + @brief Add text on the terminal label and displays it. + @param text + Text to display on the terminal, should end in "\n" +*/ +/**************************************************************************/ +void ws_display_ui_helper::add_text_to_terminal(const char *text) { + snprintf(terminalTextBuffer, 256, text); + addToTerminal(terminalTextBuffer); +} + /**************************************************************************/ /*! @brief Adds a line of text on the terminal label and displays it. diff --git a/src/display/ws_display_ui_helper.h b/src/display/ws_display_ui_helper.h index d09860fe1..65f3f8221 100644 --- a/src/display/ws_display_ui_helper.h +++ b/src/display/ws_display_ui_helper.h @@ -113,6 +113,7 @@ class ws_display_ui_helper { void show_scr_load(); void clear_scr_load(); void build_scr_activity(); + void add_text_to_terminal(const char *text); void set_load_bar_icon_complete(loadBarIcons iconType); void set_label_status(const char *text); // callback ui help? void remove_tip_timer(); From 468d47ab28d51d9935639078a6a5a2e89d9e8ab9 Mon Sep 17 00:00:00 2001 From: brentru Date: Thu, 8 Jun 2023 14:51:02 -0400 Subject: [PATCH 33/90] add pipe for initDigitalPin 1 --- src/components/digitalIO/Wippersnapper_DigitalGPIO.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/components/digitalIO/Wippersnapper_DigitalGPIO.cpp b/src/components/digitalIO/Wippersnapper_DigitalGPIO.cpp index d32bfcee2..d89b21d7c 100644 --- a/src/components/digitalIO/Wippersnapper_DigitalGPIO.cpp +++ b/src/components/digitalIO/Wippersnapper_DigitalGPIO.cpp @@ -70,9 +70,16 @@ void Wippersnapper_DigitalGPIO::initDigitalPin( if (pinName == STATUS_LED_PIN) releaseStatusLED(); #endif + pinMode(pinName, OUTPUT); + WS_DEBUG_PRINT("Configured digital output pin on D"); WS_DEBUG_PRINTLN(pinName); - pinMode(pinName, OUTPUT); + + char buffer[100]; + snprintf(buffer, 100, "[Pin] Configured Digital Output on D%u", pinName); + WS._ui_helper->add_text_to_terminal(buffer); + + // Initialize LOW #if defined(ARDUINO_ESP8266_ADAFRUIT_HUZZAH) // The Adafruit Feather ESP8266's built-in LED is reverse wired so setting From 18e33d100edb480a828551ca00c594c5cd2c3703 Mon Sep 17 00:00:00 2001 From: brentru Date: Mon, 12 Jun 2023 19:18:49 -0400 Subject: [PATCH 34/90] add turtle icon back --- src/Wippersnapper.cpp | 6 +- src/display/symbols/turtle_20.c | 136 +++++++++++++++++++++++ src/display/ws_display_ui_helper.cpp | 160 ++++++++++++++------------- src/display/ws_display_ui_helper.h | 10 +- 4 files changed, 230 insertions(+), 82 deletions(-) create mode 100644 src/display/symbols/turtle_20.c diff --git a/src/Wippersnapper.cpp b/src/Wippersnapper.cpp index a8b5819e0..c703ca013 100644 --- a/src/Wippersnapper.cpp +++ b/src/Wippersnapper.cpp @@ -2161,7 +2161,8 @@ void Wippersnapper::pingBroker() { if (millis() > (_prv_ping + (WS_KEEPALIVE_INTERVAL_MS - (WS_KEEPALIVE_INTERVAL_MS * 0.10)))) { WS_DEBUG_PRINTLN("PING!"); - WS._ui_helper->add_text_to_terminal("[NET] Pinging IO..OK!"); + // TODO: Add back, is crashing currently + WS._ui_helper->add_text_to_terminal("[NET] Pinging IO...OK!\n"); WS._mqtt->ping(); _prv_ping = millis(); } @@ -2396,12 +2397,15 @@ void Wippersnapper::connect() { // goto application #ifdef USE_DISPLAY + WS_DEBUG_PRINTLN("Clearing loading screen..."); WS._ui_helper->clear_scr_load(); + WS_DEBUG_PRINTLN("building activity screen..."); WS._ui_helper->build_scr_activity(); #endif statusLEDFade(GREEN, 3); WS_DEBUG_PRINTLN( "Registration and configuration complete!\nRunning application..."); + } /**************************************************************************/ diff --git a/src/display/symbols/turtle_20.c b/src/display/symbols/turtle_20.c new file mode 100644 index 000000000..98e75b451 --- /dev/null +++ b/src/display/symbols/turtle_20.c @@ -0,0 +1,136 @@ +/******************************************************************************* + * Size: 20 px + * Bpp: 4 + * Opts: + ******************************************************************************/ + +#ifdef LV_LVGL_H_INCLUDE_SIMPLE +#include "lvgl.h" +#else +#include +#endif + +#ifndef TURTLE_20 +#define TURTLE_20 1 +#endif + +#if TURTLE_20 + +/*----------------- + * BITMAPS + *----------------*/ + +/*Store the image of the glyphs*/ +static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = { + /* U+F726 "" */ + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x7d, 0xff, + 0xe9, 0x10, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x3, 0xdf, 0xff, 0xff, 0xfe, 0x50, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x2, 0xff, 0xff, 0xff, 0xff, + 0xff, 0x50, 0x0, 0x0, 0x0, 0x0, 0x0, 0xcf, + 0xff, 0xff, 0xff, 0xff, 0xfe, 0x10, 0x19, 0xdc, + 0x60, 0x0, 0x5f, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xf8, 0xa, 0xff, 0xff, 0x90, 0x9, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xd0, 0xef, 0xff, 0xff, + 0x30, 0xbf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xe, 0xfc, 0x5f, 0xf6, 0xc, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xf0, 0xef, 0xeb, 0xff, 0x70, + 0xbf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf, + 0xff, 0xff, 0xf3, 0x3, 0xdf, 0xff, 0xff, 0xff, + 0xff, 0xfe, 0x64, 0xff, 0xff, 0xd5, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x5, 0xef, 0xf1, + 0x0, 0x0, 0x9f, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xf7, 0x0, 0x0, 0xd, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xf7, 0x0, 0x0, + 0x0, 0x27, 0xcf, 0xff, 0xfc, 0xaf, 0xff, 0xfd, + 0x51, 0x0, 0x0, 0x0, 0x0, 0x8, 0xff, 0xff, + 0x84, 0xff, 0xff, 0xc0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x7f, 0xff, 0xf7, 0x3f, 0xff, 0xfb, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x2, 0xff, 0xff, 0x20, + 0xdf, 0xff, 0x60, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x1, 0x33, 0x10, 0x0, 0x34, 0x10, 0x0, 0x0, + 0x0, 0x0, 0x0 +}; + + +/*--------------------- + * GLYPH DESCRIPTION + *--------------------*/ + +static const lv_font_fmt_txt_glyph_dsc_t glyph_dsc[] = { + {.bitmap_index = 0, .adv_w = 0, .box_w = 0, .box_h = 0, .ofs_x = 0, .ofs_y = 0} /* id = 0 reserved */, + {.bitmap_index = 0, .adv_w = 360, .box_w = 23, .box_h = 19, .ofs_x = 0, .ofs_y = -2} +}; + +/*--------------------- + * CHARACTER MAPPING + *--------------------*/ + + + +/*Collect the unicode lists and glyph_id offsets*/ +static const lv_font_fmt_txt_cmap_t cmaps[] = +{ + { + .range_start = 63270, .range_length = 1, .glyph_id_start = 1, + .unicode_list = NULL, .glyph_id_ofs_list = NULL, .list_length = 0, .type = LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY + } +}; + + + +/*-------------------- + * ALL CUSTOM DATA + *--------------------*/ + +#if LV_VERSION_CHECK(8, 0, 0) +/*Store all the custom data of the font*/ +static lv_font_fmt_txt_glyph_cache_t cache; +static const lv_font_fmt_txt_dsc_t font_dsc = { +#else +static lv_font_fmt_txt_dsc_t font_dsc = { +#endif + .glyph_bitmap = glyph_bitmap, + .glyph_dsc = glyph_dsc, + .cmaps = cmaps, + .kern_dsc = NULL, + .kern_scale = 0, + .cmap_num = 1, + .bpp = 4, + .kern_classes = 0, + .bitmap_format = 0, +#if LV_VERSION_CHECK(8, 0, 0) + .cache = &cache +#endif +}; + + +/*----------------- + * PUBLIC FONT + *----------------*/ + +/*Initialize a public general font descriptor*/ +#if LV_VERSION_CHECK(8, 0, 0) +const lv_font_t turtle_20 = { +#else +lv_font_t turtle_20 = { +#endif + .get_glyph_dsc = lv_font_get_glyph_dsc_fmt_txt, /*Function pointer to get glyph's data*/ + .get_glyph_bitmap = lv_font_get_bitmap_fmt_txt, /*Function pointer to get glyph's bitmap*/ + .line_height = 19, /*The maximum line height required by the font*/ + .base_line = 2, /*Baseline measured from the bottom of the line*/ +#if !(LVGL_VERSION_MAJOR == 6 && LVGL_VERSION_MINOR == 0) + .subpx = LV_FONT_SUBPX_NONE, +#endif +#if LV_VERSION_CHECK(7, 4, 0) || LVGL_VERSION_MAJOR >= 8 + .underline_position = 0, + .underline_thickness = 0, +#endif + .dsc = &font_dsc /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */ +}; + + + +#endif /*#if TURTLE_20*/ + diff --git a/src/display/ws_display_ui_helper.cpp b/src/display/ws_display_ui_helper.cpp index cf7b15851..4a0d7e8b9 100644 --- a/src/display/ws_display_ui_helper.cpp +++ b/src/display/ws_display_ui_helper.cpp @@ -1,7 +1,7 @@ /*! * @file ws_display_ui_helper.cpp * - * LVGL "helper" class for WipperSnapper. + * LVGL UI Helper class for WipperSnapper * * Adafruit invests time and resources providing this open source code, * please support Adafruit and open-source hardware by purchasing @@ -25,8 +25,10 @@ void lv_timer_tips_cb(lv_timer_t *timer) { Serial.println("Timer tips cb called"); long tipNum = random(0, sizeof(loading_tips) / sizeof(loading_tips[0])); + // TODO: Why is acquire and release commented out here? // _dispDriver->esp32_lvgl_acquire(); lv_label_set_text(lblTipText, loading_tips[tipNum]); + // TODO: Why is acquire and release commented out here? // _dispDriver->esp32_lvgl_release(); } @@ -285,53 +287,56 @@ void ws_display_ui_helper::build_scr_activity() { _dispDriver->esp32_lvgl_acquire(); // add canvas to create a status bar - canvasStatusBar = lv_canvas_create(lv_scr_act()); + lv_obj_t * canvas = lv_canvas_create(lv_scr_act()); static uint8_t buffer[LV_CANVAS_BUF_SIZE_TRUE_COLOR(240, 25)]; - lv_canvas_set_buffer(canvasStatusBar, buffer, 240, 25, LV_IMG_CF_TRUE_COLOR); - lv_canvas_fill_bg(canvasStatusBar, lv_color_black(), LV_OPA_COVER); - // draw rectangle on the canvas - rect_dsc->bg_color = lv_palette_main(LV_PALETTE_GREY); - rect_dsc->bg_opa = LV_OPA_COVER; - lv_draw_rect_dsc_init(rect_dsc); - lv_canvas_draw_rect(canvasStatusBar, 0, 0, 240, 25, rect_dsc); - - // add battery icon to status bar - // Future TODO: Optional timer cb funcn to check battery level on some boards + lv_canvas_set_buffer(canvas, buffer, 240, 25, LV_IMG_CF_TRUE_COLOR); + lv_canvas_fill_bg(canvas, lv_color_black(), LV_OPA_COVER); + lv_draw_rect_dsc_t rect_dsc; + rect_dsc.bg_color = lv_palette_main(LV_PALETTE_GREY); + rect_dsc.bg_opa = LV_OPA_COVER; + lv_draw_rect_dsc_init(&rect_dsc); + lv_canvas_draw_rect(canvas, 0, 0, 240, 25, &rect_dsc); + + // Add battery icon to status bar + // Future TODO: Optional timer to check battery level on some boards + // Note: FunHouse won't require this and should always be have a full battery displayed statusbar_icon_bat = lv_label_create(lv_scr_act()); lv_label_set_text(statusbar_icon_bat, LV_SYMBOL_BATTERY_FULL); lv_obj_align(statusbar_icon_bat, LV_ALIGN_TOP_RIGHT, -5, 6); - // add WiFi icon to status bar + // Add WiFi icon to status bar + // Future TODO: Timer to check if we are still connected to WiFi levels every 2000ms statusbar_icon_wifi = lv_label_create(lv_scr_act()); lv_label_set_text(statusbar_icon_wifi, LV_SYMBOL_WIFI); lv_obj_align(statusbar_icon_wifi, LV_ALIGN_TOP_RIGHT, -30, 5); - // add turtle icon to status bar - // TODO: Maybe we'll just write WipperSnapper here instead? - /* lv_obj_t *labelTurtleBar = lv_label_create(lv_scr_act()); - lv_label_set_text(labelTurtleBar, SYMBOL_TURTLE); - static lv_style_t styleIconTurtle30px; - lv_style_init(&styleIconTurtle30px); - lv_style_set_text_color(&styleIconTurtle30px, - lv_palette_main(LV_PALETTE_GREEN)); - lv_style_set_text_font(&styleIconTurtle30px, &turtle_20); - lv_obj_add_style(labelTurtleBar, &styleIconTurtle30px, - LV_PART_MAIN); - lv_obj_align(labelTurtleBar, LV_ALIGN_TOP_LEFT, 5, 5); */ - - // add a label to hold the terminal text - // TODO: Still have overlap between the top console text and the - // status bar that we need to remove before release + // Add Turtle icon to status bar + lv_obj_t *labelTurtleBar = lv_label_create(lv_scr_act()); + lv_label_set_text(labelTurtleBar, SYMBOL_TURTLE30PX); + static lv_style_t styleIconTurtle30px; + lv_style_init(&styleIconTurtle30px); + lv_style_set_text_color(&styleIconTurtle30px, + lv_palette_main(LV_PALETTE_GREEN)); + lv_style_set_text_font(&styleIconTurtle30px, &turtle_20); + lv_obj_add_style(labelTurtleBar, &styleIconTurtle30px, + LV_PART_MAIN); + lv_obj_align(labelTurtleBar, LV_ALIGN_TOP_LEFT, 5, 5); + + // Add a label to hold console text + // TODO: Still having some overlap between the top console text and the + // status bar.. this should be fixed in the sim. first before release terminalLabel = lv_label_create(lv_scr_act()); lv_obj_align(terminalLabel, LV_ALIGN_BOTTOM_LEFT, 3, 0); lv_obj_set_width(terminalLabel, 230); lv_label_set_long_mode(terminalLabel, LV_LABEL_LONG_WRAP); - lv_style_init(styleTerminalLabel); - lv_style_set_text_color(styleTerminalLabel, lv_color_white()); - lv_obj_add_style(terminalLabel, styleTerminalLabel, LV_PART_MAIN); + lv_style_init(&styleTerminalLabel); + lv_style_set_text_color(&styleTerminalLabel, lv_color_white()); + lv_obj_add_style(terminalLabel, &styleTerminalLabel, LV_PART_MAIN); lv_label_set_text_static(terminalLabel, terminalTextBuffer); lv_obj_move_background(terminalLabel); + Serial.println("main app. screen built!"); + _dispDriver->esp32_lvgl_release(); } @@ -343,8 +348,10 @@ void ws_display_ui_helper::build_scr_activity() { */ /**************************************************************************/ void ws_display_ui_helper::add_text_to_terminal(const char *text) { - snprintf(terminalTextBuffer, 256, text); - addToTerminal(terminalTextBuffer); + Serial.println("add_text_to_terminal"); + char txtBuffer[256]; // temporary text buffer for snprintf + snprintf(txtBuffer, 256, text); + addToTerminal(txtBuffer); } /**************************************************************************/ @@ -356,53 +363,52 @@ void ws_display_ui_helper::add_text_to_terminal(const char *text) { https://github.com/lvgl/lv_demos/blob/release/v6/lv_apps/terminal/terminal.c */ /**************************************************************************/ -void ws_display_ui_helper::addToTerminal(const char *text) { - // Calculate text size - size_t txt_len = strlen(text); - size_t old_len = strlen(terminalTextBuffer); - - // If the data is longer then the terminal ax size show the last part of data - if (txt_len > MAX_CONSOLE_TEXT_LEN) { - text += (txt_len - MAX_CONSOLE_TEXT_LEN); - txt_len = MAX_CONSOLE_TEXT_LEN; - old_len = 0; - } +void ws_display_ui_helper::addToTerminal(const char * txt_in) +{ + // Calculate text size + size_t txt_len = strlen(txt_in); + size_t old_len = strlen(terminalTextBuffer); + + // If the data is longer then the terminal ax size show the last part of data + if(txt_len > MAX_CONSOLE_TEXT_LEN) { + txt_in += (txt_len - MAX_CONSOLE_TEXT_LEN); + txt_len = MAX_CONSOLE_TEXT_LEN; + old_len = 0; + } - // If the text become too long 'forget' the oldest lines - else if (old_len + txt_len > MAX_CONSOLE_TEXT_LEN) { - uint16_t new_start; - for (new_start = 0; new_start < old_len; new_start++) { - if (terminalTextBuffer[new_start] == '\n') { - if (new_start >= txt_len) { - while (terminalTextBuffer[new_start] == '\n' || - terminalTextBuffer[new_start] == '\r') - new_start++; - break; + // If the text become too long 'forget' the oldest lines + else if(old_len + txt_len > MAX_CONSOLE_TEXT_LEN) { + uint16_t new_start; + for(new_start = 0; new_start < old_len; new_start++) { + if(terminalTextBuffer[new_start] == '\n') { + if(new_start >= txt_len) { + while(terminalTextBuffer[new_start] == '\n' || terminalTextBuffer[new_start] == '\r') new_start++; + break; + } + } } - } - } - // If it wasn't able to make enough space on line breaks simply forget the - // oldest characters - if (new_start == old_len) { - new_start = old_len - (MAX_CONSOLE_TEXT_LEN - txt_len); - } + // If it wasn't able to make enough space on line breaks simply forget the oldest characters + if(new_start == old_len) { + new_start = old_len - (MAX_CONSOLE_TEXT_LEN - txt_len); + } + + // Move the remaining text to the beginning + uint16_t j; + for(j = new_start; j < old_len; j++) { + terminalTextBuffer[j - new_start] = terminalTextBuffer[j]; + } + old_len = old_len - new_start; + terminalTextBuffer[old_len] = '\0'; - // Move the remaining text to the beginning - uint16_t j; - for (j = new_start; j < old_len; j++) { - terminalTextBuffer[j - new_start] = terminalTextBuffer[j]; } - old_len = old_len - new_start; - terminalTextBuffer[old_len] = '\0'; - } - // Copy new text to the text buffer - memcpy(&terminalTextBuffer[old_len], text, txt_len); - terminalTextBuffer[old_len + txt_len] = '\0'; + // Copy new text to the text buffer + memcpy(&terminalTextBuffer[old_len], txt_in, txt_len); + terminalTextBuffer[old_len + txt_len] = '\0'; - // Update terminal label - _dispDriver->esp32_lvgl_acquire(); - lv_label_set_text_static(terminalLabel, terminalTextBuffer); - _dispDriver->esp32_lvgl_release(); -} \ No newline at end of file + // Update label + _dispDriver->esp32_lvgl_acquire(); + lv_label_set_text_static(terminalLabel, terminalTextBuffer); + _dispDriver->esp32_lvgl_release(); +} diff --git a/src/display/ws_display_ui_helper.h b/src/display/ws_display_ui_helper.h index 65f3f8221..fbcae470a 100644 --- a/src/display/ws_display_ui_helper.h +++ b/src/display/ws_display_ui_helper.h @@ -1,7 +1,7 @@ /*! * @file ws_display_ui_helper.h * - * LVGL "helper" class for WipperSnapper. + * LVGL UI Helper class for WipperSnapper * * Adafruit invests time and resources providing this open source code, * please support Adafruit and open-source hardware by purchasing @@ -63,8 +63,9 @@ static lv_obj_t *canvasStatusBar; static lv_draw_rect_dsc_t *rect_dsc; static lv_obj_t *statusbar_icon_bat; static lv_obj_t *statusbar_icon_wifi; +//static lv_obj_t *labelTurtleBar; static lv_obj_t *terminalLabel; -static lv_style_t *styleTerminalLabel; +static lv_style_t styleTerminalLabel; /********************** * IMAGE DECLARE @@ -74,6 +75,7 @@ LV_FONT_DECLARE(file); LV_FONT_DECLARE(wifi_30px); LV_FONT_DECLARE(cloud_30px); LV_FONT_DECLARE(turtle_30px); +LV_FONT_DECLARE(turtle_20); LV_FONT_DECLARE(circle_30px); /********************** @@ -94,7 +96,7 @@ static const char *loading_tips[4] = { WS_LOADING_TIP_4}; ///< Holds the loading "tips" static char terminalTextBuffer[MAX_CONSOLE_TEXT_LEN + - 1]; ///< Contains all text displayed on the terminal + 1]; ///< Contains all text actively displayed on the terminal class ws_display_driver; @@ -122,6 +124,6 @@ class ws_display_ui_helper { private: ws_display_driver *_dispDriver = nullptr; - void addToTerminal(const char *text); + void addToTerminal(const char *txt_in); }; #endif // WS_DISPLAY_UI_HELPER_H From 624029764f1e672519689391f0384a5d287099eb Mon Sep 17 00:00:00 2001 From: brentru Date: Mon, 12 Jun 2023 19:28:01 -0400 Subject: [PATCH 35/90] add digital init/deinit --- .../digitalIO/Wippersnapper_DigitalGPIO.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/components/digitalIO/Wippersnapper_DigitalGPIO.cpp b/src/components/digitalIO/Wippersnapper_DigitalGPIO.cpp index d89b21d7c..99c7e4a6b 100644 --- a/src/components/digitalIO/Wippersnapper_DigitalGPIO.cpp +++ b/src/components/digitalIO/Wippersnapper_DigitalGPIO.cpp @@ -76,7 +76,7 @@ void Wippersnapper_DigitalGPIO::initDigitalPin( WS_DEBUG_PRINTLN(pinName); char buffer[100]; - snprintf(buffer, 100, "[Pin] Configured Digital Output on D%u", pinName); + snprintf(buffer, 100, "[Pin] Configured Digital Output on D%u\n", pinName); WS._ui_helper->add_text_to_terminal(buffer); @@ -94,6 +94,7 @@ void Wippersnapper_DigitalGPIO::initDigitalPin( wippersnapper_pin_v1_ConfigurePinRequest_Direction_DIRECTION_INPUT) { WS_DEBUG_PRINT("Configuring digital input pin on D"); WS_DEBUG_PRINT(pinName); + if (pull == wippersnapper_pin_v1_ConfigurePinRequest_Pull_PULL_UP) { WS_DEBUG_PRINTLN("with internal pull-up enabled"); pinMode(pinName, INPUT_PULLUP); @@ -107,6 +108,10 @@ void Wippersnapper_DigitalGPIO::initDigitalPin( WS_DEBUG_PRINT("Interval (ms):"); WS_DEBUG_PRINTLN(periodMs); + char buffer[100]; + snprintf(buffer, 100, "[Pin] Configured Digital Input on D%u, polling every %lmS", pinName, periodMs); + WS._ui_helper->add_text_to_terminal(buffer); + // attempt to allocate a pinName within _digital_input_pins[] for (int i = 0; i < _totalDigitalInputPins; i++) { if (_digital_input_pins[i].period == -1L) { @@ -135,6 +140,11 @@ void Wippersnapper_DigitalGPIO::deinitDigitalPin( uint8_t pinName) { WS_DEBUG_PRINT("Deinitializing digital pin "); WS_DEBUG_PRINTLN(pinName); + + char buffer[100]; + snprintf(buffer, 100, "[Pin] De-initialized D%u", pinName); + WS._ui_helper->add_text_to_terminal(buffer); + if (direction == wippersnapper_pin_v1_ConfigurePinRequest_Direction_DIRECTION_INPUT) { // de-allocate the pin within digital_input_pins[] @@ -189,6 +199,8 @@ void Wippersnapper_DigitalGPIO::digitalWriteSvc(uint8_t pinName, int pinValue) { WS_DEBUG_PRINT(" to "); WS_DEBUG_PRINTLN(pinValue); + + // Write to the GPIO pin #if defined(ARDUINO_ESP8266_ADAFRUIT_HUZZAH) // The Adafruit Feather ESP8266's built-in LED is reverse wired so setting the From 19fa185f8155a176da28600b8ff2a1d668537e56 Mon Sep 17 00:00:00 2001 From: brentru Date: Mon, 12 Jun 2023 19:55:01 -0400 Subject: [PATCH 36/90] add pipes for digitalgpio.cpp --- .../digitalIO/Wippersnapper_DigitalGPIO.cpp | 27 ++++++++++++++----- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/src/components/digitalIO/Wippersnapper_DigitalGPIO.cpp b/src/components/digitalIO/Wippersnapper_DigitalGPIO.cpp index 99c7e4a6b..7b82cc5f9 100644 --- a/src/components/digitalIO/Wippersnapper_DigitalGPIO.cpp +++ b/src/components/digitalIO/Wippersnapper_DigitalGPIO.cpp @@ -74,12 +74,11 @@ void Wippersnapper_DigitalGPIO::initDigitalPin( WS_DEBUG_PRINT("Configured digital output pin on D"); WS_DEBUG_PRINTLN(pinName); - + char buffer[100]; snprintf(buffer, 100, "[Pin] Configured Digital Output on D%u\n", pinName); WS._ui_helper->add_text_to_terminal(buffer); - // Initialize LOW #if defined(ARDUINO_ESP8266_ADAFRUIT_HUZZAH) // The Adafruit Feather ESP8266's built-in LED is reverse wired so setting @@ -109,7 +108,9 @@ void Wippersnapper_DigitalGPIO::initDigitalPin( WS_DEBUG_PRINTLN(periodMs); char buffer[100]; - snprintf(buffer, 100, "[Pin] Configured Digital Input on D%u, polling every %lmS", pinName, periodMs); + snprintf(buffer, 100, + "[Pin] Configured Digital Input on D%u, polling every %lmS", + pinName, periodMs); WS._ui_helper->add_text_to_terminal(buffer); // attempt to allocate a pinName within _digital_input_pins[] @@ -141,9 +142,9 @@ void Wippersnapper_DigitalGPIO::deinitDigitalPin( WS_DEBUG_PRINT("Deinitializing digital pin "); WS_DEBUG_PRINTLN(pinName); - char buffer[100]; - snprintf(buffer, 100, "[Pin] De-initialized D%u", pinName); - WS._ui_helper->add_text_to_terminal(buffer); + char buffer[100]; + snprintf(buffer, 100, "[Pin] De-initialized D%u", pinName); + WS._ui_helper->add_text_to_terminal(buffer); if (direction == wippersnapper_pin_v1_ConfigurePinRequest_Direction_DIRECTION_INPUT) { @@ -199,7 +200,9 @@ void Wippersnapper_DigitalGPIO::digitalWriteSvc(uint8_t pinName, int pinValue) { WS_DEBUG_PRINT(" to "); WS_DEBUG_PRINTLN(pinValue); - + char buffer[100]; + snprintf(buffer, 100, "[Pin] Writing %d to D%u", pinValue, pinName); + WS._ui_helper->add_text_to_terminal(buffer); // Write to the GPIO pin #if defined(ARDUINO_ESP8266_ADAFRUIT_HUZZAH) @@ -235,6 +238,11 @@ void Wippersnapper_DigitalGPIO::processDigitalInputs() { // read the pin int pinVal = digitalReadSvc(_digital_input_pins[i].pinName); + char buffer[100]; + snprintf(buffer, 100, "[Pin] Read D%u: %d", + _digital_input_pins[i].pinName, pinVal); + WS._ui_helper->add_text_to_terminal(buffer); + // Create new signal message wippersnapper_signal_v1_CreateSignalRequest _outgoingSignalMsg = wippersnapper_signal_v1_CreateSignalRequest_init_zero; @@ -268,6 +276,11 @@ void Wippersnapper_DigitalGPIO::processDigitalInputs() { WS_DEBUG_PRINT("Executing state-based event on D"); WS_DEBUG_PRINTLN(_digital_input_pins[i].pinName); + char buffer[100]; + snprintf(buffer, 100, "[Pin] Read D%u: %d", + _digital_input_pins[i].pinName, pinVal); + WS._ui_helper->add_text_to_terminal(buffer); + // Create new signal message wippersnapper_signal_v1_CreateSignalRequest _outgoingSignalMsg = wippersnapper_signal_v1_CreateSignalRequest_init_zero; From 10e77489d4e2983cd9ae2425bda11453281e6e6c Mon Sep 17 00:00:00 2001 From: brentru Date: Mon, 12 Jun 2023 20:04:53 -0400 Subject: [PATCH 37/90] add pipe fo ranalog --- src/Wippersnapper.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/Wippersnapper.cpp b/src/Wippersnapper.cpp index c703ca013..c9b6ef43c 100644 --- a/src/Wippersnapper.cpp +++ b/src/Wippersnapper.cpp @@ -273,10 +273,21 @@ bool Wippersnapper::configAnalogInPinReq( wippersnapper_pin_v1_ConfigurePinRequest_RequestType_REQUEST_TYPE_CREATE) { WS._analogIO->initAnalogInputPin(pin, pinMsg->period, pinMsg->pull, pinMsg->analog_read_mode); + + char buffer[100]; + snprintf(buffer, 100, "[Pin] Reading %s every %f seconds\n.", + pinMsg->pin_name, pinMsg->period); + WS._ui_helper->add_text_to_terminal(buffer); + } else if ( pinMsg->request_type == wippersnapper_pin_v1_ConfigurePinRequest_RequestType_REQUEST_TYPE_DELETE) { WS._analogIO->deinitAnalogPin(pinMsg->direction, pin); + + char buffer[100]; + snprintf(buffer, 100, "[Pin] De-initialized pin %s\n.", pinMsg->pin_name); + WS._ui_helper->add_text_to_terminal(buffer); + } else { WS_DEBUG_PRINTLN("ERROR: Could not decode analog pin request!"); is_success = false; @@ -2405,7 +2416,6 @@ void Wippersnapper::connect() { statusLEDFade(GREEN, 3); WS_DEBUG_PRINTLN( "Registration and configuration complete!\nRunning application..."); - } /**************************************************************************/ From 1eeb1bcd15975e2164326748324f4b9c862753ef Mon Sep 17 00:00:00 2001 From: brentru Date: Tue, 13 Jun 2023 12:28:10 -0400 Subject: [PATCH 38/90] add pixels pipe, tested digital in/out --- src/Wippersnapper.cpp | 1 + .../digitalIO/Wippersnapper_DigitalGPIO.cpp | 10 +++++----- src/components/pixels/ws_pixels.cpp | 19 +++++++++++++++++++ 3 files changed, 25 insertions(+), 5 deletions(-) diff --git a/src/Wippersnapper.cpp b/src/Wippersnapper.cpp index c9b6ef43c..e5562d28f 100644 --- a/src/Wippersnapper.cpp +++ b/src/Wippersnapper.cpp @@ -1298,6 +1298,7 @@ bool cbDecodePixelsMsg(pb_istream_t *stream, const pb_field_t *field, &msgPixelsCreateReq)) { WS_DEBUG_PRINTLN("ERROR: Could not decode message of type " "wippersnapper_pixels_v1_PixelsCreateRequest!"); + WS._ui_helper->add_text_to_terminal("[Pixel] Error decoding message!\n"); return false; } diff --git a/src/components/digitalIO/Wippersnapper_DigitalGPIO.cpp b/src/components/digitalIO/Wippersnapper_DigitalGPIO.cpp index 7b82cc5f9..0ffad3ab1 100644 --- a/src/components/digitalIO/Wippersnapper_DigitalGPIO.cpp +++ b/src/components/digitalIO/Wippersnapper_DigitalGPIO.cpp @@ -109,7 +109,7 @@ void Wippersnapper_DigitalGPIO::initDigitalPin( char buffer[100]; snprintf(buffer, 100, - "[Pin] Configured Digital Input on D%u, polling every %lmS", + "[Pin] Configured Digital Input on D%u, polling every %lmS\n", pinName, periodMs); WS._ui_helper->add_text_to_terminal(buffer); @@ -143,7 +143,7 @@ void Wippersnapper_DigitalGPIO::deinitDigitalPin( WS_DEBUG_PRINTLN(pinName); char buffer[100]; - snprintf(buffer, 100, "[Pin] De-initialized D%u", pinName); + snprintf(buffer, 100, "[Pin] De-initialized D%u\n", pinName); WS._ui_helper->add_text_to_terminal(buffer); if (direction == @@ -201,7 +201,7 @@ void Wippersnapper_DigitalGPIO::digitalWriteSvc(uint8_t pinName, int pinValue) { WS_DEBUG_PRINTLN(pinValue); char buffer[100]; - snprintf(buffer, 100, "[Pin] Writing %d to D%u", pinValue, pinName); + snprintf(buffer, 100, "[Pin] Writing %d to D%u\n", pinValue, pinName); WS._ui_helper->add_text_to_terminal(buffer); // Write to the GPIO pin @@ -239,7 +239,7 @@ void Wippersnapper_DigitalGPIO::processDigitalInputs() { int pinVal = digitalReadSvc(_digital_input_pins[i].pinName); char buffer[100]; - snprintf(buffer, 100, "[Pin] Read D%u: %d", + snprintf(buffer, 100, "[Pin] Read D%u: %d\n", _digital_input_pins[i].pinName, pinVal); WS._ui_helper->add_text_to_terminal(buffer); @@ -277,7 +277,7 @@ void Wippersnapper_DigitalGPIO::processDigitalInputs() { WS_DEBUG_PRINTLN(_digital_input_pins[i].pinName); char buffer[100]; - snprintf(buffer, 100, "[Pin] Read D%u: %d", + snprintf(buffer, 100, "[Pin] Read D%u: %d\n", _digital_input_pins[i].pinName, pinVal); WS._ui_helper->add_text_to_terminal(buffer); diff --git a/src/components/pixels/ws_pixels.cpp b/src/components/pixels/ws_pixels.cpp index 2c77579cb..9ccedfcfb 100644 --- a/src/components/pixels/ws_pixels.cpp +++ b/src/components/pixels/ws_pixels.cpp @@ -264,6 +264,11 @@ bool ws_pixels::addStrand( WS_DEBUG_PRINT(pixelsCreateReqMsg->pixels_num); WS_DEBUG_PRINT(" on GPIO #"); WS_DEBUG_PRINTLN(pixelsCreateReqMsg->pixels_pin_neopixel); + + char buffer[100]; + snprintf(buffer, 100, "[Pixel] Added NeoPixel strand on Pin %s\n.", pixelsCreateReqMsg->pixels_pin_neopixel); + WS._ui_helper->add_text_to_terminal(buffer); + publishAddStrandResponse(true, pixelsCreateReqMsg->pixels_pin_neopixel); } else if (pixelsCreateReqMsg->pixels_type == wippersnapper_pixels_v1_PixelsType_PIXELS_TYPE_DOTSTAR) { @@ -298,6 +303,11 @@ bool ws_pixels::addStrand( WS_DEBUG_PRINT(strands[strandIdx].numPixels); WS_DEBUG_PRINT(" on Data GPIO #"); WS_DEBUG_PRINTLN(strands[strandIdx].pinDotStarData); + + char buffer[100]; + snprintf(buffer, 100, "[Pixel] Added NeoPixel strand on Pin %s\n.", pixelsCreateReqMsg->pixels_pin_neopixel); + WS._ui_helper->add_text_to_terminal(buffer); + publishAddStrandResponse(true, pixelsCreateReqMsg->pixels_pin_dotstar_data); } else { WS_DEBUG_PRINTLN("ERROR: Invalid strand type provided!"); @@ -356,6 +366,10 @@ void ws_pixels::deleteStrand( WS_DEBUG_PRINT("Deleted strand on data pin "); WS_DEBUG_PRINTLN(pixelsDeleteMsg->pixels_pin_data); + + char buffer[100]; + snprintf(buffer, 100, "[Pixel] Deleted strand on pin %s\n.", pixelsDeleteMsg->pixels_pin_data); + WS._ui_helper->add_text_to_terminal(buffer); } /**************************************************************************/ @@ -407,6 +421,11 @@ void ws_pixels::fillStrand( WS_DEBUG_PRINT("Filling color: "); WS_DEBUG_PRINTLN(pixelsWriteMsg->pixels_color); + + char buffer[100]; + snprintf(buffer, 100, "[Pixel] Filling strand on pin %s with color %u\n.", pixelsWriteMsg->pixels_pin_data, pixelsWriteMsg->pixels_color); + WS._ui_helper->add_text_to_terminal(buffer); + if (pixelsWriteMsg->pixels_type == wippersnapper_pixels_v1_PixelsType_PIXELS_TYPE_NEOPIXEL) { strands[strandIdx].neoPixelPtr->fill(rgbColorGamma); From 36f29b8a15e37acb0ccbab9180f7a9f4fe74c6d5 Mon Sep 17 00:00:00 2001 From: brentru Date: Tue, 13 Jun 2023 12:51:26 -0400 Subject: [PATCH 39/90] move the clear_scr_load above the hardware configuration step to avoid crash --- src/Wippersnapper.cpp | 16 +++++++++------- src/display/ws_display_ui_helper.cpp | 4 ++-- src/display/ws_display_ui_helper.h | 2 +- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/Wippersnapper.cpp b/src/Wippersnapper.cpp index e5562d28f..cb40a25a1 100644 --- a/src/Wippersnapper.cpp +++ b/src/Wippersnapper.cpp @@ -2394,6 +2394,14 @@ void Wippersnapper::connect() { runNetFSM(); WS.feedWDT(); +// switch to monitor screen +#ifdef USE_DISPLAY + WS_DEBUG_PRINTLN("Clearing loading screen..."); + WS._ui_helper->clear_scr_load(); + WS_DEBUG_PRINTLN("building monitor screen..."); + WS._ui_helper->build_scr_monitor(); +#endif + // Configure hardware WS.pinCfgCompleted = false; while (!WS.pinCfgCompleted) { @@ -2407,13 +2415,7 @@ void Wippersnapper::connect() { publishPinConfigComplete(); WS_DEBUG_PRINTLN("Hardware configured successfully!"); -// goto application -#ifdef USE_DISPLAY - WS_DEBUG_PRINTLN("Clearing loading screen..."); - WS._ui_helper->clear_scr_load(); - WS_DEBUG_PRINTLN("building activity screen..."); - WS._ui_helper->build_scr_activity(); -#endif + statusLEDFade(GREEN, 3); WS_DEBUG_PRINTLN( "Registration and configuration complete!\nRunning application..."); diff --git a/src/display/ws_display_ui_helper.cpp b/src/display/ws_display_ui_helper.cpp index 4a0d7e8b9..207096d68 100644 --- a/src/display/ws_display_ui_helper.cpp +++ b/src/display/ws_display_ui_helper.cpp @@ -280,10 +280,10 @@ void ws_display_ui_helper::show_scr_error(const char *lblError, /**************************************************************************/ /*! - @brief Build and display the activity screen + @brief Build and display the monitor screen */ /**************************************************************************/ -void ws_display_ui_helper::build_scr_activity() { +void ws_display_ui_helper::build_scr_monitor() { _dispDriver->esp32_lvgl_acquire(); // add canvas to create a status bar diff --git a/src/display/ws_display_ui_helper.h b/src/display/ws_display_ui_helper.h index fbcae470a..942a9511f 100644 --- a/src/display/ws_display_ui_helper.h +++ b/src/display/ws_display_ui_helper.h @@ -114,7 +114,7 @@ class ws_display_ui_helper { void set_bg_black(); void show_scr_load(); void clear_scr_load(); - void build_scr_activity(); + void build_scr_monitor(); void add_text_to_terminal(const char *text); void set_load_bar_icon_complete(loadBarIcons iconType); void set_label_status(const char *text); // callback ui help? From ac03aa80125a77595cb944cf627c8b51b95b0135 Mon Sep 17 00:00:00 2001 From: Brent Rubell Date: Tue, 13 Jun 2023 15:30:04 -0400 Subject: [PATCH 40/90] add ds18x20, servo --- src/Wippersnapper.cpp | 26 ++++++++++++++++--- .../analogIO/Wippersnapper_AnalogIO.cpp | 10 +++++-- src/components/ds18x20/ws_ds18x20.cpp | 25 +++++++++++++++++- 3 files changed, 55 insertions(+), 6 deletions(-) diff --git a/src/Wippersnapper.cpp b/src/Wippersnapper.cpp index cb40a25a1..e1cf06477 100644 --- a/src/Wippersnapper.cpp +++ b/src/Wippersnapper.cpp @@ -275,7 +275,7 @@ bool Wippersnapper::configAnalogInPinReq( pinMsg->analog_read_mode); char buffer[100]; - snprintf(buffer, 100, "[Pin] Reading %s every %f seconds\n.", + snprintf(buffer, 100, "[Pin] Reading %s every %0.2f seconds\n.", pinMsg->pin_name, pinMsg->period); WS._ui_helper->add_text_to_terminal(buffer); @@ -908,6 +908,8 @@ bool cbDecodeServoMsg(pb_istream_t *stream, const pb_field_t *field, &msgServoAttachReq)) { WS_DEBUG_PRINTLN( "ERROR: Could not decode wippersnapper_servo_v1_ServoAttachRequest"); + WS._ui_helper->add_text_to_terminal( + "[Servo ERROR] Could not decode servo request from IO!\n"); return false; // fail out if we can't decode the request } // execute servo attach request @@ -917,6 +919,9 @@ bool cbDecodeServoMsg(pb_istream_t *stream, const pb_field_t *field, atoi(servoPin), msgServoAttachReq.min_pulse_width, msgServoAttachReq.max_pulse_width, msgServoAttachReq.servo_freq)) { WS_DEBUG_PRINTLN("ERROR: Unable to attach servo to pin!"); + WS._ui_helper->add_text_to_terminal( + "[Servo ERROR] Unable to attach servo to pin! Is it already in " + "use?\n"); attached = false; } else { WS_DEBUG_PRINT("ATTACHED servo w/minPulseWidth: "); @@ -925,6 +930,11 @@ bool cbDecodeServoMsg(pb_istream_t *stream, const pb_field_t *field, WS_DEBUG_PRINT(msgServoAttachReq.min_pulse_width); WS_DEBUG_PRINT("uS on pin: "); WS_DEBUG_PRINTLN(servoPin); + + char buffer[100]; + snprintf(buffer, 100, "[Servo] Attached servo on pin %s\n.", + msgServoAttachReq.servo_pin); + WS._ui_helper->add_text_to_terminal(buffer); } // Create and fill a servo response message @@ -974,6 +984,11 @@ bool cbDecodeServoMsg(pb_istream_t *stream, const pb_field_t *field, WS_DEBUG_PRINT("uS to servo on pin#: "); WS_DEBUG_PRINTLN(servoPin); + char buffer[100]; + snprintf(buffer, 100, "[Servo] Writing pulse width of %u uS to pin %s\n.", + (int)msgServoWriteReq.pulse_width, msgServoWriteReq.servo_pin); + WS._ui_helper->add_text_to_terminal(buffer); + WS._servoComponent->servo_write(atoi(servoPin), (int)msgServoWriteReq.pulse_width); } else if (field->tag == @@ -992,8 +1007,14 @@ bool cbDecodeServoMsg(pb_istream_t *stream, const pb_field_t *field, // execute servo detach request char *servoPin = msgServoDetachReq.servo_pin + 1; - WS_DEBUG_PRINT("Detaching servo on pin "); + WS_DEBUG_PRINT("Detaching servo from pin "); WS_DEBUG_PRINTLN(servoPin); + + char buffer[100]; + snprintf(buffer, 100, "[Servo] Detaching from pin %s\n.", + msgServoDetachReq.servo_pin); + WS._ui_helper->add_text_to_terminal(buffer); + WS._servoComponent->servo_detach(atoi(servoPin)); } else { WS_DEBUG_PRINTLN("Unable to decode servo message type!"); @@ -2415,7 +2436,6 @@ void Wippersnapper::connect() { publishPinConfigComplete(); WS_DEBUG_PRINTLN("Hardware configured successfully!"); - statusLEDFade(GREEN, 3); WS_DEBUG_PRINTLN( "Registration and configuration complete!\nRunning application..."); diff --git a/src/components/analogIO/Wippersnapper_AnalogIO.cpp b/src/components/analogIO/Wippersnapper_AnalogIO.cpp index 33c89e380..2c8e73802 100644 --- a/src/components/analogIO/Wippersnapper_AnalogIO.cpp +++ b/src/components/analogIO/Wippersnapper_AnalogIO.cpp @@ -261,12 +261,18 @@ bool Wippersnapper_AnalogIO::encodePinEvent( sprintf(outgoingSignalMsg.payload.pin_event.pin_name, "A%d", pinName); // Fill pinValue based on the analog read mode + char buffer[100]; if (readMode == - wippersnapper_pin_v1_ConfigurePinRequest_AnalogReadMode_ANALOG_READ_MODE_PIN_VALUE) + wippersnapper_pin_v1_ConfigurePinRequest_AnalogReadMode_ANALOG_READ_MODE_PIN_VALUE) { sprintf(outgoingSignalMsg.payload.pin_event.pin_value, "%u", pinValRaw); - else + snprintf(buffer, 100, "[Pin] A%d read: %u\n.", pinName, pinValRaw); + } else { sprintf(outgoingSignalMsg.payload.pin_event.pin_value, "%0.3f", pinValVolts); + snprintf(buffer, 100, "[Pin] A%d read: %0.2f\n.", pinName, pinValVolts); + } + // display analog pin read on terminal + WS._ui_helper->add_text_to_terminal(buffer); // Encode signal message pb_ostream_t stream = diff --git a/src/components/ds18x20/ws_ds18x20.cpp b/src/components/ds18x20/ws_ds18x20.cpp index 0b16b7dbc..9e3069e0b 100644 --- a/src/components/ds18x20/ws_ds18x20.cpp +++ b/src/components/ds18x20/ws_ds18x20.cpp @@ -8,7 +8,7 @@ * please support Adafruit and open-source hardware by purchasing * products from Adafruit! * - * Copyright (c) Brent Rubell 2022 for Adafruit Industries. + * Copyright (c) Brent Rubell 2022-2023 for Adafruit Industries. * * BSD license, all text here must be included in any redistribution. * @@ -97,6 +97,11 @@ bool ws_ds18x20::addDS18x20( WS_DEBUG_PRINT(msgDs18x20InitReq->onewire_pin); WS_DEBUG_PRINTLN(" with DS18x20 attached!"); + char buffer[100]; + snprintf(buffer, 100, "[DS18x] Attached DS18x20 sensor to pin %s\n", + msgDs18x20InitReq->onewire_pin); + WS._ui_helper->add_text_to_terminal(buffer); + // Encode and publish response back to broker memset(WS._buffer_outgoing, 0, sizeof(WS._buffer_outgoing)); pb_ostream_t ostream = @@ -141,6 +146,11 @@ void ws_ds18x20::deleteDS18x20( idx); // erase vector and re-allocate } } + + char buffer[100]; + snprintf(buffer, 100, "[DS18x] Deleted DS18x20 sensor on pin %s\n", + msgDS18x20DeinitReq->onewire_pin); + WS._ui_helper->add_text_to_terminal(buffer); } /*************************************************************/ @@ -180,10 +190,14 @@ void ws_ds18x20::update() { if (tempC == DEVICE_DISCONNECTED_C) { WS_DEBUG_PRINTLN("ERROR: Could not read temperature data, is the " "sensor disconnected?"); + WS._ui_helper->add_text_to_terminal( + "[DS18x ERROR] Unable to read temperature, is the sensor " + "disconnected?\n"); break; } // check and pack based on sensorType + char buffer[100]; if ((*iter)->sensorProperties[i].sensor_type == wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_AMBIENT_TEMPERATURE) { @@ -192,6 +206,8 @@ void ws_ds18x20::update() { WS_DEBUG_PRINT(") DS18x20 Value: "); WS_DEBUG_PRINT(tempC); WS_DEBUG_PRINTLN("*C") + snprintf(buffer, 100, "[DS18x] Read %0.2f*C on GPIO %s\n", tempC, + (*iter)->onewire_pin); msgDS18x20Response.payload.resp_ds18x20_event.sensor_event[i].type = wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_AMBIENT_TEMPERATURE; @@ -214,6 +230,10 @@ void ws_ds18x20::update() { msgDS18x20Response.payload.resp_ds18x20_event.sensor_event[i] .value); WS_DEBUG_PRINTLN("*F") + snprintf(buffer, 100, "[DS18x] Read %0.2f*F on GPIO %s\n", + msgDS18x20Response.payload.resp_ds18x20_event.sensor_event[i] + .value, + (*iter)->onewire_pin); msgDS18x20Response.payload.resp_ds18x20_event.sensor_event_count++; } @@ -236,6 +256,8 @@ void ws_ds18x20::update() { &msgDS18x20Response)) { WS_DEBUG_PRINTLN( "ERROR: Unable to encode DS18x20 event responsemessage!"); + snprintf(buffer, 100, + "[DS18x ERROR] Unable to encode event message!"); return; } @@ -271,6 +293,7 @@ void ws_ds18x20::update() { return; }; WS_DEBUG_PRINTLN("PUBLISHED!"); + WS._ui_helper->add_text_to_terminal(buffer); (*iter)->sensorPeriodPrv = curTime; // set prv period } From 1025a35ed0f90e19deb420c2ef6116e32802b4c2 Mon Sep 17 00:00:00 2001 From: brentru Date: Tue, 13 Jun 2023 16:03:45 -0400 Subject: [PATCH 41/90] add pwm out --- src/Wippersnapper.cpp | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/src/Wippersnapper.cpp b/src/Wippersnapper.cpp index e1cf06477..69a174080 100644 --- a/src/Wippersnapper.cpp +++ b/src/Wippersnapper.cpp @@ -1077,6 +1077,8 @@ bool cbPWMDecodeMsg(pb_istream_t *stream, const pb_field_t *field, void **arg) { &msgPWMAttachRequest)) { WS_DEBUG_PRINTLN( "ERROR: Could not decode wippersnapper_pwm_v1_PWMAttachRequest"); + WS._ui_helper->add_text_to_terminal( + "[PWM ERROR]: Could not decode pin attach request!\n"); return false; // fail out if we can't decode the request } @@ -1087,6 +1089,9 @@ bool cbPWMDecodeMsg(pb_istream_t *stream, const pb_field_t *field, void **arg) { (uint8_t)msgPWMAttachRequest.resolution); if (!attached) { WS_DEBUG_PRINTLN("ERROR: Unable to attach PWM pin"); + WS._ui_helper->add_text_to_terminal( + "[PWM ERROR]: Failed to attach PWM to pin! Is this pin already in " + "use?\n"); attached = false; } @@ -1114,6 +1119,12 @@ bool cbPWMDecodeMsg(pb_istream_t *stream, const pb_field_t *field, void **arg) { WS._mqtt->publish(WS._topic_signal_pwm_device, WS._buffer_outgoing, msgSz, 1); WS_DEBUG_PRINTLN("Published!"); + + char buffer[100]; + snprintf(buffer, 100, "[PWM] Attached on pin %s\n.", + msgPWMResponse.payload.attach_response.pin); + WS._ui_helper->add_text_to_terminal(buffer); + } else if (field->tag == wippersnapper_signal_v1_PWMRequest_detach_request_tag) { WS_DEBUG_PRINTLN("GOT: PWM Pin Detach"); @@ -1124,11 +1135,19 @@ bool cbPWMDecodeMsg(pb_istream_t *stream, const pb_field_t *field, void **arg) { &msgPWMDetachRequest)) { WS_DEBUG_PRINTLN( "ERROR: Could not decode wippersnapper_pwm_v1_PWMDetachRequest"); + WS._ui_helper->add_text_to_terminal( + "[PWM ERROR] Failed to decode pin detach request from IO!\n"); return false; // fail out if we can't decode the request } // execute PWM pin detatch request char *pwmPin = msgPWMDetachRequest.pin + 1; WS._pwmComponent->detach(atoi(pwmPin)); + + char buffer[100]; + snprintf(buffer, 100, "[PWM] Detached on pin %s\n.", + msgPWMDetachRequest.pin); + WS._ui_helper->add_text_to_terminal(buffer); + } else if (field->tag == wippersnapper_signal_v1_PWMRequest_write_freq_request_tag) { WS_DEBUG_PRINTLN("GOT: PWM Write Tone"); @@ -1139,6 +1158,8 @@ bool cbPWMDecodeMsg(pb_istream_t *stream, const pb_field_t *field, void **arg) { &msgPWMWriteFreqRequest)) { WS_DEBUG_PRINTLN("ERROR: Could not decode " "wippersnapper_pwm_v1_PWMWriteFrequencyRequest"); + WS._ui_helper->add_text_to_terminal( + "[PWM ERROR] Failed to decode frequency write request from IO!\n"); return false; // fail out if we can't decode the request } @@ -1149,6 +1170,12 @@ bool cbPWMDecodeMsg(pb_istream_t *stream, const pb_field_t *field, void **arg) { WS_DEBUG_PRINT("Hz to pin "); WS_DEBUG_PRINTLN(atoi(pwmPin)); WS._pwmComponent->writeTone(atoi(pwmPin), msgPWMWriteFreqRequest.frequency); + + char buffer[100]; + snprintf(buffer, 100, "[PWM] Writing %u Hz to pin %s\n.", + msgPWMWriteFreqRequest.frequency, msgPWMWriteFreqRequest.pin); + WS._ui_helper->add_text_to_terminal(buffer); + } else if (field->tag == wippersnapper_signal_v1_PWMRequest_write_duty_request_tag) { WS_DEBUG_PRINTLN("GOT: PWM Write Duty Cycle"); @@ -1160,12 +1187,21 @@ bool cbPWMDecodeMsg(pb_istream_t *stream, const pb_field_t *field, void **arg) { &msgPWMWriteDutyCycleRequest)) { WS_DEBUG_PRINTLN("ERROR: Could not decode " "wippersnapper_pwm_v1_PWMWriteDutyCycleRequest"); + WS._ui_helper->add_text_to_terminal( + "[PWM ERROR] Failed to decode duty cycle write request from IO!\n"); return false; // fail out if we can't decode the request } // execute PWM duty cycle write request char *pwmPin = msgPWMWriteDutyCycleRequest.pin + 1; WS._pwmComponent->writeDutyCycle( atoi(pwmPin), (int)msgPWMWriteDutyCycleRequest.duty_cycle); + + char buffer[100]; + snprintf(buffer, 100, "[PWM] Writing duty cycle %d % to pin %s\n.", + (int)msgPWMWriteDutyCycleRequest.duty_cycle, + msgPWMWriteDutyCycleRequest.pin); + WS._ui_helper->add_text_to_terminal(buffer); + } else { WS_DEBUG_PRINTLN("Unable to decode PWM message type!"); return false; From abbb2468d8a72b41fd3c9402b1e6bdb5f3f690bc Mon Sep 17 00:00:00 2001 From: brentru Date: Wed, 14 Jun 2023 14:20:39 -0400 Subject: [PATCH 42/90] add displayDeviceEventMessage to integrate i2c messages --- src/components/i2c/WipperSnapper_I2C.cpp | 137 +++++++++++++++++++++++ src/components/i2c/WipperSnapper_I2C.h | 4 + 2 files changed, 141 insertions(+) diff --git a/src/components/i2c/WipperSnapper_I2C.cpp b/src/components/i2c/WipperSnapper_I2C.cpp index 573e12aeb..684c78625 100644 --- a/src/components/i2c/WipperSnapper_I2C.cpp +++ b/src/components/i2c/WipperSnapper_I2C.cpp @@ -573,6 +573,141 @@ void WipperSnapper_Component_I2C::fillEventMessage( msgi2cResponse->payload.resp_i2c_device_event.sensor_event_count++; } +void WipperSnapper_Component_I2C::displayDeviceEventMessage( + wippersnapper_signal_v1_I2CResponse *msgi2cResponse, + uint32_t sensorAddress) { + + pb_size_t numEvents = + msgi2cResponse->payload.resp_i2c_device_event.sensor_event_count; + WS_DEBUG_PRINT("total sensor events: "); + WS_DEBUG_PRINTLN(numEvents); + + char buffer[100]; + for (int i = 0; i < numEvents; i++) { + WS_DEBUG_PRINT("Sensor: "); + WS_DEBUG_PRINTLN(i); + + switch ( + msgi2cResponse->payload.resp_i2c_device_event.sensor_event[i].type) { + case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_AMBIENT_TEMPERATURE: + snprintf( + buffer, 100, "[I2C: %#12x] Sending Value to IO: %f *C\n.", + sensorAddress, + msgi2cResponse->payload.resp_i2c_device_event.sensor_event[i].value); + break; + case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_RELATIVE_HUMIDITY: + snprintf( + buffer, 100, "[I2C: %#12x] Sending Value to IO: %f %%rh\n.", + sensorAddress, + msgi2cResponse->payload.resp_i2c_device_event.sensor_event[i].value); + break; + case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_PRESSURE: + snprintf( + buffer, 100, "[I2C: %#12x] Sending Value to IO: %f hPA\n.", + sensorAddress, + msgi2cResponse->payload.resp_i2c_device_event.sensor_event[i].value); + break; + case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_CO2: + snprintf( + buffer, 100, "[I2C: %#12x] Sending Value to IO: %f ppm\n.", + sensorAddress, + msgi2cResponse->payload.resp_i2c_device_event.sensor_event[i].value); + break; + case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_ALTITUDE: + snprintf( + buffer, 100, "[I2C: %#12x] Sending Value to IO: %f m\n.", + sensorAddress, + msgi2cResponse->payload.resp_i2c_device_event.sensor_event[i].value); + break; + case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_OBJECT_TEMPERATURE: + snprintf( + buffer, 100, "[I2C: %#12x] Sending Value to IO: %f *C\n.", + sensorAddress, + msgi2cResponse->payload.resp_i2c_device_event.sensor_event[i].value); + break; + case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_LIGHT: + snprintf( + buffer, 100, "[I2C: %#12x] Sending Value to IO: %f lux\n.", + sensorAddress, + msgi2cResponse->payload.resp_i2c_device_event.sensor_event[i].value); + break; + case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_PM10_STD: + snprintf( + buffer, 100, "[I2C: %#12x] Sending Value to IO: %f ppm\n.", + sensorAddress, + msgi2cResponse->payload.resp_i2c_device_event.sensor_event[i].value); + break; + case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_PM25_STD: + snprintf( + buffer, 100, "[I2C: %#12x] Sending Value to IO: %f ppm\n.", + sensorAddress, + msgi2cResponse->payload.resp_i2c_device_event.sensor_event[i].value); + break; + case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_PM100_STD: + snprintf( + buffer, 100, "[I2C: %#12x] Sending Value to IO: %f ppm\n.", + sensorAddress, + msgi2cResponse->payload.resp_i2c_device_event.sensor_event[i].value); + break; + case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_UNITLESS_PERCENT: + snprintf( + buffer, 100, "[I2C: %#12x] Sending Value to IO: %f%%\n.", + sensorAddress, + msgi2cResponse->payload.resp_i2c_device_event.sensor_event[i].value); + break; + case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_VOLTAGE: + snprintf( + buffer, 100, "[I2C: %#12x] Sending Value to IO: %f V\n.", + sensorAddress, + msgi2cResponse->payload.resp_i2c_device_event.sensor_event[i].value); + break; + case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_PROXIMITY: + snprintf( + buffer, 100, "[I2C: %#12x] Sending Value to IO: %f\n.", sensorAddress, + msgi2cResponse->payload.resp_i2c_device_event.sensor_event[i].value); + break; + case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_RAW: + snprintf( + buffer, 100, "[I2C: %#12x] Sending Value to IO: %f\n.", sensorAddress, + msgi2cResponse->payload.resp_i2c_device_event.sensor_event[i].value); + break; + case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_AMBIENT_TEMPERATURE_FAHRENHEIT: + snprintf( + buffer, 100, "[I2C: %#12x] Sending Value to IO: %f * F\n.", + sensorAddress, + msgi2cResponse->payload.resp_i2c_device_event.sensor_event[i].value); + break; + case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_OBJECT_TEMPERATURE_FAHRENHEIT: + snprintf( + buffer, 100, "[I2C: %#12x] Sending Value to IO: %f * F\n.", + sensorAddress, + msgi2cResponse->payload.resp_i2c_device_event.sensor_event[i].value); + break; + case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_GAS_RESISTANCE: + snprintf( + buffer, 100, "[I2C: %#12x] Sending Value to IO: %f Ohms\n.", + sensorAddress, + msgi2cResponse->payload.resp_i2c_device_event.sensor_event[i].value); + break; + case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_NOX_INDEX: + snprintf( + buffer, 100, "[I2C: %#12x] Sending Value to IO: %f NOX\n.", + sensorAddress, + msgi2cResponse->payload.resp_i2c_device_event.sensor_event[i].value); + break; + case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_VOC_INDEX: + snprintf( + buffer, 100, "[I2C: %#12x] Sending Value to IO: %f VOC\n.", + sensorAddress, + msgi2cResponse->payload.resp_i2c_device_event.sensor_event[i].value); + break; + default: + break; + } + WS._ui_helper->add_text_to_terminal(buffer); + } +} + /*******************************************************************************/ /*! @brief Queries all I2C device drivers for new values. Fills and sends an @@ -1034,6 +1169,8 @@ void WipperSnapper_Component_I2C::update() { if (msgi2cResponse.payload.resp_i2c_device_event.sensor_event_count == 0) continue; + displayDeviceEventMessage(&msgi2cResponse, (*iter)->getI2CAddress()); + // Encode and publish I2CDeviceEvent message if (!encodePublishI2CDeviceEventMsg(&msgi2cResponse, (*iter)->getI2CAddress())) { diff --git a/src/components/i2c/WipperSnapper_I2C.h b/src/components/i2c/WipperSnapper_I2C.h index e295bde85..859fb1277 100644 --- a/src/components/i2c/WipperSnapper_I2C.h +++ b/src/components/i2c/WipperSnapper_I2C.h @@ -73,6 +73,10 @@ class WipperSnapper_Component_I2C { float value, wippersnapper_i2c_v1_SensorType sensorType); + void + displayDeviceEventMessage(wippersnapper_signal_v1_I2CResponse *msgi2cResponse, + uint32_t sensorAddress); + bool encodePublishI2CDeviceEventMsg( wippersnapper_signal_v1_I2CResponse *msgi2cResponse, uint32_t sensorAddress); From 8e0e08c9d8a967dbb9ab7563f5742771a7aedb59 Mon Sep 17 00:00:00 2001 From: brentru Date: Wed, 14 Jun 2023 14:28:30 -0400 Subject: [PATCH 43/90] refactor switch case --- src/components/i2c/WipperSnapper_I2C.cpp | 121 +++++++---------------- 1 file changed, 35 insertions(+), 86 deletions(-) diff --git a/src/components/i2c/WipperSnapper_I2C.cpp b/src/components/i2c/WipperSnapper_I2C.cpp index 684c78625..3edcf32e0 100644 --- a/src/components/i2c/WipperSnapper_I2C.cpp +++ b/src/components/i2c/WipperSnapper_I2C.cpp @@ -587,119 +587,68 @@ void WipperSnapper_Component_I2C::displayDeviceEventMessage( WS_DEBUG_PRINT("Sensor: "); WS_DEBUG_PRINTLN(i); + float value = + msgi2cResponse->payload.resp_i2c_device_event.sensor_event[i].value; + switch ( msgi2cResponse->payload.resp_i2c_device_event.sensor_event[i].type) { case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_AMBIENT_TEMPERATURE: - snprintf( - buffer, 100, "[I2C: %#12x] Sending Value to IO: %f *C\n.", - sensorAddress, - msgi2cResponse->payload.resp_i2c_device_event.sensor_event[i].value); + case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_OBJECT_TEMPERATURE: + snprintf(buffer, 100, "[I2C: %#12x] Sending Value to IO: %f *C\n.", + sensorAddress, value); + break; + case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_AMBIENT_TEMPERATURE_FAHRENHEIT: + case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_OBJECT_TEMPERATURE_FAHRENHEIT: + snprintf(buffer, 100, "[I2C: %#12x] Sending Value to IO: %f *F\n.", + sensorAddress, value); break; case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_RELATIVE_HUMIDITY: - snprintf( - buffer, 100, "[I2C: %#12x] Sending Value to IO: %f %%rh\n.", - sensorAddress, - msgi2cResponse->payload.resp_i2c_device_event.sensor_event[i].value); + snprintf(buffer, 100, "[I2C: %#12x] Sending Value to IO: %f %%rh\n.", + sensorAddress, value); break; case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_PRESSURE: - snprintf( - buffer, 100, "[I2C: %#12x] Sending Value to IO: %f hPA\n.", - sensorAddress, - msgi2cResponse->payload.resp_i2c_device_event.sensor_event[i].value); - break; - case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_CO2: - snprintf( - buffer, 100, "[I2C: %#12x] Sending Value to IO: %f ppm\n.", - sensorAddress, - msgi2cResponse->payload.resp_i2c_device_event.sensor_event[i].value); + snprintf(buffer, 100, "[I2C: %#12x] Sending Value to IO: %f hPA\n.", + sensorAddress, value); break; case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_ALTITUDE: - snprintf( - buffer, 100, "[I2C: %#12x] Sending Value to IO: %f m\n.", - sensorAddress, - msgi2cResponse->payload.resp_i2c_device_event.sensor_event[i].value); - break; - case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_OBJECT_TEMPERATURE: - snprintf( - buffer, 100, "[I2C: %#12x] Sending Value to IO: %f *C\n.", - sensorAddress, - msgi2cResponse->payload.resp_i2c_device_event.sensor_event[i].value); + snprintf(buffer, 100, "[I2C: %#12x] Sending Value to IO: %f m\n.", + sensorAddress, value); break; case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_LIGHT: - snprintf( - buffer, 100, "[I2C: %#12x] Sending Value to IO: %f lux\n.", - sensorAddress, - msgi2cResponse->payload.resp_i2c_device_event.sensor_event[i].value); + snprintf(buffer, 100, "[I2C: %#12x] Sending Value to IO: %f lux\n.", + sensorAddress, value); break; case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_PM10_STD: - snprintf( - buffer, 100, "[I2C: %#12x] Sending Value to IO: %f ppm\n.", - sensorAddress, - msgi2cResponse->payload.resp_i2c_device_event.sensor_event[i].value); - break; case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_PM25_STD: - snprintf( - buffer, 100, "[I2C: %#12x] Sending Value to IO: %f ppm\n.", - sensorAddress, - msgi2cResponse->payload.resp_i2c_device_event.sensor_event[i].value); - break; case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_PM100_STD: - snprintf( - buffer, 100, "[I2C: %#12x] Sending Value to IO: %f ppm\n.", - sensorAddress, - msgi2cResponse->payload.resp_i2c_device_event.sensor_event[i].value); + case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_CO2: + snprintf(buffer, 100, "[I2C: %#12x] Sending Value to IO: %f ppm\n.", + sensorAddress, value); break; case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_UNITLESS_PERCENT: - snprintf( - buffer, 100, "[I2C: %#12x] Sending Value to IO: %f%%\n.", - sensorAddress, - msgi2cResponse->payload.resp_i2c_device_event.sensor_event[i].value); + snprintf(buffer, 100, "[I2C: %#12x] Sending Value to IO: %f%%\n.", + sensorAddress, value); break; case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_VOLTAGE: - snprintf( - buffer, 100, "[I2C: %#12x] Sending Value to IO: %f V\n.", - sensorAddress, - msgi2cResponse->payload.resp_i2c_device_event.sensor_event[i].value); - break; - case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_PROXIMITY: - snprintf( - buffer, 100, "[I2C: %#12x] Sending Value to IO: %f\n.", sensorAddress, - msgi2cResponse->payload.resp_i2c_device_event.sensor_event[i].value); + snprintf(buffer, 100, "[I2C: %#12x] Sending Value to IO: %f V\n.", + sensorAddress, value); break; case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_RAW: - snprintf( - buffer, 100, "[I2C: %#12x] Sending Value to IO: %f\n.", sensorAddress, - msgi2cResponse->payload.resp_i2c_device_event.sensor_event[i].value); - break; - case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_AMBIENT_TEMPERATURE_FAHRENHEIT: - snprintf( - buffer, 100, "[I2C: %#12x] Sending Value to IO: %f * F\n.", - sensorAddress, - msgi2cResponse->payload.resp_i2c_device_event.sensor_event[i].value); - break; - case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_OBJECT_TEMPERATURE_FAHRENHEIT: - snprintf( - buffer, 100, "[I2C: %#12x] Sending Value to IO: %f * F\n.", - sensorAddress, - msgi2cResponse->payload.resp_i2c_device_event.sensor_event[i].value); + case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_PROXIMITY: + snprintf(buffer, 100, "[I2C: %#12x] Sending Value to IO: %f\n.", + sensorAddress, value); break; case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_GAS_RESISTANCE: - snprintf( - buffer, 100, "[I2C: %#12x] Sending Value to IO: %f Ohms\n.", - sensorAddress, - msgi2cResponse->payload.resp_i2c_device_event.sensor_event[i].value); + snprintf(buffer, 100, "[I2C: %#12x] Sending Value to IO: %f Ohms\n.", + sensorAddress, value); break; case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_NOX_INDEX: - snprintf( - buffer, 100, "[I2C: %#12x] Sending Value to IO: %f NOX\n.", - sensorAddress, - msgi2cResponse->payload.resp_i2c_device_event.sensor_event[i].value); + snprintf(buffer, 100, "[I2C: %#12x] Sending Value to IO: %f NOX\n.", + sensorAddress, value); break; case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_VOC_INDEX: - snprintf( - buffer, 100, "[I2C: %#12x] Sending Value to IO: %f VOC\n.", - sensorAddress, - msgi2cResponse->payload.resp_i2c_device_event.sensor_event[i].value); + snprintf(buffer, 100, "[I2C: %#12x] Sending Value to IO: %f VOC\n.", + sensorAddress, value); break; default: break; From 0fe6533a7acac5dc73d7cf87aec54f7ede187ab7 Mon Sep 17 00:00:00 2001 From: brentru Date: Thu, 15 Jun 2023 17:22:40 -0400 Subject: [PATCH 44/90] demo from S&T --- src/Wippersnapper.cpp | 10 ++-- .../analogIO/Wippersnapper_AnalogIO.cpp | 4 +- src/components/i2c/WipperSnapper_I2C.cpp | 48 +++++++++---------- src/display/ws_display_ui_helper.cpp | 7 ++- src/display/ws_display_ui_helper.h | 4 +- src/network_interfaces/Wippersnapper_ESP32.h | 3 ++ 6 files changed, 38 insertions(+), 38 deletions(-) diff --git a/src/Wippersnapper.cpp b/src/Wippersnapper.cpp index 69a174080..f52330f64 100644 --- a/src/Wippersnapper.cpp +++ b/src/Wippersnapper.cpp @@ -91,7 +91,7 @@ Wippersnapper::~Wippersnapper() { */ /**************************************************************************/ void Wippersnapper::provision() { - // Filesystem should get the MAC address + // Obtain device's MAC address getMacAddr(); // Initialize the status LED for signaling FS errors @@ -178,6 +178,7 @@ void Wippersnapper::getMacAddr() { WS_DEBUG_PRINTLN("ERROR: Please define a network interface!"); } + /****************************************************************************/ /*! @brief Sets up the MQTT client session. @@ -275,7 +276,7 @@ bool Wippersnapper::configAnalogInPinReq( pinMsg->analog_read_mode); char buffer[100]; - snprintf(buffer, 100, "[Pin] Reading %s every %0.2f seconds\n.", + snprintf(buffer, 100, "[Pin] Reading %s every %0.2f seconds\n", pinMsg->pin_name, pinMsg->period); WS._ui_helper->add_text_to_terminal(buffer); @@ -2231,13 +2232,13 @@ void Wippersnapper::pingBroker() { (WS_KEEPALIVE_INTERVAL_MS * 0.10)))) { WS_DEBUG_PRINTLN("PING!"); // TODO: Add back, is crashing currently - WS._ui_helper->add_text_to_terminal("[NET] Pinging IO...OK!\n"); WS._mqtt->ping(); _prv_ping = millis(); } // blink status LED every STATUS_LED_KAT_BLINK_TIME millis if (millis() > (_prvKATBlink + STATUS_LED_KAT_BLINK_TIME)) { WS_DEBUG_PRINTLN("STATUS LED BLINK KAT"); + WS._ui_helper->add_text_to_terminal("[NET] Sent KeepAlive ping!\n"); statusLEDBlink(WS_LED_STATUS_KAT); _prvKATBlink = millis(); } @@ -2438,9 +2439,10 @@ void Wippersnapper::connect() { runNetFSM(); WS.feedWDT(); + #ifdef USE_DISPLAY WS._ui_helper->set_load_bar_icon_complete(loadBarIconCloud); - WS._ui_helper->set_label_status("Registering device with IO..."); + WS._ui_helper->set_label_status("Sending device info..."); #endif // Register hardware with Wippersnapper diff --git a/src/components/analogIO/Wippersnapper_AnalogIO.cpp b/src/components/analogIO/Wippersnapper_AnalogIO.cpp index 2c8e73802..7d046fe52 100644 --- a/src/components/analogIO/Wippersnapper_AnalogIO.cpp +++ b/src/components/analogIO/Wippersnapper_AnalogIO.cpp @@ -265,11 +265,11 @@ bool Wippersnapper_AnalogIO::encodePinEvent( if (readMode == wippersnapper_pin_v1_ConfigurePinRequest_AnalogReadMode_ANALOG_READ_MODE_PIN_VALUE) { sprintf(outgoingSignalMsg.payload.pin_event.pin_value, "%u", pinValRaw); - snprintf(buffer, 100, "[Pin] A%d read: %u\n.", pinName, pinValRaw); + snprintf(buffer, 100, "[Pin] A%d read: %u\n", pinName, pinValRaw); } else { sprintf(outgoingSignalMsg.payload.pin_event.pin_value, "%0.3f", pinValVolts); - snprintf(buffer, 100, "[Pin] A%d read: %0.2f\n.", pinName, pinValVolts); + snprintf(buffer, 100, "[Pin] A%d read: %0.2f\n", pinName, pinValVolts); } // display analog pin read on terminal WS._ui_helper->add_text_to_terminal(buffer); diff --git a/src/components/i2c/WipperSnapper_I2C.cpp b/src/components/i2c/WipperSnapper_I2C.cpp index 3edcf32e0..105f2b32f 100644 --- a/src/components/i2c/WipperSnapper_I2C.cpp +++ b/src/components/i2c/WipperSnapper_I2C.cpp @@ -594,61 +594,57 @@ void WipperSnapper_Component_I2C::displayDeviceEventMessage( msgi2cResponse->payload.resp_i2c_device_event.sensor_event[i].type) { case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_AMBIENT_TEMPERATURE: case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_OBJECT_TEMPERATURE: - snprintf(buffer, 100, "[I2C: %#12x] Sending Value to IO: %f *C\n.", - sensorAddress, value); + snprintf(buffer, 100, "[I2C: %#x] Read: %0.3f *C\n", sensorAddress, + value); break; case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_AMBIENT_TEMPERATURE_FAHRENHEIT: case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_OBJECT_TEMPERATURE_FAHRENHEIT: - snprintf(buffer, 100, "[I2C: %#12x] Sending Value to IO: %f *F\n.", - sensorAddress, value); + snprintf(buffer, 100, "[I2C: %#x] Read: %0.3f *F\n", sensorAddress, + value); break; case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_RELATIVE_HUMIDITY: - snprintf(buffer, 100, "[I2C: %#12x] Sending Value to IO: %f %%rh\n.", - sensorAddress, value); + snprintf(buffer, 100, "[I2C: %#x] Read: %0.3f %% rh\n", sensorAddress, + value); break; case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_PRESSURE: - snprintf(buffer, 100, "[I2C: %#12x] Sending Value to IO: %f hPA\n.", - sensorAddress, value); + snprintf(buffer, 100, "[I2C: %#x] Read: %0.3f hPA\n", sensorAddress, + value); break; case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_ALTITUDE: - snprintf(buffer, 100, "[I2C: %#12x] Sending Value to IO: %f m\n.", - sensorAddress, value); + snprintf(buffer, 100, "[I2C: %x] Read: %0.3f m\n", sensorAddress, value); break; case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_LIGHT: - snprintf(buffer, 100, "[I2C: %#12x] Sending Value to IO: %f lux\n.", - sensorAddress, value); + snprintf(buffer, 100, "[I2C: %x] Read: %0.3f lux\n", sensorAddress, + value); break; case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_PM10_STD: case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_PM25_STD: case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_PM100_STD: case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_CO2: - snprintf(buffer, 100, "[I2C: %#12x] Sending Value to IO: %f ppm\n.", - sensorAddress, value); + snprintf(buffer, 100, "[I2C: %x] Read: %0.3f ppm\n", sensorAddress, + value); break; case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_UNITLESS_PERCENT: - snprintf(buffer, 100, "[I2C: %#12x] Sending Value to IO: %f%%\n.", - sensorAddress, value); + snprintf(buffer, 100, "[I2C: %x] Read: %0.3f%%\n", sensorAddress, value); break; case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_VOLTAGE: - snprintf(buffer, 100, "[I2C: %#12x] Sending Value to IO: %f V\n.", - sensorAddress, value); + snprintf(buffer, 100, "[I2C: %x] Read: %0.3f V\n", sensorAddress, value); break; case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_RAW: case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_PROXIMITY: - snprintf(buffer, 100, "[I2C: %#12x] Sending Value to IO: %f\n.", - sensorAddress, value); + snprintf(buffer, 100, "[I2C: %x] Read: %0.3f\n", sensorAddress, value); break; case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_GAS_RESISTANCE: - snprintf(buffer, 100, "[I2C: %#12x] Sending Value to IO: %f Ohms\n.", - sensorAddress, value); + snprintf(buffer, 100, "[I2C: %x] Read: %0.3f Ohms\n", sensorAddress, + value); break; case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_NOX_INDEX: - snprintf(buffer, 100, "[I2C: %#12x] Sending Value to IO: %f NOX\n.", - sensorAddress, value); + snprintf(buffer, 100, "[I2C: %x] Read: %0.3f NOX\n", sensorAddress, + value); break; case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_VOC_INDEX: - snprintf(buffer, 100, "[I2C: %#12x] Sending Value to IO: %f VOC\n.", - sensorAddress, value); + snprintf(buffer, 100, "[I2C: %x] Read: %0.3f VOC\n", sensorAddress, + value); break; default: break; diff --git a/src/display/ws_display_ui_helper.cpp b/src/display/ws_display_ui_helper.cpp index 207096d68..9ecf4c94c 100644 --- a/src/display/ws_display_ui_helper.cpp +++ b/src/display/ws_display_ui_helper.cpp @@ -15,6 +15,7 @@ #include "ws_display_ui_helper.h" + /**************************************************************************/ /*! @brief Changes a label every 2 seconds to a new, random, tip. @@ -25,13 +26,11 @@ void lv_timer_tips_cb(lv_timer_t *timer) { Serial.println("Timer tips cb called"); long tipNum = random(0, sizeof(loading_tips) / sizeof(loading_tips[0])); - // TODO: Why is acquire and release commented out here? - // _dispDriver->esp32_lvgl_acquire(); lv_label_set_text(lblTipText, loading_tips[tipNum]); - // TODO: Why is acquire and release commented out here? - // _dispDriver->esp32_lvgl_release(); } + + /**************************************************************************/ /*! @brief Callback for updating the status label on the loading screen. diff --git a/src/display/ws_display_ui_helper.h b/src/display/ws_display_ui_helper.h index 942a9511f..c8116a901 100644 --- a/src/display/ws_display_ui_helper.h +++ b/src/display/ws_display_ui_helper.h @@ -58,12 +58,11 @@ static lv_style_t styleErrorTriangle; static lv_style_t styleLabelErrorLarge; static lv_style_t styleLabelErrorSmall; -/* Activity screen */ +/* Monitor screen */ static lv_obj_t *canvasStatusBar; static lv_draw_rect_dsc_t *rect_dsc; static lv_obj_t *statusbar_icon_bat; static lv_obj_t *statusbar_icon_wifi; -//static lv_obj_t *labelTurtleBar; static lv_obj_t *terminalLabel; static lv_style_t styleTerminalLabel; @@ -125,5 +124,6 @@ class ws_display_ui_helper { private: ws_display_driver *_dispDriver = nullptr; void addToTerminal(const char *txt_in); + }; #endif // WS_DISPLAY_UI_HELPER_H diff --git a/src/network_interfaces/Wippersnapper_ESP32.h b/src/network_interfaces/Wippersnapper_ESP32.h index 790a6418f..53325aed7 100644 --- a/src/network_interfaces/Wippersnapper_ESP32.h +++ b/src/network_interfaces/Wippersnapper_ESP32.h @@ -172,6 +172,9 @@ class Wippersnapper_ESP32 : public Wippersnapper { } } + + + /*******************************************************************/ /*! @brief Returns the type of network connection used by Wippersnapper From e0d00f8a881602069f0d4bd6db863a65862c2905 Mon Sep 17 00:00:00 2001 From: brentru Date: Thu, 15 Jun 2023 17:29:22 -0400 Subject: [PATCH 45/90] use turtle_16px instead of 20px to match other icons --- .../symbols/{turtle_20.c => turtle_16.c} | 64 ++++++++----------- src/display/ws_display_ui_helper.cpp | 22 +++---- src/display/ws_display_ui_helper.h | 4 +- 3 files changed, 39 insertions(+), 51 deletions(-) rename src/display/symbols/{turtle_20.c => turtle_16.c} (57%) diff --git a/src/display/symbols/turtle_20.c b/src/display/symbols/turtle_16.c similarity index 57% rename from src/display/symbols/turtle_20.c rename to src/display/symbols/turtle_16.c index 98e75b451..3565874cb 100644 --- a/src/display/symbols/turtle_20.c +++ b/src/display/symbols/turtle_16.c @@ -1,5 +1,5 @@ /******************************************************************************* - * Size: 20 px + * Size: 16 px * Bpp: 4 * Opts: ******************************************************************************/ @@ -10,11 +10,11 @@ #include #endif -#ifndef TURTLE_20 -#define TURTLE_20 1 +#ifndef TURTLE_16 +#define TURTLE_16 1 #endif -#if TURTLE_20 +#if TURTLE_16 /*----------------- * BITMAPS @@ -23,34 +23,22 @@ /*Store the image of the glyphs*/ static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = { /* U+F726 "" */ - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x7d, 0xff, - 0xe9, 0x10, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x3, 0xdf, 0xff, 0xff, 0xfe, 0x50, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x2, 0xff, 0xff, 0xff, 0xff, - 0xff, 0x50, 0x0, 0x0, 0x0, 0x0, 0x0, 0xcf, - 0xff, 0xff, 0xff, 0xff, 0xfe, 0x10, 0x19, 0xdc, - 0x60, 0x0, 0x5f, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xf8, 0xa, 0xff, 0xff, 0x90, 0x9, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xd0, 0xef, 0xff, 0xff, - 0x30, 0xbf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xe, 0xfc, 0x5f, 0xf6, 0xc, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xf0, 0xef, 0xeb, 0xff, 0x70, - 0xbf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf, - 0xff, 0xff, 0xf3, 0x3, 0xdf, 0xff, 0xff, 0xff, - 0xff, 0xfe, 0x64, 0xff, 0xff, 0xd5, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x5, 0xef, 0xf1, - 0x0, 0x0, 0x9f, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xf7, 0x0, 0x0, 0xd, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xf7, 0x0, 0x0, - 0x0, 0x27, 0xcf, 0xff, 0xfc, 0xaf, 0xff, 0xfd, - 0x51, 0x0, 0x0, 0x0, 0x0, 0x8, 0xff, 0xff, - 0x84, 0xff, 0xff, 0xc0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x7f, 0xff, 0xf7, 0x3f, 0xff, 0xfb, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x2, 0xff, 0xff, 0x20, - 0xdf, 0xff, 0x60, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x1, 0x33, 0x10, 0x0, 0x34, 0x10, 0x0, 0x0, - 0x0, 0x0, 0x0 + 0x0, 0x1, 0x9c, 0xfc, 0x91, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x4e, 0xff, 0xff, 0xfe, 0x30, 0x0, + 0x0, 0x0, 0x1, 0xef, 0xff, 0xff, 0xff, 0xe1, + 0x8, 0x86, 0x10, 0x9, 0xff, 0xff, 0xff, 0xff, + 0xf9, 0xf, 0xff, 0xe3, 0xc, 0xff, 0xff, 0xff, + 0xff, 0xfc, 0xf, 0xff, 0xfc, 0xf, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xf, 0xf8, 0xff, 0xf, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xf, 0xff, 0xff, 0xf, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xf, 0xff, 0xff, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xf, 0xf0, + 0x0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xf0, 0x0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xf0, 0x0, 0x0, 0xff, 0xff, 0xf, 0xff, + 0xf0, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff, 0xf, + 0xff, 0xf0, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff, + 0xf, 0xff, 0xf0, 0x0, 0x0, 0x0 }; @@ -60,7 +48,7 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = { static const lv_font_fmt_txt_glyph_dsc_t glyph_dsc[] = { {.bitmap_index = 0, .adv_w = 0, .box_w = 0, .box_h = 0, .ofs_x = 0, .ofs_y = 0} /* id = 0 reserved */, - {.bitmap_index = 0, .adv_w = 360, .box_w = 23, .box_h = 19, .ofs_x = 0, .ofs_y = -2} + {.bitmap_index = 0, .adv_w = 288, .box_w = 18, .box_h = 14, .ofs_x = 0, .ofs_y = -1} }; /*--------------------- @@ -112,14 +100,14 @@ static lv_font_fmt_txt_dsc_t font_dsc = { /*Initialize a public general font descriptor*/ #if LV_VERSION_CHECK(8, 0, 0) -const lv_font_t turtle_20 = { +const lv_font_t turtle_16 = { #else -lv_font_t turtle_20 = { +lv_font_t turtle_16 = { #endif .get_glyph_dsc = lv_font_get_glyph_dsc_fmt_txt, /*Function pointer to get glyph's data*/ .get_glyph_bitmap = lv_font_get_bitmap_fmt_txt, /*Function pointer to get glyph's bitmap*/ - .line_height = 19, /*The maximum line height required by the font*/ - .base_line = 2, /*Baseline measured from the bottom of the line*/ + .line_height = 14, /*The maximum line height required by the font*/ + .base_line = 1, /*Baseline measured from the bottom of the line*/ #if !(LVGL_VERSION_MAJOR == 6 && LVGL_VERSION_MINOR == 0) .subpx = LV_FONT_SUBPX_NONE, #endif @@ -132,5 +120,5 @@ lv_font_t turtle_20 = { -#endif /*#if TURTLE_20*/ +#endif /*#if TURTLE_16*/ diff --git a/src/display/ws_display_ui_helper.cpp b/src/display/ws_display_ui_helper.cpp index 9ecf4c94c..a1abd9e7b 100644 --- a/src/display/ws_display_ui_helper.cpp +++ b/src/display/ws_display_ui_helper.cpp @@ -107,7 +107,7 @@ void ws_display_ui_helper::set_load_bar_icon_complete(loadBarIcons iconType) { objIcon = labelCloudBar; break; case loadBarIconTurtle: - styleIcon = &styleIconTurtle30px; + styleIcon = &styleIconTurtleStatusbar; objIcon = labelTurtleBar; break; default: @@ -168,11 +168,11 @@ void ws_display_ui_helper::show_scr_load() { labelTurtleBar = lv_label_create(lv_scr_act()); lv_label_set_text(labelTurtleBar, SYMBOL_TURTLE30PX); - lv_style_init(&styleIconTurtle30px); - lv_style_set_text_color(&styleIconTurtle30px, + lv_style_init(&styleIconTurtleStatusbar); + lv_style_set_text_color(&styleIconTurtleStatusbar, lv_palette_main(LV_PALETTE_GREY)); - lv_style_set_text_font(&styleIconTurtle30px, &turtle_30px); - lv_obj_add_style(labelTurtleBar, &styleIconTurtle30px, LV_PART_MAIN); + lv_style_set_text_font(&styleIconTurtleStatusbar, &turtle_30px); + lv_obj_add_style(labelTurtleBar, &styleIconTurtleStatusbar, LV_PART_MAIN); lv_obj_align(labelTurtleBar, LV_ALIGN_TOP_LEFT, 180, iconBarYOffset); // Add status text label underneath the top loading bar @@ -216,7 +216,7 @@ void ws_display_ui_helper::clear_scr_load() { lv_style_reset(&styleIconWiFi); lv_style_reset(&styleIconFile); lv_style_reset(&styleIconCloud); - lv_style_reset(&styleIconTurtle30px); + lv_style_reset(&styleIconTurtleStatusbar); // Stop the loading tip timer and delete the label remove_tip_timer(); lv_obj_del(lblTipText); @@ -312,12 +312,12 @@ void ws_display_ui_helper::build_scr_monitor() { // Add Turtle icon to status bar lv_obj_t *labelTurtleBar = lv_label_create(lv_scr_act()); lv_label_set_text(labelTurtleBar, SYMBOL_TURTLE30PX); - static lv_style_t styleIconTurtle30px; - lv_style_init(&styleIconTurtle30px); - lv_style_set_text_color(&styleIconTurtle30px, + static lv_style_t styleIconTurtleStatusbar; + lv_style_init(&styleIconTurtleStatusbar); + lv_style_set_text_color(&styleIconTurtleStatusbar, lv_palette_main(LV_PALETTE_GREEN)); - lv_style_set_text_font(&styleIconTurtle30px, &turtle_20); - lv_obj_add_style(labelTurtleBar, &styleIconTurtle30px, + lv_style_set_text_font(&styleIconTurtleStatusbar, &turtle_16); + lv_obj_add_style(labelTurtleBar, &styleIconTurtleStatusbar, LV_PART_MAIN); lv_obj_align(labelTurtleBar, LV_ALIGN_TOP_LEFT, 5, 5); diff --git a/src/display/ws_display_ui_helper.h b/src/display/ws_display_ui_helper.h index c8116a901..3f1218d53 100644 --- a/src/display/ws_display_ui_helper.h +++ b/src/display/ws_display_ui_helper.h @@ -46,7 +46,7 @@ static lv_obj_t *lblStatusText; static lv_obj_t *lblTipText; static lv_style_t styleIconFile; static lv_style_t styleIconWiFi; -static lv_style_t styleIconTurtle30px; +static lv_style_t styleIconTurtleStatusbar; static lv_style_t styleIconCloud; static lv_style_t styleIconCheckmark; @@ -74,7 +74,7 @@ LV_FONT_DECLARE(file); LV_FONT_DECLARE(wifi_30px); LV_FONT_DECLARE(cloud_30px); LV_FONT_DECLARE(turtle_30px); -LV_FONT_DECLARE(turtle_20); +LV_FONT_DECLARE(turtle_16); LV_FONT_DECLARE(circle_30px); /********************** From 6f237796fded73bf3de7dc4cfe8db39c4072b8da Mon Sep 17 00:00:00 2001 From: brentru Date: Tue, 20 Jun 2023 13:52:27 -0400 Subject: [PATCH 46/90] rm unused retryMQTTConnection() call! --- src/Wippersnapper.cpp | 75 ------------------------------------------- 1 file changed, 75 deletions(-) diff --git a/src/Wippersnapper.cpp b/src/Wippersnapper.cpp index f52330f64..d295c2a6f 100644 --- a/src/Wippersnapper.cpp +++ b/src/Wippersnapper.cpp @@ -178,7 +178,6 @@ void Wippersnapper::getMacAddr() { WS_DEBUG_PRINTLN("ERROR: Please define a network interface!"); } - /****************************************************************************/ /*! @brief Sets up the MQTT client session. @@ -1485,79 +1484,6 @@ void cbRegistrationStatus(char *data, uint16_t len) { WS.decodeRegistrationResp(data, len); } -/**************************************************************************/ -/*! - @brief Attempts to re-connect to the MQTT broker, retries with - an exponential backoff + jitter interval. -*/ -/**************************************************************************/ -void retryMQTTConnection() { - // MQTT broker's connack return code - int8_t rc; - // amount of times we've attempted to re-connect to IO's MQTT broker - int retries = 0; - // maximum backoff time, in millis - double maxBackoff = 60000; - // current backoff time, in millis - double backoff; - // randomized jitter to prevent multi-client collisions - long jitter; - - bool notConnected = true; - while (notConnected == true) { - WS_DEBUG_PRINTLN("Retrying connection..."); - // attempt reconnection, save return code (rc) - rc = WS._mqtt->connect(WS._username, WS._key); - switch (rc) { - case WS_MQTT_CONNECTED: - WS_DEBUG_PRINTLN("Re-connected to IO MQTT!"); - notConnected = false; - break; - case WS_MQTT_INVALID_PROTOCOL: - WS_DEBUG_PRINTLN("Invalid MQTT protocol"); - break; - case WS_MQTT_INVALID_CID: - WS_DEBUG_PRINTLN("client ID rejected"); - break; - case WS_MQTT_SERVICE_UNAVALIABLE: - WS_DEBUG_PRINTLN("MQTT service unavailable"); - break; - case WS_MQTT_INVALID_USER_PASS: - WS_DEBUG_PRINTLN("malformed user/pass"); - break; - case WS_MQTT_UNAUTHORIZED: - WS_DEBUG_PRINTLN("unauthorized"); - break; - case WS_MQTT_THROTTLED: - WS_DEBUG_PRINTLN("ERROR: Throttled"); - break; - case WS_MQTT_BANNED: - WS_DEBUG_PRINTLN("ERROR: Temporarily banned"); - break; - default: - break; - } - retries++; - if (notConnected) { - WS_DEBUG_PRINTLN("Not connected, delaying..."); - // calculate a jitter value btween 0ms and 100ms - jitter = random(0, 100); - // calculate exponential backoff w/jitter - backoff = (pow(2, retries) * 1000) + jitter; - backoff = min(backoff, maxBackoff); - WS_DEBUG_PRINT("Delaying for "); - WS_DEBUG_PRINT(backoff); - WS_DEBUG_PRINTLN("ms..."); - // delay for backoff millis - delay(backoff); - } else { - WS_DEBUG_PRINTLN("Connected to MQTT broker!") - // reset backoff param and retries - backoff = 0; - } - } -} - /**************************************************************************/ /*! @brief Called when client receives a message published across the @@ -2439,7 +2365,6 @@ void Wippersnapper::connect() { runNetFSM(); WS.feedWDT(); - #ifdef USE_DISPLAY WS._ui_helper->set_load_bar_icon_complete(loadBarIconCloud); WS._ui_helper->set_label_status("Sending device info..."); From 6e7f190c9e2dbc58a08355905c93bf5c5f194001 Mon Sep 17 00:00:00 2001 From: brentru Date: Tue, 20 Jun 2023 14:06:33 -0400 Subject: [PATCH 47/90] add pipes for throttle and ban errors from IO --- src/Wippersnapper.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/Wippersnapper.cpp b/src/Wippersnapper.cpp index d295c2a6f..d2cbb3425 100644 --- a/src/Wippersnapper.cpp +++ b/src/Wippersnapper.cpp @@ -1502,6 +1502,11 @@ void cbErrorTopic(char *errorData, uint16_t len) { if (!WS._mqtt->disconnect()) { WS_DEBUG_PRINTLN("ERROR: Unable to disconnect from MQTT broker!"); } + +#ifdef USE_DISPLAY + WS._ui_helper->show_scr_error("IO Ban Error", errorData); +#endif + // WDT reset for (;;) { delay(100); @@ -1532,6 +1537,18 @@ void cbThrottleTopic(char *throttleData, uint16_t len) { WS_DEBUG_PRINT("Device is throttled for "); WS_DEBUG_PRINT(throttleDuration); WS_DEBUG_PRINTLN("ms and blocking command execution."); + +#ifdef USE_DISPLAY + char buffer[100]; + snprintf( + buffer, 100, + "[IO ERROR] Device is throttled for %d mS and blocking execution..\n.", + throttleDuration); + WS._ui_helper->add_text_to_terminal(buffer); +#endif + + // If throttle duration is less than the keepalive interval, delay for the + // full keepalive interval if (throttleDuration < WS_KEEPALIVE_INTERVAL_MS) { delay(WS_KEEPALIVE_INTERVAL_MS); } else { @@ -1546,6 +1563,10 @@ void cbThrottleTopic(char *throttleData, uint16_t len) { } } WS_DEBUG_PRINTLN("Device is un-throttled, resumed command execution"); +#ifdef USE_DISPLAY + WS._ui_helper->add_text_to_terminal( + "[IO] Device is un-throttled, resuming..."); +#endif } /**************************************************************************/ From d76efe122d3533ae3a99161084826675c1a99dca Mon Sep 17 00:00:00 2001 From: brentru Date: Tue, 20 Jun 2023 15:38:35 -0400 Subject: [PATCH 48/90] wrap ui_helper calls in USE_DISPLAY preproc --- src/Wippersnapper.cpp | 37 ++++++++++++++++++- .../analogIO/Wippersnapper_AnalogIO.cpp | 4 +- .../digitalIO/Wippersnapper_DigitalGPIO.cpp | 12 ++++++ src/components/ds18x20/ws_ds18x20.cpp | 8 ++++ src/components/i2c/WipperSnapper_I2C.cpp | 2 + src/components/pixels/ws_pixels.cpp | 20 ++++++++-- 6 files changed, 77 insertions(+), 6 deletions(-) diff --git a/src/Wippersnapper.cpp b/src/Wippersnapper.cpp index d2cbb3425..c1f8bdec1 100644 --- a/src/Wippersnapper.cpp +++ b/src/Wippersnapper.cpp @@ -274,19 +274,23 @@ bool Wippersnapper::configAnalogInPinReq( WS._analogIO->initAnalogInputPin(pin, pinMsg->period, pinMsg->pull, pinMsg->analog_read_mode); +#ifdef USE_DISPLAY char buffer[100]; snprintf(buffer, 100, "[Pin] Reading %s every %0.2f seconds\n", pinMsg->pin_name, pinMsg->period); WS._ui_helper->add_text_to_terminal(buffer); +#endif } else if ( pinMsg->request_type == wippersnapper_pin_v1_ConfigurePinRequest_RequestType_REQUEST_TYPE_DELETE) { WS._analogIO->deinitAnalogPin(pinMsg->direction, pin); +#ifdef USE_DISPLAY char buffer[100]; snprintf(buffer, 100, "[Pin] De-initialized pin %s\n.", pinMsg->pin_name); WS._ui_helper->add_text_to_terminal(buffer); +#endif } else { WS_DEBUG_PRINTLN("ERROR: Could not decode analog pin request!"); @@ -908,8 +912,10 @@ bool cbDecodeServoMsg(pb_istream_t *stream, const pb_field_t *field, &msgServoAttachReq)) { WS_DEBUG_PRINTLN( "ERROR: Could not decode wippersnapper_servo_v1_ServoAttachRequest"); +#ifdef USE_DISPLAY WS._ui_helper->add_text_to_terminal( "[Servo ERROR] Could not decode servo request from IO!\n"); +#endif return false; // fail out if we can't decode the request } // execute servo attach request @@ -919,9 +925,11 @@ bool cbDecodeServoMsg(pb_istream_t *stream, const pb_field_t *field, atoi(servoPin), msgServoAttachReq.min_pulse_width, msgServoAttachReq.max_pulse_width, msgServoAttachReq.servo_freq)) { WS_DEBUG_PRINTLN("ERROR: Unable to attach servo to pin!"); +#ifdef USE_DISPLAY WS._ui_helper->add_text_to_terminal( "[Servo ERROR] Unable to attach servo to pin! Is it already in " "use?\n"); +#endif attached = false; } else { WS_DEBUG_PRINT("ATTACHED servo w/minPulseWidth: "); @@ -930,11 +938,12 @@ bool cbDecodeServoMsg(pb_istream_t *stream, const pb_field_t *field, WS_DEBUG_PRINT(msgServoAttachReq.min_pulse_width); WS_DEBUG_PRINT("uS on pin: "); WS_DEBUG_PRINTLN(servoPin); - +#ifdef USE_DISPLAY char buffer[100]; snprintf(buffer, 100, "[Servo] Attached servo on pin %s\n.", msgServoAttachReq.servo_pin); WS._ui_helper->add_text_to_terminal(buffer); +#endif } // Create and fill a servo response message @@ -984,10 +993,12 @@ bool cbDecodeServoMsg(pb_istream_t *stream, const pb_field_t *field, WS_DEBUG_PRINT("uS to servo on pin#: "); WS_DEBUG_PRINTLN(servoPin); +#ifdef USE_DISPLAY char buffer[100]; snprintf(buffer, 100, "[Servo] Writing pulse width of %u uS to pin %s\n.", (int)msgServoWriteReq.pulse_width, msgServoWriteReq.servo_pin); WS._ui_helper->add_text_to_terminal(buffer); +#endif WS._servoComponent->servo_write(atoi(servoPin), (int)msgServoWriteReq.pulse_width); @@ -1010,10 +1021,12 @@ bool cbDecodeServoMsg(pb_istream_t *stream, const pb_field_t *field, WS_DEBUG_PRINT("Detaching servo from pin "); WS_DEBUG_PRINTLN(servoPin); +#ifdef USE_DISPLAY char buffer[100]; snprintf(buffer, 100, "[Servo] Detaching from pin %s\n.", msgServoDetachReq.servo_pin); WS._ui_helper->add_text_to_terminal(buffer); +#endif WS._servoComponent->servo_detach(atoi(servoPin)); } else { @@ -1077,8 +1090,10 @@ bool cbPWMDecodeMsg(pb_istream_t *stream, const pb_field_t *field, void **arg) { &msgPWMAttachRequest)) { WS_DEBUG_PRINTLN( "ERROR: Could not decode wippersnapper_pwm_v1_PWMAttachRequest"); +#ifdef USE_DISPLAY WS._ui_helper->add_text_to_terminal( "[PWM ERROR]: Could not decode pin attach request!\n"); +#endif return false; // fail out if we can't decode the request } @@ -1089,9 +1104,11 @@ bool cbPWMDecodeMsg(pb_istream_t *stream, const pb_field_t *field, void **arg) { (uint8_t)msgPWMAttachRequest.resolution); if (!attached) { WS_DEBUG_PRINTLN("ERROR: Unable to attach PWM pin"); +#ifdef USE_DISPLAY WS._ui_helper->add_text_to_terminal( "[PWM ERROR]: Failed to attach PWM to pin! Is this pin already in " "use?\n"); +#endif attached = false; } @@ -1120,10 +1137,12 @@ bool cbPWMDecodeMsg(pb_istream_t *stream, const pb_field_t *field, void **arg) { 1); WS_DEBUG_PRINTLN("Published!"); +#ifdef USE_DISPLAY char buffer[100]; snprintf(buffer, 100, "[PWM] Attached on pin %s\n.", msgPWMResponse.payload.attach_response.pin); WS._ui_helper->add_text_to_terminal(buffer); +#endif } else if (field->tag == wippersnapper_signal_v1_PWMRequest_detach_request_tag) { @@ -1135,18 +1154,22 @@ bool cbPWMDecodeMsg(pb_istream_t *stream, const pb_field_t *field, void **arg) { &msgPWMDetachRequest)) { WS_DEBUG_PRINTLN( "ERROR: Could not decode wippersnapper_pwm_v1_PWMDetachRequest"); +#ifdef USE_DISPLAY WS._ui_helper->add_text_to_terminal( "[PWM ERROR] Failed to decode pin detach request from IO!\n"); +#endif return false; // fail out if we can't decode the request } // execute PWM pin detatch request char *pwmPin = msgPWMDetachRequest.pin + 1; WS._pwmComponent->detach(atoi(pwmPin)); +#ifdef USE_DISPLAY char buffer[100]; snprintf(buffer, 100, "[PWM] Detached on pin %s\n.", msgPWMDetachRequest.pin); WS._ui_helper->add_text_to_terminal(buffer); +#endif } else if (field->tag == wippersnapper_signal_v1_PWMRequest_write_freq_request_tag) { @@ -1158,8 +1181,10 @@ bool cbPWMDecodeMsg(pb_istream_t *stream, const pb_field_t *field, void **arg) { &msgPWMWriteFreqRequest)) { WS_DEBUG_PRINTLN("ERROR: Could not decode " "wippersnapper_pwm_v1_PWMWriteFrequencyRequest"); +#ifdef USE_DISPLAY WS._ui_helper->add_text_to_terminal( "[PWM ERROR] Failed to decode frequency write request from IO!\n"); +#endif return false; // fail out if we can't decode the request } @@ -1171,10 +1196,12 @@ bool cbPWMDecodeMsg(pb_istream_t *stream, const pb_field_t *field, void **arg) { WS_DEBUG_PRINTLN(atoi(pwmPin)); WS._pwmComponent->writeTone(atoi(pwmPin), msgPWMWriteFreqRequest.frequency); +#ifdef USE_DISPLAY char buffer[100]; snprintf(buffer, 100, "[PWM] Writing %u Hz to pin %s\n.", msgPWMWriteFreqRequest.frequency, msgPWMWriteFreqRequest.pin); WS._ui_helper->add_text_to_terminal(buffer); +#endif } else if (field->tag == wippersnapper_signal_v1_PWMRequest_write_duty_request_tag) { @@ -1187,8 +1214,10 @@ bool cbPWMDecodeMsg(pb_istream_t *stream, const pb_field_t *field, void **arg) { &msgPWMWriteDutyCycleRequest)) { WS_DEBUG_PRINTLN("ERROR: Could not decode " "wippersnapper_pwm_v1_PWMWriteDutyCycleRequest"); +#ifdef USE_DISPLAY WS._ui_helper->add_text_to_terminal( "[PWM ERROR] Failed to decode duty cycle write request from IO!\n"); +#endif return false; // fail out if we can't decode the request } // execute PWM duty cycle write request @@ -1196,11 +1225,13 @@ bool cbPWMDecodeMsg(pb_istream_t *stream, const pb_field_t *field, void **arg) { WS._pwmComponent->writeDutyCycle( atoi(pwmPin), (int)msgPWMWriteDutyCycleRequest.duty_cycle); +#ifdef USE_DISPLAY char buffer[100]; snprintf(buffer, 100, "[PWM] Writing duty cycle %d % to pin %s\n.", (int)msgPWMWriteDutyCycleRequest.duty_cycle, msgPWMWriteDutyCycleRequest.pin); WS._ui_helper->add_text_to_terminal(buffer); +#endif } else { WS_DEBUG_PRINTLN("Unable to decode PWM message type!"); @@ -1355,7 +1386,9 @@ bool cbDecodePixelsMsg(pb_istream_t *stream, const pb_field_t *field, &msgPixelsCreateReq)) { WS_DEBUG_PRINTLN("ERROR: Could not decode message of type " "wippersnapper_pixels_v1_PixelsCreateRequest!"); +#ifdef USE_DISPLAY WS._ui_helper->add_text_to_terminal("[Pixel] Error decoding message!\n"); +#endif return false; } @@ -2185,7 +2218,9 @@ void Wippersnapper::pingBroker() { // blink status LED every STATUS_LED_KAT_BLINK_TIME millis if (millis() > (_prvKATBlink + STATUS_LED_KAT_BLINK_TIME)) { WS_DEBUG_PRINTLN("STATUS LED BLINK KAT"); +#ifdef USE_DISPLAY WS._ui_helper->add_text_to_terminal("[NET] Sent KeepAlive ping!\n"); +#endif statusLEDBlink(WS_LED_STATUS_KAT); _prvKATBlink = millis(); } diff --git a/src/components/analogIO/Wippersnapper_AnalogIO.cpp b/src/components/analogIO/Wippersnapper_AnalogIO.cpp index 7d046fe52..a6bc4ea57 100644 --- a/src/components/analogIO/Wippersnapper_AnalogIO.cpp +++ b/src/components/analogIO/Wippersnapper_AnalogIO.cpp @@ -271,8 +271,10 @@ bool Wippersnapper_AnalogIO::encodePinEvent( pinValVolts); snprintf(buffer, 100, "[Pin] A%d read: %0.2f\n", pinName, pinValVolts); } - // display analog pin read on terminal +// display analog pin read on terminal +#ifdef USE_DISPLAY WS._ui_helper->add_text_to_terminal(buffer); +#endif // Encode signal message pb_ostream_t stream = diff --git a/src/components/digitalIO/Wippersnapper_DigitalGPIO.cpp b/src/components/digitalIO/Wippersnapper_DigitalGPIO.cpp index 0ffad3ab1..5d9397bcc 100644 --- a/src/components/digitalIO/Wippersnapper_DigitalGPIO.cpp +++ b/src/components/digitalIO/Wippersnapper_DigitalGPIO.cpp @@ -75,9 +75,11 @@ void Wippersnapper_DigitalGPIO::initDigitalPin( WS_DEBUG_PRINT("Configured digital output pin on D"); WS_DEBUG_PRINTLN(pinName); +#ifdef USE_DISPLAY char buffer[100]; snprintf(buffer, 100, "[Pin] Configured Digital Output on D%u\n", pinName); WS._ui_helper->add_text_to_terminal(buffer); +#endif // Initialize LOW #if defined(ARDUINO_ESP8266_ADAFRUIT_HUZZAH) @@ -107,11 +109,13 @@ void Wippersnapper_DigitalGPIO::initDigitalPin( WS_DEBUG_PRINT("Interval (ms):"); WS_DEBUG_PRINTLN(periodMs); +#ifdef USE_DISPLAY char buffer[100]; snprintf(buffer, 100, "[Pin] Configured Digital Input on D%u, polling every %lmS\n", pinName, periodMs); WS._ui_helper->add_text_to_terminal(buffer); +#endif // attempt to allocate a pinName within _digital_input_pins[] for (int i = 0; i < _totalDigitalInputPins; i++) { @@ -142,9 +146,11 @@ void Wippersnapper_DigitalGPIO::deinitDigitalPin( WS_DEBUG_PRINT("Deinitializing digital pin "); WS_DEBUG_PRINTLN(pinName); +#ifdef USE_DISPLAY char buffer[100]; snprintf(buffer, 100, "[Pin] De-initialized D%u\n", pinName); WS._ui_helper->add_text_to_terminal(buffer); +#endif if (direction == wippersnapper_pin_v1_ConfigurePinRequest_Direction_DIRECTION_INPUT) { @@ -200,9 +206,11 @@ void Wippersnapper_DigitalGPIO::digitalWriteSvc(uint8_t pinName, int pinValue) { WS_DEBUG_PRINT(" to "); WS_DEBUG_PRINTLN(pinValue); +#ifdef USE_DISPLAY char buffer[100]; snprintf(buffer, 100, "[Pin] Writing %d to D%u\n", pinValue, pinName); WS._ui_helper->add_text_to_terminal(buffer); +#endif // Write to the GPIO pin #if defined(ARDUINO_ESP8266_ADAFRUIT_HUZZAH) @@ -238,10 +246,12 @@ void Wippersnapper_DigitalGPIO::processDigitalInputs() { // read the pin int pinVal = digitalReadSvc(_digital_input_pins[i].pinName); +#ifdef USE_DISPLAY char buffer[100]; snprintf(buffer, 100, "[Pin] Read D%u: %d\n", _digital_input_pins[i].pinName, pinVal); WS._ui_helper->add_text_to_terminal(buffer); +#endif // Create new signal message wippersnapper_signal_v1_CreateSignalRequest _outgoingSignalMsg = @@ -276,10 +286,12 @@ void Wippersnapper_DigitalGPIO::processDigitalInputs() { WS_DEBUG_PRINT("Executing state-based event on D"); WS_DEBUG_PRINTLN(_digital_input_pins[i].pinName); +#ifdef USE_DISPLAY char buffer[100]; snprintf(buffer, 100, "[Pin] Read D%u: %d\n", _digital_input_pins[i].pinName, pinVal); WS._ui_helper->add_text_to_terminal(buffer); +#endif // Create new signal message wippersnapper_signal_v1_CreateSignalRequest _outgoingSignalMsg = diff --git a/src/components/ds18x20/ws_ds18x20.cpp b/src/components/ds18x20/ws_ds18x20.cpp index 9e3069e0b..50e26db9f 100644 --- a/src/components/ds18x20/ws_ds18x20.cpp +++ b/src/components/ds18x20/ws_ds18x20.cpp @@ -97,10 +97,12 @@ bool ws_ds18x20::addDS18x20( WS_DEBUG_PRINT(msgDs18x20InitReq->onewire_pin); WS_DEBUG_PRINTLN(" with DS18x20 attached!"); +#ifdef USE_DISPLAY char buffer[100]; snprintf(buffer, 100, "[DS18x] Attached DS18x20 sensor to pin %s\n", msgDs18x20InitReq->onewire_pin); WS._ui_helper->add_text_to_terminal(buffer); +#endif // Encode and publish response back to broker memset(WS._buffer_outgoing, 0, sizeof(WS._buffer_outgoing)); @@ -147,10 +149,12 @@ void ws_ds18x20::deleteDS18x20( } } +#ifdef USE_DISPLAY char buffer[100]; snprintf(buffer, 100, "[DS18x] Deleted DS18x20 sensor on pin %s\n", msgDS18x20DeinitReq->onewire_pin); WS._ui_helper->add_text_to_terminal(buffer); +#endif } /*************************************************************/ @@ -190,9 +194,11 @@ void ws_ds18x20::update() { if (tempC == DEVICE_DISCONNECTED_C) { WS_DEBUG_PRINTLN("ERROR: Could not read temperature data, is the " "sensor disconnected?"); +#ifdef USE_DISPLAY WS._ui_helper->add_text_to_terminal( "[DS18x ERROR] Unable to read temperature, is the sensor " "disconnected?\n"); +#endif break; } @@ -293,7 +299,9 @@ void ws_ds18x20::update() { return; }; WS_DEBUG_PRINTLN("PUBLISHED!"); +#ifdef USE_DISPLAY WS._ui_helper->add_text_to_terminal(buffer); +#endif (*iter)->sensorPeriodPrv = curTime; // set prv period } diff --git a/src/components/i2c/WipperSnapper_I2C.cpp b/src/components/i2c/WipperSnapper_I2C.cpp index 105f2b32f..d7a2f1f68 100644 --- a/src/components/i2c/WipperSnapper_I2C.cpp +++ b/src/components/i2c/WipperSnapper_I2C.cpp @@ -649,7 +649,9 @@ void WipperSnapper_Component_I2C::displayDeviceEventMessage( default: break; } +#ifdef USE_DISPLAY WS._ui_helper->add_text_to_terminal(buffer); +#endif } } diff --git a/src/components/pixels/ws_pixels.cpp b/src/components/pixels/ws_pixels.cpp index 9ccedfcfb..bd144fb45 100644 --- a/src/components/pixels/ws_pixels.cpp +++ b/src/components/pixels/ws_pixels.cpp @@ -265,9 +265,12 @@ bool ws_pixels::addStrand( WS_DEBUG_PRINT(" on GPIO #"); WS_DEBUG_PRINTLN(pixelsCreateReqMsg->pixels_pin_neopixel); +#ifdef USE_DISPLAY char buffer[100]; - snprintf(buffer, 100, "[Pixel] Added NeoPixel strand on Pin %s\n.", pixelsCreateReqMsg->pixels_pin_neopixel); + snprintf(buffer, 100, "[Pixel] Added NeoPixel strand on Pin %s\n.", + pixelsCreateReqMsg->pixels_pin_neopixel); WS._ui_helper->add_text_to_terminal(buffer); +#endif publishAddStrandResponse(true, pixelsCreateReqMsg->pixels_pin_neopixel); } else if (pixelsCreateReqMsg->pixels_type == @@ -304,9 +307,12 @@ bool ws_pixels::addStrand( WS_DEBUG_PRINT(" on Data GPIO #"); WS_DEBUG_PRINTLN(strands[strandIdx].pinDotStarData); +#ifdef USE_DISPLAY char buffer[100]; - snprintf(buffer, 100, "[Pixel] Added NeoPixel strand on Pin %s\n.", pixelsCreateReqMsg->pixels_pin_neopixel); + snprintf(buffer, 100, "[Pixel] Added NeoPixel strand on Pin %s\n.", + pixelsCreateReqMsg->pixels_pin_neopixel); WS._ui_helper->add_text_to_terminal(buffer); +#endif publishAddStrandResponse(true, pixelsCreateReqMsg->pixels_pin_dotstar_data); } else { @@ -367,9 +373,12 @@ void ws_pixels::deleteStrand( WS_DEBUG_PRINT("Deleted strand on data pin "); WS_DEBUG_PRINTLN(pixelsDeleteMsg->pixels_pin_data); +#ifdef USE_DISPLAY char buffer[100]; - snprintf(buffer, 100, "[Pixel] Deleted strand on pin %s\n.", pixelsDeleteMsg->pixels_pin_data); + snprintf(buffer, 100, "[Pixel] Deleted strand on pin %s\n.", + pixelsDeleteMsg->pixels_pin_data); WS._ui_helper->add_text_to_terminal(buffer); +#endif } /**************************************************************************/ @@ -422,9 +431,12 @@ void ws_pixels::fillStrand( WS_DEBUG_PRINT("Filling color: "); WS_DEBUG_PRINTLN(pixelsWriteMsg->pixels_color); +#ifdef USE_DISPLAY char buffer[100]; - snprintf(buffer, 100, "[Pixel] Filling strand on pin %s with color %u\n.", pixelsWriteMsg->pixels_pin_data, pixelsWriteMsg->pixels_color); + snprintf(buffer, 100, "[Pixel] Filling strand on pin %s with color %u\n.", + pixelsWriteMsg->pixels_pin_data, pixelsWriteMsg->pixels_color); WS._ui_helper->add_text_to_terminal(buffer); +#endif if (pixelsWriteMsg->pixels_type == wippersnapper_pixels_v1_PixelsType_PIXELS_TYPE_NEOPIXEL) { From 237d5f7462fe3e534e54db2711f5f6a5b8e06545 Mon Sep 17 00:00:00 2001 From: brentru Date: Wed, 21 Jun 2023 12:40:05 -0400 Subject: [PATCH 49/90] track the loading screen's state and collapse bug that occurs with netfsm --- src/Wippersnapper.cpp | 9 ++++++--- src/display/ws_display_ui_helper.cpp | 15 +++++++++++++++ src/display/ws_display_ui_helper.h | 3 ++- 3 files changed, 23 insertions(+), 4 deletions(-) diff --git a/src/Wippersnapper.cpp b/src/Wippersnapper.cpp index c1f8bdec1..615a72897 100644 --- a/src/Wippersnapper.cpp +++ b/src/Wippersnapper.cpp @@ -2048,7 +2048,8 @@ void Wippersnapper::runNetFSM() { if (networkStatus() == WS_NET_CONNECTED) { WS_DEBUG_PRINTLN("Connected to WiFi!"); #ifdef USE_DISPLAY - WS._ui_helper->set_load_bar_icon_complete(loadBarIconWifi); + if (WS._ui_helper->getLoadingState()) + WS._ui_helper->set_load_bar_icon_complete(loadBarIconWifi); #endif fsmNetwork = FSM_NET_ESTABLISH_MQTT; break; @@ -2058,7 +2059,8 @@ void Wippersnapper::runNetFSM() { case FSM_NET_ESTABLISH_NETWORK: WS_DEBUG_PRINTLN("Connecting to WiFi..."); #ifdef USE_DISPLAY - WS._ui_helper->set_label_status("Connecting to WiFi..."); + if (WS._ui_helper->getLoadingState()) + WS._ui_helper->set_label_status("Connecting to WiFi..."); #endif // Perform a WiFi scan and check if SSID within // secrets.json is within the scanned SSIDs @@ -2106,7 +2108,8 @@ void Wippersnapper::runNetFSM() { case FSM_NET_ESTABLISH_MQTT: WS_DEBUG_PRINTLN("Attempting to connect to IO..."); #ifdef USE_DISPLAY - WS._ui_helper->set_label_status("Connecting to IO..."); + if (WS._ui_helper->getLoadingState()) + WS._ui_helper->set_label_status("Connecting to IO..."); #endif WS._mqtt->setKeepAliveInterval(WS_KEEPALIVE_INTERVAL_MS / 1000); // Attempt to connect diff --git a/src/display/ws_display_ui_helper.cpp b/src/display/ws_display_ui_helper.cpp index a1abd9e7b..414fad39c 100644 --- a/src/display/ws_display_ui_helper.cpp +++ b/src/display/ws_display_ui_helper.cpp @@ -121,6 +121,17 @@ void ws_display_ui_helper::set_load_bar_icon_complete(loadBarIcons iconType) { _dispDriver->esp32_lvgl_release(); } +/**************************************************************************/ +/*! + @brief Returns the loading screen's state. + @returns The loading state, True if loading screen is active, + False otherwise. +*/ +/**************************************************************************/ +bool ws_display_ui_helper::getLoadingState() { + return _loadingState; +} + /**************************************************************************/ /*! @brief Builds and displays the loading screen. @@ -196,6 +207,8 @@ void ws_display_ui_helper::show_scr_load() { timerLoadTips = lv_timer_create(lv_timer_tips_cb, 3000, NULL); _dispDriver->esp32_lvgl_release(); + + _loadingState = true; // using the loading screen state } /**************************************************************************/ @@ -221,6 +234,8 @@ void ws_display_ui_helper::clear_scr_load() { remove_tip_timer(); lv_obj_del(lblTipText); _dispDriver->esp32_lvgl_release(); + + _loadingState = false; // no longer using the loading screen state } /**************************************************************************/ diff --git a/src/display/ws_display_ui_helper.h b/src/display/ws_display_ui_helper.h index 3f1218d53..8c88fee0c 100644 --- a/src/display/ws_display_ui_helper.h +++ b/src/display/ws_display_ui_helper.h @@ -118,12 +118,13 @@ class ws_display_ui_helper { void set_load_bar_icon_complete(loadBarIcons iconType); void set_label_status(const char *text); // callback ui help? void remove_tip_timer(); - void show_scr_error(const char *lblError, const char *lblDesc); + bool getLoadingState(); private: ws_display_driver *_dispDriver = nullptr; void addToTerminal(const char *txt_in); + bool _loadingState = false; }; #endif // WS_DISPLAY_UI_HELPER_H From 975b9919d231fe06f812b67613802a5a0a93ba3f Mon Sep 17 00:00:00 2001 From: brentru Date: Wed, 21 Jun 2023 15:02:00 -0400 Subject: [PATCH 50/90] fix mutex deadlock --- src/Wippersnapper.cpp | 3 +- src/display/ws_display_ui_helper.cpp | 109 +++++++++++++-------------- 2 files changed, 55 insertions(+), 57 deletions(-) diff --git a/src/Wippersnapper.cpp b/src/Wippersnapper.cpp index 615a72897..581f190ca 100644 --- a/src/Wippersnapper.cpp +++ b/src/Wippersnapper.cpp @@ -1598,7 +1598,7 @@ void cbThrottleTopic(char *throttleData, uint16_t len) { WS_DEBUG_PRINTLN("Device is un-throttled, resumed command execution"); #ifdef USE_DISPLAY WS._ui_helper->add_text_to_terminal( - "[IO] Device is un-throttled, resuming..."); + "[IO] Device is un-throttled, resuming...\n"); #endif } @@ -2093,6 +2093,7 @@ void Wippersnapper::runNetFSM() { // Validate connection if (networkStatus() != WS_NET_CONNECTED) { + WS_DEBUG_PRINTLN("ERROR: Unable to connect to WiFi!"); #ifdef USE_DISPLAY WS._ui_helper->show_scr_error( "CONNECTION ERROR", diff --git a/src/display/ws_display_ui_helper.cpp b/src/display/ws_display_ui_helper.cpp index 414fad39c..6767cb57a 100644 --- a/src/display/ws_display_ui_helper.cpp +++ b/src/display/ws_display_ui_helper.cpp @@ -15,7 +15,6 @@ #include "ws_display_ui_helper.h" - /**************************************************************************/ /*! @brief Changes a label every 2 seconds to a new, random, tip. @@ -29,8 +28,6 @@ void lv_timer_tips_cb(lv_timer_t *timer) { lv_label_set_text(lblTipText, loading_tips[tipNum]); } - - /**************************************************************************/ /*! @brief Callback for updating the status label on the loading screen. @@ -124,13 +121,11 @@ void ws_display_ui_helper::set_load_bar_icon_complete(loadBarIcons iconType) { /**************************************************************************/ /*! @brief Returns the loading screen's state. - @returns The loading state, True if loading screen is active, + @returns The loading state, True if loading screen is active, False otherwise. */ /**************************************************************************/ -bool ws_display_ui_helper::getLoadingState() { - return _loadingState; -} +bool ws_display_ui_helper::getLoadingState() { return _loadingState; } /**************************************************************************/ /*! @@ -218,6 +213,7 @@ void ws_display_ui_helper::show_scr_load() { */ /**************************************************************************/ void ws_display_ui_helper::clear_scr_load() { + Serial.println("clear_scr_load"); _dispDriver->esp32_lvgl_acquire(); // Delete icons lv_obj_del(lblStatusText); @@ -234,7 +230,6 @@ void ws_display_ui_helper::clear_scr_load() { remove_tip_timer(); lv_obj_del(lblTipText); _dispDriver->esp32_lvgl_release(); - _loadingState = false; // no longer using the loading screen state } @@ -249,12 +244,12 @@ void ws_display_ui_helper::clear_scr_load() { /**************************************************************************/ void ws_display_ui_helper::show_scr_error(const char *lblError, const char *lblDesc) { - Serial.println("ws_display_ui_helper"); + Serial.println("show_scr_error"); // clear the active loading screen (for now, will eventually expand to take in // a scr obj.) - _dispDriver->esp32_lvgl_acquire(); clear_scr_load(); + _dispDriver->esp32_lvgl_acquire(); // Create error symbol labelErrorTriangle = lv_label_create(lv_scr_act()); @@ -301,7 +296,7 @@ void ws_display_ui_helper::build_scr_monitor() { _dispDriver->esp32_lvgl_acquire(); // add canvas to create a status bar - lv_obj_t * canvas = lv_canvas_create(lv_scr_act()); + lv_obj_t *canvas = lv_canvas_create(lv_scr_act()); static uint8_t buffer[LV_CANVAS_BUF_SIZE_TRUE_COLOR(240, 25)]; lv_canvas_set_buffer(canvas, buffer, 240, 25, LV_IMG_CF_TRUE_COLOR); lv_canvas_fill_bg(canvas, lv_color_black(), LV_OPA_COVER); @@ -313,13 +308,15 @@ void ws_display_ui_helper::build_scr_monitor() { // Add battery icon to status bar // Future TODO: Optional timer to check battery level on some boards - // Note: FunHouse won't require this and should always be have a full battery displayed + // Note: FunHouse won't require this and should always be have a full battery + // displayed statusbar_icon_bat = lv_label_create(lv_scr_act()); lv_label_set_text(statusbar_icon_bat, LV_SYMBOL_BATTERY_FULL); lv_obj_align(statusbar_icon_bat, LV_ALIGN_TOP_RIGHT, -5, 6); // Add WiFi icon to status bar - // Future TODO: Timer to check if we are still connected to WiFi levels every 2000ms + // Future TODO: Timer to check if we are still connected to WiFi levels every + // 2000ms statusbar_icon_wifi = lv_label_create(lv_scr_act()); lv_label_set_text(statusbar_icon_wifi, LV_SYMBOL_WIFI); lv_obj_align(statusbar_icon_wifi, LV_ALIGN_TOP_RIGHT, -30, 5); @@ -332,8 +329,7 @@ void ws_display_ui_helper::build_scr_monitor() { lv_style_set_text_color(&styleIconTurtleStatusbar, lv_palette_main(LV_PALETTE_GREEN)); lv_style_set_text_font(&styleIconTurtleStatusbar, &turtle_16); - lv_obj_add_style(labelTurtleBar, &styleIconTurtleStatusbar, - LV_PART_MAIN); + lv_obj_add_style(labelTurtleBar, &styleIconTurtleStatusbar, LV_PART_MAIN); lv_obj_align(labelTurtleBar, LV_ALIGN_TOP_LEFT, 5, 5); // Add a label to hold console text @@ -377,52 +373,53 @@ void ws_display_ui_helper::add_text_to_terminal(const char *text) { https://github.com/lvgl/lv_demos/blob/release/v6/lv_apps/terminal/terminal.c */ /**************************************************************************/ -void ws_display_ui_helper::addToTerminal(const char * txt_in) -{ - // Calculate text size - size_t txt_len = strlen(txt_in); - size_t old_len = strlen(terminalTextBuffer); - - // If the data is longer then the terminal ax size show the last part of data - if(txt_len > MAX_CONSOLE_TEXT_LEN) { - txt_in += (txt_len - MAX_CONSOLE_TEXT_LEN); - txt_len = MAX_CONSOLE_TEXT_LEN; - old_len = 0; - } - - // If the text become too long 'forget' the oldest lines - else if(old_len + txt_len > MAX_CONSOLE_TEXT_LEN) { - uint16_t new_start; - for(new_start = 0; new_start < old_len; new_start++) { - if(terminalTextBuffer[new_start] == '\n') { - if(new_start >= txt_len) { - while(terminalTextBuffer[new_start] == '\n' || terminalTextBuffer[new_start] == '\r') new_start++; - break; - } - } - } +void ws_display_ui_helper::addToTerminal(const char *txt_in) { + // Calculate text size + size_t txt_len = strlen(txt_in); + size_t old_len = strlen(terminalTextBuffer); + + // If the data is longer then the terminal ax size show the last part of data + if (txt_len > MAX_CONSOLE_TEXT_LEN) { + txt_in += (txt_len - MAX_CONSOLE_TEXT_LEN); + txt_len = MAX_CONSOLE_TEXT_LEN; + old_len = 0; + } - // If it wasn't able to make enough space on line breaks simply forget the oldest characters - if(new_start == old_len) { - new_start = old_len - (MAX_CONSOLE_TEXT_LEN - txt_len); + // If the text become too long 'forget' the oldest lines + else if (old_len + txt_len > MAX_CONSOLE_TEXT_LEN) { + uint16_t new_start; + for (new_start = 0; new_start < old_len; new_start++) { + if (terminalTextBuffer[new_start] == '\n') { + if (new_start >= txt_len) { + while (terminalTextBuffer[new_start] == '\n' || + terminalTextBuffer[new_start] == '\r') + new_start++; + break; } + } + } - // Move the remaining text to the beginning - uint16_t j; - for(j = new_start; j < old_len; j++) { - terminalTextBuffer[j - new_start] = terminalTextBuffer[j]; - } - old_len = old_len - new_start; - terminalTextBuffer[old_len] = '\0'; + // If it wasn't able to make enough space on line breaks simply forget the + // oldest characters + if (new_start == old_len) { + new_start = old_len - (MAX_CONSOLE_TEXT_LEN - txt_len); + } + // Move the remaining text to the beginning + uint16_t j; + for (j = new_start; j < old_len; j++) { + terminalTextBuffer[j - new_start] = terminalTextBuffer[j]; } + old_len = old_len - new_start; + terminalTextBuffer[old_len] = '\0'; + } - // Copy new text to the text buffer - memcpy(&terminalTextBuffer[old_len], txt_in, txt_len); - terminalTextBuffer[old_len + txt_len] = '\0'; + // Copy new text to the text buffer + memcpy(&terminalTextBuffer[old_len], txt_in, txt_len); + terminalTextBuffer[old_len + txt_len] = '\0'; - // Update label - _dispDriver->esp32_lvgl_acquire(); - lv_label_set_text_static(terminalLabel, terminalTextBuffer); - _dispDriver->esp32_lvgl_release(); + // Update label + _dispDriver->esp32_lvgl_acquire(); + lv_label_set_text_static(terminalLabel, terminalTextBuffer); + _dispDriver->esp32_lvgl_release(); } From bc71ef095d8227dcaafa9617654b6985a7a826b8 Mon Sep 17 00:00:00 2001 From: brentru Date: Wed, 21 Jun 2023 17:18:00 -0400 Subject: [PATCH 51/90] increase verbosity of error screens --- src/Wippersnapper.cpp | 5 ++- src/provisioning/tinyusb/Wippersnapper_FS.cpp | 32 ++++++++----------- 2 files changed, 18 insertions(+), 19 deletions(-) diff --git a/src/Wippersnapper.cpp b/src/Wippersnapper.cpp index 581f190ca..2b0e8b8f8 100644 --- a/src/Wippersnapper.cpp +++ b/src/Wippersnapper.cpp @@ -2132,7 +2132,10 @@ void Wippersnapper::runNetFSM() { #ifdef USE_DISPLAY WS._ui_helper->show_scr_error( "CONNECTION ERROR", - "Unable to connect to Adafruit.io, rebooting in 5 seconds..."); + "Unable to connect to Adafruit.io. If you are repeatedly having " + "this issue, please check that your IO Username and IO Key are set " + "correctly in the secrets file. This device will reboot in 5 " + "seconds..."); #endif haltError( "ERROR: Unable to connect to Adafruit.IO MQTT, rebooting soon...", diff --git a/src/provisioning/tinyusb/Wippersnapper_FS.cpp b/src/provisioning/tinyusb/Wippersnapper_FS.cpp index c426f0227..79fd31c67 100644 --- a/src/provisioning/tinyusb/Wippersnapper_FS.cpp +++ b/src/provisioning/tinyusb/Wippersnapper_FS.cpp @@ -312,13 +312,13 @@ void Wippersnapper_FS::createSecretsFile() { writeToBootOut( "* Please edit the secrets.json file. Then, reset your board.\n"); - #ifdef USE_DISPLAY +#ifdef USE_DISPLAY WS._ui_helper->show_scr_error( "INVALID SETTINGS FILE", "The settings.json file on the WIPPER drive contains default values. " "Please edit it to reflect your Adafruit IO and network credentials. " "When you're done, press RESET on the board."); - #endif +#endif fsHalt(); } @@ -350,13 +350,12 @@ void Wippersnapper_FS::parseSecrets() { strcmp(io_username, "YOUR_IO_USERNAME_HERE") == 0) { WS_DEBUG_PRINTLN("ERROR: invalid io_username value in secrets.json!"); writeToBootOut("ERROR: invalid io_username value in secrets.json!\n"); - #ifdef USE_DISPLAY +#ifdef USE_DISPLAY WS._ui_helper->show_scr_error( "INVALID USERNAME", "The \"io_username\" field within secrets.json is invalid, please " - "change it to match your Adafruit IO username.\nConfused? Visit " - "adafru.it/123456 for detailed instructions."); - #endif + "change it to match your Adafruit IO username and press RESET."); +#endif fsHalt(); } // Set io_username @@ -367,13 +366,12 @@ void Wippersnapper_FS::parseSecrets() { if (io_key == nullptr) { WS_DEBUG_PRINTLN("ERROR: invalid io_key value in secrets.json!"); writeToBootOut("ERROR: invalid io_key value in secrets.json!\n"); - #ifdef USE_DISPLAY +#ifdef USE_DISPLAY WS._ui_helper->show_scr_error( "INVALID IO KEY", "The \"io_key\" field within secrets.json is invalid, please change it " - "to match your Adafruit IO username.\nConfused? Visit adafru.it/123456 " - "for detailed instructions."); - #endif + "to match your Adafruit IO username."); +#endif fsHalt(); } WS._key = io_key; @@ -384,13 +382,12 @@ void Wippersnapper_FS::parseSecrets() { strcmp(network_type_wifi_ssid, "YOUR_WIFI_SSID_HERE") == 0) { WS_DEBUG_PRINTLN("ERROR: invalid network_ssid value in secrets.json!"); writeToBootOut("ERROR: invalid network_ssid value in secrets.json!\n"); - #ifdef USE_DISPLAY +#ifdef USE_DISPLAY WS._ui_helper->show_scr_error( "INVALID SSID", "The \"network_ssid\" field within secrets.json is invalid, please " - "change it to match your Adafruit IO username.\nConfused? Visit " - "adafru.it/123456 for detailed instructions."); - #endif + "change it to match your Adafruit IO username and press RESET."); +#endif fsHalt(); } // Set network SSID @@ -405,13 +402,12 @@ void Wippersnapper_FS::parseSecrets() { "secrets.json!"); writeToBootOut("ERROR: invalid network_type_wifi_password value in " "secrets.json!\n"); - #ifdef USE_DISPLAY +#ifdef USE_DISPLAY WS._ui_helper->show_scr_error( "INVALID SSID", "The \"network_ssid\" field within secrets.json is invalid, please " - "change it to match your Adafruit IO username.\nConfused? Visit " - "adafru.it/123456 for detailed instructions."); - #endif + "change it to match your Adafruit IO username and press RESET."); +#endif fsHalt(); } WS._network_pass = network_type_wifi_password; From f78e143f46db9b0edd3a80151842268c7d1f9f72 Mon Sep 17 00:00:00 2001 From: brentru Date: Thu, 22 Jun 2023 13:55:24 -0400 Subject: [PATCH 52/90] remove TODO, debugs --- src/display/ws_display_driver.cpp | 67 ++++++++++++++----------------- 1 file changed, 31 insertions(+), 36 deletions(-) diff --git a/src/display/ws_display_driver.cpp b/src/display/ws_display_driver.cpp index bcb7c3544..9619be5c7 100644 --- a/src/display/ws_display_driver.cpp +++ b/src/display/ws_display_driver.cpp @@ -32,14 +32,7 @@ static void my_log_cb(const char *buf) { WS_DEBUG_PRINTLN(buf); } */ /**************************************************************************/ ws_display_driver::ws_display_driver(displayConfig config) { - WS_DEBUG_PRINT("Display Configuration: \n"); - WS_DEBUG_PRINTLN(config.pinCS); - WS_DEBUG_PRINTLN(config.pinDC); - WS_DEBUG_PRINTLN(config.pinRST); - WS_DEBUG_PRINTLN(config.width); - WS_DEBUG_PRINTLN(config.height); - - // let's dynamically create the display driver from the configuration file + // dynamically create the display driver from the configuration file if (strcmp(config.driver, "ST7789") == 0) { Serial.println("Configuring the Adafruit_ST7789 driver"); _tft_st7789 = @@ -63,21 +56,6 @@ ws_display_driver::~ws_display_driver() { } } -/**************************************************************************/ -/*! - @brief Sets the display resolution, must be called BEFORE begin()! - @param displayWidth - The width of the display, in pixels. - @param displayHeight - The height of the display, in pixels. -*/ -/**************************************************************************/ -void ws_display_driver::setResolution(uint16_t displayWidth, - uint16_t displayHeight) { - _displayWidth = displayWidth; - _displayHeight = displayHeight; -} - /**************************************************************************/ /*! @brief Enables LVGL logging using the usb serial. Must be called @@ -97,6 +75,21 @@ void ws_display_driver::setRotation(uint8_t rotationMode) { _displayRotationMode = rotationMode; } +/**************************************************************************/ +/*! + @brief Sets the display resolution, must be called BEFORE begin()! + @param displayWidth + The width of the display, in pixels. + @param displayHeight + The height of the display, in pixels. +*/ +/**************************************************************************/ +void ws_display_driver::setResolution(uint16_t displayWidth, + uint16_t displayHeight) { + _displayWidth = displayWidth; + _displayHeight = displayHeight; +} + /**************************************************************************/ /*! @brief Initializes the display and the lvgl_glue driver. @@ -104,12 +97,9 @@ void ws_display_driver::setRotation(uint8_t rotationMode) { */ /**************************************************************************/ bool ws_display_driver::begin() { - - // TODO: This function could use some cleanup around how it inits glue - // initialize display driver if (_tft_st7789 != nullptr) { - WS_DEBUG_PRINTLN("INIT st7789 tft"); + WS_DEBUG_PRINTLN("Initialize ST7789 driver"); _tft_st7789->init(_displayWidth, _displayHeight); } else { Serial.println("ERROR: Unable to initialize the display driver!"); @@ -122,34 +112,39 @@ bool ws_display_driver::begin() { digitalWrite(TFT_BACKLIGHT, HIGH); #endif // ARDUINO_FUNHOUSE_ESP32S2 - //WS_DEBUG_PRINTLN("Fill screen"); - //_tft_st7789->fillScreen(ST77XX_BLACK); - - // initialize LVGL_glue - WS_DEBUG_PRINTLN("INIT lvgl_glue"); + // initialize lvgl_glue + WS_DEBUG_PRINTLN("Initialize LVGL"); _glue = new Adafruit_LvGL_Glue(); LvGLStatus status = _glue->begin(_tft_st7789); - WS_DEBUG_PRINT("LVGL GLUE STATUS: "); + WS_DEBUG_PRINT("LVGL RC: "); WS_DEBUG_PRINTLN((int) status); // check if lvgl initialized correctly if (status != LVGL_OK) { - Serial.printf("LVGL_Glue error %d\r\n", (int)status); + Serial.printf("LVGL_Glue error: %d\r\n", (int)status); return false; } - WS_DEBUG_PRINTLN("Setting screen BLACK"); esp32_lvgl_acquire(); lv_obj_set_style_bg_color(lv_scr_act(), lv_color_white(), LV_STATE_DEFAULT); esp32_lvgl_release(); - return true; } +/**************************************************************************/ +/*! + @brief Acquires the LVGL_Glue lock. +*/ +/**************************************************************************/ void ws_display_driver::esp32_lvgl_acquire() { _glue->lvgl_acquire(); } +/**************************************************************************/ +/*! + @brief Releases the LVGL_Glue lock. +*/ +/**************************************************************************/ void ws_display_driver::esp32_lvgl_release() { _glue->lvgl_release(); } \ No newline at end of file From e1feb498db33254e4e44b2884b04011f6e6203e0 Mon Sep 17 00:00:00 2001 From: brentru Date: Thu, 22 Jun 2023 14:03:11 -0400 Subject: [PATCH 53/90] doxy1 --- src/display/ws_display_driver.h | 39 ++++++++++++++-------------- src/display/ws_display_tooltips.h | 15 +++++++---- src/display/ws_display_ui_helper.cpp | 4 +-- 3 files changed, 32 insertions(+), 26 deletions(-) diff --git a/src/display/ws_display_driver.h b/src/display/ws_display_driver.h index 649571d60..7d3273590 100644 --- a/src/display/ws_display_driver.h +++ b/src/display/ws_display_driver.h @@ -22,20 +22,20 @@ #include struct displayConfig { - char driver[10]; - int width; - int height; - int rotation; - bool isSPI; - bool isI2C; - uint8_t pinCS; - uint8_t pinDC; - uint8_t pinMOSI; - uint8_t pinSCK; - uint8_t pinRST; -}; + char driver[10]; ///< Display driver type + int width; ///< Display width + int height; ///< Display height + int rotation; ///< Display rotation + bool isSPI; ///< Is the display SPI? + bool isI2C; ///< Is the display I2C? + uint8_t pinCS; ///< Display CS pin + uint8_t pinDC; ///< Display DC pin + uint8_t pinMOSI; ///< Display MOSI pin + uint8_t pinSCK; ///< Display SCK pin + uint8_t pinRST; ///< Display RST pin +}; ///< Display configuration struct -LV_FONT_DECLARE(errorTriangle); +LV_FONT_DECLARE(errorTriangle); ///< Error triangle symbol/font class Wippersnapper; // fwd decl @@ -54,15 +54,16 @@ class ws_display_driver { void setResolution(uint16_t displayWidth, uint16_t displayHeight); void setRotation(uint8_t rotationMode); void enableLogging(); - Adafruit_LvGL_Glue *_glue; + Adafruit_LvGL_Glue *_glue; ///< LVGL glue object void esp32_lvgl_acquire(); void esp32_lvgl_release(); + private: - - Adafruit_ST7789 *_tft_st7789 = nullptr; - uint16_t _displayWidth; - uint16_t _displayHeight; - uint8_t _displayRotationMode; + Adafruit_ST7789 *_tft_st7789 = nullptr; ///< Adafruit ST7789 display driver + uint16_t _displayWidth; ///< Display width + uint16_t _displayHeight; ///< Display height + uint8_t + _displayRotationMode; ///< Display rotation (mode, not number in degrees) }; extern Wippersnapper WS; diff --git a/src/display/ws_display_tooltips.h b/src/display/ws_display_tooltips.h index 4756dbe62..afe01454f 100644 --- a/src/display/ws_display_tooltips.h +++ b/src/display/ws_display_tooltips.h @@ -1,5 +1,5 @@ /*! - * @file ws_loading_tooltips.h + * @file ws_display_tooltips.h * * Wippersnapper tooltips for the loading screen on a display * @@ -15,9 +15,14 @@ #ifndef WS_LOADING_TOOLTIPS_H #define WS_LOADING_TOOLTIPS_H -#define WS_LOADING_TIP_1 "Name components in IO using emojis to differentiate them!" -#define WS_LOADING_TIP_2 "WipperSnapper now supports TFT displays on some boards (more to come)." -#define WS_LOADING_TIP_3 "Getting throttle errors? Try reducing a sensor's polling time." -#define WS_LOADING_TIP_4 "\"Be quick, but don't hurry\" - John Wooden " +#define WS_LOADING_TIP_1 \ + "Name components in IO using emojis to differentiate them!" ///< Loading tip +#define WS_LOADING_TIP_2 \ + "WipperSnapper now supports TFT displays on some boards (more to come)." ///< Loading tip 2 +#define WS_LOADING_TIP_3 \ + "Getting throttle errors? Try reducing a sensor's polling time." ///< Loading + ///< tip 3 +#define WS_LOADING_TIP_4 \ + "\"Be quick, but don't hurry\" - John Wooden " ///< Loading tip 4 #endif // WS_LOADING_TOOLTIPS_H \ No newline at end of file diff --git a/src/display/ws_display_ui_helper.cpp b/src/display/ws_display_ui_helper.cpp index 6767cb57a..64699e54f 100644 --- a/src/display/ws_display_ui_helper.cpp +++ b/src/display/ws_display_ui_helper.cpp @@ -333,8 +333,8 @@ void ws_display_ui_helper::build_scr_monitor() { lv_obj_align(labelTurtleBar, LV_ALIGN_TOP_LEFT, 5, 5); // Add a label to hold console text - // TODO: Still having some overlap between the top console text and the - // status bar.. this should be fixed in the sim. first before release + // FUTURE TODO: Have 10px of overlap between the top console text and the + // status bar terminalLabel = lv_label_create(lv_scr_act()); lv_obj_align(terminalLabel, LV_ALIGN_BOTTOM_LEFT, 3, 0); lv_obj_set_width(terminalLabel, 230); From b7cd6ad776dc7d644ae786ec5520ba14c89a375b Mon Sep 17 00:00:00 2001 From: brentru Date: Thu, 22 Jun 2023 14:15:23 -0400 Subject: [PATCH 54/90] doxy2 --- library.properties | 4 +-- src/components/i2c/WipperSnapper_I2C.cpp | 14 ++++++---- src/display/ws_display_ui_helper.h | 33 ++++++++++++------------ 3 files changed, 27 insertions(+), 24 deletions(-) diff --git a/library.properties b/library.properties index cdf27faf3..6964c83b3 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=Adafruit WipperSnapper -version=1.0.0-beta.62 +version=1.0.0-beta.64 author=Adafruit maintainer=Adafruit sentence=Arduino client for Adafruit.io WipperSnapper @@ -7,4 +7,4 @@ paragraph=Arduino client for Adafruit.io WipperSnapper category=Communication url=https://github.com/adafruit/Adafruit_IO_Arduino architectures=* -depends=Adafruit NeoPixel, Adafruit SPIFlash, ArduinoJson, Adafruit DotStar, Adafruit SleepyDog Library, Adafruit TinyUSB Library, Adafruit AHTX0, Adafruit BME280 Library, Adafruit DPS310, Adafruit SCD30, Sensirion I2C SCD4x, Sensirion I2C SEN5X, arduino-sht, Adafruit Si7021 Library, Adafruit MQTT Library, Adafruit MCP9808 Library, Adafruit MCP9600 Library, Adafruit TSL2591 Library, Adafruit_VL53L0X, Adafruit PM25 AQI Sensor, Adafruit VEML7700 Library, Adafruit LC709203F, Adafruit seesaw Library, Adafruit BME680 Library, Adafruit MAX1704X, Adafruit ADT7410 Library +depends=Adafruit NeoPixel, Adafruit SPIFlash, ArduinoJson, Adafruit DotStar, Adafruit SleepyDog Library, Adafruit TinyUSB Library, Adafruit AHTX0, Adafruit BME280 Library, Adafruit DPS310, Adafruit SCD30, Sensirion I2C SCD4x, Sensirion I2C SEN5X, arduino-sht, Adafruit Si7021 Library, Adafruit MQTT Library, Adafruit MCP9808 Library, Adafruit MCP9600 Library, Adafruit TSL2591 Library, Adafruit_VL53L0X, Adafruit PM25 AQI Sensor, Adafruit VEML7700 Library, Adafruit LC709203F, Adafruit seesaw Library, Adafruit BME680 Library, Adafruit MAX1704X, Adafruit ADT7410 Library, Adafruit LittlevGL Glue Library diff --git a/src/components/i2c/WipperSnapper_I2C.cpp b/src/components/i2c/WipperSnapper_I2C.cpp index d7a2f1f68..0047b0c7f 100644 --- a/src/components/i2c/WipperSnapper_I2C.cpp +++ b/src/components/i2c/WipperSnapper_I2C.cpp @@ -573,20 +573,24 @@ void WipperSnapper_Component_I2C::fillEventMessage( msgi2cResponse->payload.resp_i2c_device_event.sensor_event_count++; } +/*******************************************************************************/ +/*! + @brief Displays a sensor event message on the TFT + @param msgi2cResponse + A pointer to an I2CResponse message. + @param sensorAddress + The unique I2C address of the sensor. +*/ +/*******************************************************************************/ void WipperSnapper_Component_I2C::displayDeviceEventMessage( wippersnapper_signal_v1_I2CResponse *msgi2cResponse, uint32_t sensorAddress) { pb_size_t numEvents = msgi2cResponse->payload.resp_i2c_device_event.sensor_event_count; - WS_DEBUG_PRINT("total sensor events: "); - WS_DEBUG_PRINTLN(numEvents); char buffer[100]; for (int i = 0; i < numEvents; i++) { - WS_DEBUG_PRINT("Sensor: "); - WS_DEBUG_PRINTLN(i); - float value = msgi2cResponse->payload.resp_i2c_device_event.sensor_event[i].value; diff --git a/src/display/ws_display_ui_helper.h b/src/display/ws_display_ui_helper.h index 8c88fee0c..bf26c7c4d 100644 --- a/src/display/ws_display_ui_helper.h +++ b/src/display/ws_display_ui_helper.h @@ -69,33 +69,33 @@ static lv_style_t styleTerminalLabel; /********************** * IMAGE DECLARE **********************/ -LV_FONT_DECLARE(errorTriangle); -LV_FONT_DECLARE(file); -LV_FONT_DECLARE(wifi_30px); -LV_FONT_DECLARE(cloud_30px); -LV_FONT_DECLARE(turtle_30px); -LV_FONT_DECLARE(turtle_16); -LV_FONT_DECLARE(circle_30px); +LV_FONT_DECLARE(errorTriangle); ///< Error triangle icon +LV_FONT_DECLARE(file); ///< File icon +LV_FONT_DECLARE(wifi_30px); ///< WiFi icon +LV_FONT_DECLARE(cloud_30px); ///< Cloud icon +LV_FONT_DECLARE(turtle_30px); ///< Turtle icon +LV_FONT_DECLARE(turtle_16); ///< Turtle icon /********************** * Timers **********************/ static lv_timer_t *timerLoadTips; +/// Icon names for use with set_load_bar_icon_complete() enum loadBarIcons { - loadBarIconFile, - loadBarIconWifi, - loadBarIconCloud, - loadBarIconTurtle, - loadBarIconCheckmark -}; ///< Icon names for use by set_load_bar_icon_complete + loadBarIconFile, ///< File icon + loadBarIconWifi, ///< WiFi icon + loadBarIconCloud, ///< Cloud icon + loadBarIconTurtle, ///< Turtle icon + loadBarIconCheckmark ///< Checkmark icon +}; static const char *loading_tips[4] = { WS_LOADING_TIP_1, WS_LOADING_TIP_2, WS_LOADING_TIP_3, WS_LOADING_TIP_4}; ///< Holds the loading "tips" -static char - terminalTextBuffer[MAX_CONSOLE_TEXT_LEN + - 1]; ///< Contains all text actively displayed on the terminal +static char terminalTextBuffer[MAX_CONSOLE_TEXT_LEN + + 1]; ///< Contains all text actively displayed on + ///< the terminal class ws_display_driver; @@ -125,6 +125,5 @@ class ws_display_ui_helper { ws_display_driver *_dispDriver = nullptr; void addToTerminal(const char *txt_in); bool _loadingState = false; - }; #endif // WS_DISPLAY_UI_HELPER_H From a0ea320ad25ea24f8fa076078b9ec6a2e8e63fdd Mon Sep 17 00:00:00 2001 From: brentru Date: Thu, 22 Jun 2023 14:22:41 -0400 Subject: [PATCH 55/90] guard around ws_display components --- src/Wippersnapper.h | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/Wippersnapper.h b/src/Wippersnapper.h index c22c5dd37..e3584cea1 100644 --- a/src/Wippersnapper.h +++ b/src/Wippersnapper.h @@ -34,10 +34,6 @@ #include "Wippersnapper_Boards.h" #include "components/statusLED/Wippersnapper_StatusLED.h" -// Display -#include "display/ws_display_driver.h" -#include "display/ws_display_ui_helper.h" - // Wippersnapper components #include "components/analogIO/Wippersnapper_AnalogIO.h" #include "components/digitalIO/Wippersnapper_DigitalGPIO.h" @@ -48,6 +44,12 @@ #include "components/ledc/ws_ledc.h" #endif +// Display +#ifdef USE_DISPLAY +#include "display/ws_display_driver.h" +#include "display/ws_display_ui_helper.h" +#endif + #include "components/ds18x20/ws_ds18x20.h" #include "components/pixels/ws_pixels.h" #include "components/pwm/ws_pwm.h" @@ -196,12 +198,14 @@ class Wippersnapper_DigitalGPIO; class Wippersnapper_AnalogIO; class Wippersnapper_FS; class WipperSnapper_LittleFS; +#ifdef USE_DISPLAY class ws_display_driver; class ws_display_ui_helper; -class WipperSnapper_Component_I2C; +#endif #ifdef ARDUINO_ARCH_ESP32 class ws_ledc; #endif +class WipperSnapper_Component_I2C; class ws_servo; class ws_pwm; class ws_ds18x20; @@ -317,8 +321,10 @@ class Wippersnapper { Wippersnapper_FS *_fileSystem; ///< Instance of Filesystem (native USB) WipperSnapper_LittleFS *_littleFS; ///< Instance of LittleFS Filesystem (non-native USB) + #ifdef USE_DISPLAY ws_display_driver *_display = nullptr; ///< Instance of display driver class ws_display_ui_helper *_ui_helper = nullptr; ///< Instance of display UI helper class + #endif ws_pixels *_ws_pixelsComponent; ///< ptr to instance of ws_pixels class ws_pwm *_pwmComponent; ///< Instance of pwm class ws_servo *_servoComponent; ///< Instance of servo class From c39c1c24504eb3c882907e88634ea594120874d1 Mon Sep 17 00:00:00 2001 From: brentru Date: Thu, 22 Jun 2023 14:27:01 -0400 Subject: [PATCH 56/90] fix inclusion? --- src/display/symbols/cloud_30px.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/display/symbols/cloud_30px.c b/src/display/symbols/cloud_30px.c index 2341772bd..afbd64a0f 100644 --- a/src/display/symbols/cloud_30px.c +++ b/src/display/symbols/cloud_30px.c @@ -7,7 +7,8 @@ #ifdef LV_LVGL_H_INCLUDE_SIMPLE #include "lvgl.h" #else -#include +// #include +#include "lvgl/lvgl.h" #endif #ifndef CLOUD_30PX From bac763026a07b5582b0b80b8377e51c4332b1f6f Mon Sep 17 00:00:00 2001 From: brentru Date: Thu, 22 Jun 2023 14:31:57 -0400 Subject: [PATCH 57/90] move files --- src/display/{symbols => }/cloud_30px.c | 3 +-- src/display/{symbols => }/errorTriangle.c | 0 src/display/{symbols => }/file.c | 0 src/display/{symbols => }/turtle_16.c | 0 src/display/{symbols => }/turtle_30px.c | 0 src/display/{symbols => }/wifi_30px.c | 0 6 files changed, 1 insertion(+), 2 deletions(-) rename src/display/{symbols => }/cloud_30px.c (99%) rename src/display/{symbols => }/errorTriangle.c (100%) rename src/display/{symbols => }/file.c (100%) rename src/display/{symbols => }/turtle_16.c (100%) rename src/display/{symbols => }/turtle_30px.c (100%) rename src/display/{symbols => }/wifi_30px.c (100%) diff --git a/src/display/symbols/cloud_30px.c b/src/display/cloud_30px.c similarity index 99% rename from src/display/symbols/cloud_30px.c rename to src/display/cloud_30px.c index afbd64a0f..2341772bd 100644 --- a/src/display/symbols/cloud_30px.c +++ b/src/display/cloud_30px.c @@ -7,8 +7,7 @@ #ifdef LV_LVGL_H_INCLUDE_SIMPLE #include "lvgl.h" #else -// #include -#include "lvgl/lvgl.h" +#include #endif #ifndef CLOUD_30PX diff --git a/src/display/symbols/errorTriangle.c b/src/display/errorTriangle.c similarity index 100% rename from src/display/symbols/errorTriangle.c rename to src/display/errorTriangle.c diff --git a/src/display/symbols/file.c b/src/display/file.c similarity index 100% rename from src/display/symbols/file.c rename to src/display/file.c diff --git a/src/display/symbols/turtle_16.c b/src/display/turtle_16.c similarity index 100% rename from src/display/symbols/turtle_16.c rename to src/display/turtle_16.c diff --git a/src/display/symbols/turtle_30px.c b/src/display/turtle_30px.c similarity index 100% rename from src/display/symbols/turtle_30px.c rename to src/display/turtle_30px.c diff --git a/src/display/symbols/wifi_30px.c b/src/display/wifi_30px.c similarity index 100% rename from src/display/symbols/wifi_30px.c rename to src/display/wifi_30px.c From 28396cda64ab5a776cab10d76af723fd75beddb5 Mon Sep 17 00:00:00 2001 From: brentru Date: Thu, 22 Jun 2023 14:47:33 -0400 Subject: [PATCH 58/90] workflow for copying lv_conf file --- .github/workflows/build-clang-doxy.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build-clang-doxy.yml b/.github/workflows/build-clang-doxy.yml index 97ab1bfc5..1a0862e4e 100644 --- a/.github/workflows/build-clang-doxy.yml +++ b/.github/workflows/build-clang-doxy.yml @@ -44,6 +44,9 @@ jobs: git clone --quiet https://github.com/brentru/Adafruit_MQTT_Library.git /home/runner/Arduino/libraries/Adafruit_MQTT_Library git clone --quiet https://github.com/milesburton/Arduino-Temperature-Control-Library.git /home/runner/Arduino/libraries/Arduino-Temperature-Control-Library git clone --quiet https://github.com/PaulStoffregen/OneWire.git /home/runner/Arduino/libraries/OneWire + - name: Copy lv_conf.h file in Adafruit_LittlevGL_Glue_Library to the arduino library folder + run: | + cp /home/runner/Arduino/libraries/Adafruit_LittlevGL_Glue_Library/lv_conf.h /home/runner/Arduino/libraries - name: Build for ESP32-Sx run: python3 ci/build_platform.py ${{ matrix.arduino-platform }} - name: list From a779caf26464e5957e28d4402b56cb3a3f1e29ba Mon Sep 17 00:00:00 2001 From: brentru Date: Thu, 22 Jun 2023 14:49:36 -0400 Subject: [PATCH 59/90] list out! --- .github/workflows/build-clang-doxy.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build-clang-doxy.yml b/.github/workflows/build-clang-doxy.yml index 1a0862e4e..7d45126b0 100644 --- a/.github/workflows/build-clang-doxy.yml +++ b/.github/workflows/build-clang-doxy.yml @@ -44,6 +44,9 @@ jobs: git clone --quiet https://github.com/brentru/Adafruit_MQTT_Library.git /home/runner/Arduino/libraries/Adafruit_MQTT_Library git clone --quiet https://github.com/milesburton/Arduino-Temperature-Control-Library.git /home/runner/Arduino/libraries/Arduino-Temperature-Control-Library git clone --quiet https://github.com/PaulStoffregen/OneWire.git /home/runner/Arduino/libraries/OneWire + - name: List all files in Adafruit_LittlevGL_Glue_Library folder + run: | + ls /home/runner/Arduino/libraries/Adafruit_LittlevGL_Glue_Library - name: Copy lv_conf.h file in Adafruit_LittlevGL_Glue_Library to the arduino library folder run: | cp /home/runner/Arduino/libraries/Adafruit_LittlevGL_Glue_Library/lv_conf.h /home/runner/Arduino/libraries From c3bfea8903a2092160954153e150949bab7e1f78 Mon Sep 17 00:00:00 2001 From: brentru Date: Thu, 22 Jun 2023 14:52:53 -0400 Subject: [PATCH 60/90] manually build out lvgl_glue instead of lib. prop --- .github/workflows/build-clang-doxy.yml | 1 + library.properties | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-clang-doxy.yml b/.github/workflows/build-clang-doxy.yml index 7d45126b0..b954d871c 100644 --- a/.github/workflows/build-clang-doxy.yml +++ b/.github/workflows/build-clang-doxy.yml @@ -44,6 +44,7 @@ jobs: git clone --quiet https://github.com/brentru/Adafruit_MQTT_Library.git /home/runner/Arduino/libraries/Adafruit_MQTT_Library git clone --quiet https://github.com/milesburton/Arduino-Temperature-Control-Library.git /home/runner/Arduino/libraries/Arduino-Temperature-Control-Library git clone --quiet https://github.com/PaulStoffregen/OneWire.git /home/runner/Arduino/libraries/OneWire + git clone --quiet https://github.com/adafruit/Adafruit_LvGL_Glue.git /home/runner/Arduino/libraries/Adafruit_LittlevGL_Glue_Library - name: List all files in Adafruit_LittlevGL_Glue_Library folder run: | ls /home/runner/Arduino/libraries/Adafruit_LittlevGL_Glue_Library diff --git a/library.properties b/library.properties index 6964c83b3..1927560e4 100644 --- a/library.properties +++ b/library.properties @@ -7,4 +7,4 @@ paragraph=Arduino client for Adafruit.io WipperSnapper category=Communication url=https://github.com/adafruit/Adafruit_IO_Arduino architectures=* -depends=Adafruit NeoPixel, Adafruit SPIFlash, ArduinoJson, Adafruit DotStar, Adafruit SleepyDog Library, Adafruit TinyUSB Library, Adafruit AHTX0, Adafruit BME280 Library, Adafruit DPS310, Adafruit SCD30, Sensirion I2C SCD4x, Sensirion I2C SEN5X, arduino-sht, Adafruit Si7021 Library, Adafruit MQTT Library, Adafruit MCP9808 Library, Adafruit MCP9600 Library, Adafruit TSL2591 Library, Adafruit_VL53L0X, Adafruit PM25 AQI Sensor, Adafruit VEML7700 Library, Adafruit LC709203F, Adafruit seesaw Library, Adafruit BME680 Library, Adafruit MAX1704X, Adafruit ADT7410 Library, Adafruit LittlevGL Glue Library +depends=Adafruit NeoPixel, Adafruit SPIFlash, ArduinoJson, Adafruit DotStar, Adafruit SleepyDog Library, Adafruit TinyUSB Library, Adafruit AHTX0, Adafruit BME280 Library, Adafruit DPS310, Adafruit SCD30, Sensirion I2C SCD4x, Sensirion I2C SEN5X, arduino-sht, Adafruit Si7021 Library, Adafruit MQTT Library, Adafruit MCP9808 Library, Adafruit MCP9600 Library, Adafruit TSL2591 Library, Adafruit_VL53L0X, Adafruit PM25 AQI Sensor, Adafruit VEML7700 Library, Adafruit LC709203F, Adafruit seesaw Library, Adafruit BME680 Library, Adafruit MAX1704X, Adafruit ADT7410 Library From 1e044c08f257a5eeff15d67786fd2eca359bea7d Mon Sep 17 00:00:00 2001 From: brentru Date: Thu, 22 Jun 2023 15:34:02 -0400 Subject: [PATCH 61/90] add deps --- .github/workflows/build-clang-doxy.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build-clang-doxy.yml b/.github/workflows/build-clang-doxy.yml index b954d871c..984c0a432 100644 --- a/.github/workflows/build-clang-doxy.yml +++ b/.github/workflows/build-clang-doxy.yml @@ -45,6 +45,8 @@ jobs: git clone --quiet https://github.com/milesburton/Arduino-Temperature-Control-Library.git /home/runner/Arduino/libraries/Arduino-Temperature-Control-Library git clone --quiet https://github.com/PaulStoffregen/OneWire.git /home/runner/Arduino/libraries/OneWire git clone --quiet https://github.com/adafruit/Adafruit_LvGL_Glue.git /home/runner/Arduino/libraries/Adafruit_LittlevGL_Glue_Library + git clone --quiet https://github.com/adafruit/Adafruit_HX8357_Library.git /home/runner/Arduino/libraries/Adafruit_HX8357_Library + git clone --quiet https://github.com/adafruit/Adafruit_ILI9341.git /home/runner/Arduino/libraries/Adafruit_ILI9341 - name: List all files in Adafruit_LittlevGL_Glue_Library folder run: | ls /home/runner/Arduino/libraries/Adafruit_LittlevGL_Glue_Library From 8041875004a3709b46ec200ee92d0452a226c6f2 Mon Sep 17 00:00:00 2001 From: brentru Date: Thu, 22 Jun 2023 15:36:59 -0400 Subject: [PATCH 62/90] add stmpe --- .github/workflows/build-clang-doxy.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-clang-doxy.yml b/.github/workflows/build-clang-doxy.yml index 984c0a432..4d2869704 100644 --- a/.github/workflows/build-clang-doxy.yml +++ b/.github/workflows/build-clang-doxy.yml @@ -47,6 +47,7 @@ jobs: git clone --quiet https://github.com/adafruit/Adafruit_LvGL_Glue.git /home/runner/Arduino/libraries/Adafruit_LittlevGL_Glue_Library git clone --quiet https://github.com/adafruit/Adafruit_HX8357_Library.git /home/runner/Arduino/libraries/Adafruit_HX8357_Library git clone --quiet https://github.com/adafruit/Adafruit_ILI9341.git /home/runner/Arduino/libraries/Adafruit_ILI9341 + git clone --quiet https://github.com/adafruit/Adafruit_STMPE610.git /home/runner/Arduino/libraries/Adafruit_STMPE610 - name: List all files in Adafruit_LittlevGL_Glue_Library folder run: | ls /home/runner/Arduino/libraries/Adafruit_LittlevGL_Glue_Library From d72411293812b63bcef009f6de4e65b6b86f413d Mon Sep 17 00:00:00 2001 From: brentru Date: Thu, 22 Jun 2023 15:38:00 -0400 Subject: [PATCH 63/90] add dep2 --- .github/workflows/build-clang-doxy.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-clang-doxy.yml b/.github/workflows/build-clang-doxy.yml index 4d2869704..73cd88b3b 100644 --- a/.github/workflows/build-clang-doxy.yml +++ b/.github/workflows/build-clang-doxy.yml @@ -48,6 +48,7 @@ jobs: git clone --quiet https://github.com/adafruit/Adafruit_HX8357_Library.git /home/runner/Arduino/libraries/Adafruit_HX8357_Library git clone --quiet https://github.com/adafruit/Adafruit_ILI9341.git /home/runner/Arduino/libraries/Adafruit_ILI9341 git clone --quiet https://github.com/adafruit/Adafruit_STMPE610.git /home/runner/Arduino/libraries/Adafruit_STMPE610 + git clone --quiet https://github.com/adafruit/Adafruit-ST7735-Library.git /home/runner/Arduino/libraries/Adafruit-ST7735-Library - name: List all files in Adafruit_LittlevGL_Glue_Library folder run: | ls /home/runner/Arduino/libraries/Adafruit_LittlevGL_Glue_Library From ce8a07c4ac3233ec781c1d355e80b8a6a278ed15 Mon Sep 17 00:00:00 2001 From: brentru Date: Thu, 22 Jun 2023 15:44:39 -0400 Subject: [PATCH 64/90] clone lvgl --- .github/workflows/build-clang-doxy.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build-clang-doxy.yml b/.github/workflows/build-clang-doxy.yml index 73cd88b3b..2c9faa4ab 100644 --- a/.github/workflows/build-clang-doxy.yml +++ b/.github/workflows/build-clang-doxy.yml @@ -49,6 +49,9 @@ jobs: git clone --quiet https://github.com/adafruit/Adafruit_ILI9341.git /home/runner/Arduino/libraries/Adafruit_ILI9341 git clone --quiet https://github.com/adafruit/Adafruit_STMPE610.git /home/runner/Arduino/libraries/Adafruit_STMPE610 git clone --quiet https://github.com/adafruit/Adafruit-ST7735-Library.git /home/runner/Arduino/libraries/Adafruit-ST7735-Library + git clone --quiet https://github.com/adafruit/https://github.com/adafruit/Adafruit_TouchScreen.git /home/runner/Arduino/libraries/Adafruit_TouchScreen + git clone --depth 1 --branch v8/2.0 https://github.com/lvgl/lvgl.git /home/runner/Arduino/libraries/lvgl + - name: List all files in Adafruit_LittlevGL_Glue_Library folder run: | ls /home/runner/Arduino/libraries/Adafruit_LittlevGL_Glue_Library From 6d4ed52826b48422ec52590d3b5d1339fb86da43 Mon Sep 17 00:00:00 2001 From: brentru Date: Thu, 22 Jun 2023 15:45:56 -0400 Subject: [PATCH 65/90] 8.2 --- .github/workflows/build-clang-doxy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-clang-doxy.yml b/.github/workflows/build-clang-doxy.yml index 2c9faa4ab..d483fc1a0 100644 --- a/.github/workflows/build-clang-doxy.yml +++ b/.github/workflows/build-clang-doxy.yml @@ -50,7 +50,7 @@ jobs: git clone --quiet https://github.com/adafruit/Adafruit_STMPE610.git /home/runner/Arduino/libraries/Adafruit_STMPE610 git clone --quiet https://github.com/adafruit/Adafruit-ST7735-Library.git /home/runner/Arduino/libraries/Adafruit-ST7735-Library git clone --quiet https://github.com/adafruit/https://github.com/adafruit/Adafruit_TouchScreen.git /home/runner/Arduino/libraries/Adafruit_TouchScreen - git clone --depth 1 --branch v8/2.0 https://github.com/lvgl/lvgl.git /home/runner/Arduino/libraries/lvgl + git clone --depth 1 --branch v8.2.0 https://github.com/lvgl/lvgl.git /home/runner/Arduino/libraries/lvgl - name: List all files in Adafruit_LittlevGL_Glue_Library folder run: | From 0e71b8de3c0c4ca0ec61dea393404b21a7466ee7 Mon Sep 17 00:00:00 2001 From: brentru Date: Thu, 22 Jun 2023 15:46:28 -0400 Subject: [PATCH 66/90] fix touchscreen --- .github/workflows/build-clang-doxy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-clang-doxy.yml b/.github/workflows/build-clang-doxy.yml index d483fc1a0..b304774b0 100644 --- a/.github/workflows/build-clang-doxy.yml +++ b/.github/workflows/build-clang-doxy.yml @@ -49,7 +49,7 @@ jobs: git clone --quiet https://github.com/adafruit/Adafruit_ILI9341.git /home/runner/Arduino/libraries/Adafruit_ILI9341 git clone --quiet https://github.com/adafruit/Adafruit_STMPE610.git /home/runner/Arduino/libraries/Adafruit_STMPE610 git clone --quiet https://github.com/adafruit/Adafruit-ST7735-Library.git /home/runner/Arduino/libraries/Adafruit-ST7735-Library - git clone --quiet https://github.com/adafruit/https://github.com/adafruit/Adafruit_TouchScreen.git /home/runner/Arduino/libraries/Adafruit_TouchScreen + git clone --quiet https://github.com/adafruit/Adafruit_TouchScreen.git /home/runner/Arduino/libraries/Adafruit_TouchScreen git clone --depth 1 --branch v8.2.0 https://github.com/lvgl/lvgl.git /home/runner/Arduino/libraries/lvgl - name: List all files in Adafruit_LittlevGL_Glue_Library folder From 0668c4b65f4166395a03dc7b61d1c135f2d975ed Mon Sep 17 00:00:00 2001 From: brentru Date: Thu, 22 Jun 2023 16:09:45 -0400 Subject: [PATCH 67/90] static within .cpp --- src/display/ws_display_ui_helper.cpp | 33 ++++++++++++++++++++++++++++ src/display/ws_display_ui_helper.h | 32 --------------------------- 2 files changed, 33 insertions(+), 32 deletions(-) diff --git a/src/display/ws_display_ui_helper.cpp b/src/display/ws_display_ui_helper.cpp index 64699e54f..5214421aa 100644 --- a/src/display/ws_display_ui_helper.cpp +++ b/src/display/ws_display_ui_helper.cpp @@ -15,6 +15,39 @@ #include "ws_display_ui_helper.h" +/********************** + * STATIC VARIABLES + **********************/ +/* Loading screen */ +static lv_obj_t *imgWSLogo; +static lv_obj_t *lblIconFile; +static lv_obj_t *lblIconWiFi; +static lv_obj_t *labelTurtleBar; +static lv_obj_t *labelCloudBar; +static lv_obj_t *lblStatusText; +static lv_obj_t *lblTipText; +static lv_style_t styleIconFile; +static lv_style_t styleIconWiFi; +static lv_style_t styleIconTurtleStatusbar; +static lv_style_t styleIconCloud; +static lv_style_t styleIconCheckmark; + +/* Error screen */ +static lv_obj_t *labelErrorTriangle; +static lv_obj_t *labelErrorHeader; +static lv_obj_t *labelErrorBody; +static lv_style_t styleErrorTriangle; +static lv_style_t styleLabelErrorLarge; +static lv_style_t styleLabelErrorSmall; + +/* Monitor screen */ +static lv_obj_t *canvasStatusBar; +static lv_draw_rect_dsc_t *rect_dsc; +static lv_obj_t *statusbar_icon_bat; +static lv_obj_t *statusbar_icon_wifi; +static lv_obj_t *terminalLabel; +static lv_style_t styleTerminalLabel; + /**************************************************************************/ /*! @brief Changes a label every 2 seconds to a new, random, tip. diff --git a/src/display/ws_display_ui_helper.h b/src/display/ws_display_ui_helper.h index bf26c7c4d..798520ab9 100644 --- a/src/display/ws_display_ui_helper.h +++ b/src/display/ws_display_ui_helper.h @@ -33,38 +33,6 @@ #define SYMBOL_ERROR_TRIANGLE \ "\xEF\x81\xB1" ///< Symbol code for error triangle icon -/********************** - * STATIC VARIABLES - **********************/ -/* Loading screen */ -static lv_obj_t *imgWSLogo; -static lv_obj_t *lblIconFile; -static lv_obj_t *lblIconWiFi; -static lv_obj_t *labelTurtleBar; -static lv_obj_t *labelCloudBar; -static lv_obj_t *lblStatusText; -static lv_obj_t *lblTipText; -static lv_style_t styleIconFile; -static lv_style_t styleIconWiFi; -static lv_style_t styleIconTurtleStatusbar; -static lv_style_t styleIconCloud; -static lv_style_t styleIconCheckmark; - -/* Error screen */ -static lv_obj_t *labelErrorTriangle; -static lv_obj_t *labelErrorHeader; -static lv_obj_t *labelErrorBody; -static lv_style_t styleErrorTriangle; -static lv_style_t styleLabelErrorLarge; -static lv_style_t styleLabelErrorSmall; - -/* Monitor screen */ -static lv_obj_t *canvasStatusBar; -static lv_draw_rect_dsc_t *rect_dsc; -static lv_obj_t *statusbar_icon_bat; -static lv_obj_t *statusbar_icon_wifi; -static lv_obj_t *terminalLabel; -static lv_style_t styleTerminalLabel; /********************** * IMAGE DECLARE From 26709dc7c581f17b9bc65142b7c3fafdecf3548b Mon Sep 17 00:00:00 2001 From: brentru Date: Thu, 22 Jun 2023 16:16:07 -0400 Subject: [PATCH 68/90] static timer --- src/display/ws_display_ui_helper.cpp | 5 +++++ src/display/ws_display_ui_helper.h | 5 ----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/display/ws_display_ui_helper.cpp b/src/display/ws_display_ui_helper.cpp index 5214421aa..a0e0ce577 100644 --- a/src/display/ws_display_ui_helper.cpp +++ b/src/display/ws_display_ui_helper.cpp @@ -48,6 +48,11 @@ static lv_obj_t *statusbar_icon_wifi; static lv_obj_t *terminalLabel; static lv_style_t styleTerminalLabel; +/********************** + * Timers + **********************/ +static lv_timer_t *timerLoadTips; + /**************************************************************************/ /*! @brief Changes a label every 2 seconds to a new, random, tip. diff --git a/src/display/ws_display_ui_helper.h b/src/display/ws_display_ui_helper.h index 798520ab9..7649d5b54 100644 --- a/src/display/ws_display_ui_helper.h +++ b/src/display/ws_display_ui_helper.h @@ -44,11 +44,6 @@ LV_FONT_DECLARE(cloud_30px); ///< Cloud icon LV_FONT_DECLARE(turtle_30px); ///< Turtle icon LV_FONT_DECLARE(turtle_16); ///< Turtle icon -/********************** - * Timers - **********************/ -static lv_timer_t *timerLoadTips; - /// Icon names for use with set_load_bar_icon_complete() enum loadBarIcons { loadBarIconFile, ///< File icon From 7239f79d19b36b758dd4645bf5134c2792355c4c Mon Sep 17 00:00:00 2001 From: brentru Date: Thu, 22 Jun 2023 16:24:14 -0400 Subject: [PATCH 69/90] move text buffer out --- src/display/ws_display_ui_helper.cpp | 4 ++++ src/display/ws_display_ui_helper.h | 4 ---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/display/ws_display_ui_helper.cpp b/src/display/ws_display_ui_helper.cpp index a0e0ce577..2e81a765e 100644 --- a/src/display/ws_display_ui_helper.cpp +++ b/src/display/ws_display_ui_helper.cpp @@ -53,6 +53,10 @@ static lv_style_t styleTerminalLabel; **********************/ static lv_timer_t *timerLoadTips; +static char terminalTextBuffer[MAX_CONSOLE_TEXT_LEN + + 1]; ///< Contains all text actively displayed on + ///< the terminal screen + /**************************************************************************/ /*! @brief Changes a label every 2 seconds to a new, random, tip. diff --git a/src/display/ws_display_ui_helper.h b/src/display/ws_display_ui_helper.h index 7649d5b54..03e2ea341 100644 --- a/src/display/ws_display_ui_helper.h +++ b/src/display/ws_display_ui_helper.h @@ -33,7 +33,6 @@ #define SYMBOL_ERROR_TRIANGLE \ "\xEF\x81\xB1" ///< Symbol code for error triangle icon - /********************** * IMAGE DECLARE **********************/ @@ -56,9 +55,6 @@ enum loadBarIcons { static const char *loading_tips[4] = { WS_LOADING_TIP_1, WS_LOADING_TIP_2, WS_LOADING_TIP_3, WS_LOADING_TIP_4}; ///< Holds the loading "tips" -static char terminalTextBuffer[MAX_CONSOLE_TEXT_LEN + - 1]; ///< Contains all text actively displayed on - ///< the terminal class ws_display_driver; From 91a2cf67b455ce0593496e25a0886a406f704f82 Mon Sep 17 00:00:00 2001 From: brentru Date: Thu, 22 Jun 2023 16:25:34 -0400 Subject: [PATCH 70/90] move tips in --- src/display/ws_display_ui_helper.cpp | 4 ++++ src/display/ws_display_ui_helper.h | 4 +--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/display/ws_display_ui_helper.cpp b/src/display/ws_display_ui_helper.cpp index 2e81a765e..40a832e90 100644 --- a/src/display/ws_display_ui_helper.cpp +++ b/src/display/ws_display_ui_helper.cpp @@ -57,6 +57,10 @@ static char terminalTextBuffer[MAX_CONSOLE_TEXT_LEN + 1]; ///< Contains all text actively displayed on ///< the terminal screen +static const char *loading_tips[4] = { + WS_LOADING_TIP_1, WS_LOADING_TIP_2, WS_LOADING_TIP_3, + WS_LOADING_TIP_4}; ///< Holds the loading "tips" + /**************************************************************************/ /*! @brief Changes a label every 2 seconds to a new, random, tip. diff --git a/src/display/ws_display_ui_helper.h b/src/display/ws_display_ui_helper.h index 03e2ea341..afbb8c4cb 100644 --- a/src/display/ws_display_ui_helper.h +++ b/src/display/ws_display_ui_helper.h @@ -52,9 +52,7 @@ enum loadBarIcons { loadBarIconCheckmark ///< Checkmark icon }; -static const char *loading_tips[4] = { - WS_LOADING_TIP_1, WS_LOADING_TIP_2, WS_LOADING_TIP_3, - WS_LOADING_TIP_4}; ///< Holds the loading "tips" + class ws_display_driver; From 73a95bb7a41753f782341bfa20bc3b0b206b9cb9 Mon Sep 17 00:00:00 2001 From: brentru Date: Thu, 22 Jun 2023 16:50:34 -0400 Subject: [PATCH 71/90] fix printf errors --- src/Wippersnapper.cpp | 4 ++-- src/components/digitalIO/Wippersnapper_DigitalGPIO.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Wippersnapper.cpp b/src/Wippersnapper.cpp index 2b0e8b8f8..9615150a5 100644 --- a/src/Wippersnapper.cpp +++ b/src/Wippersnapper.cpp @@ -1227,9 +1227,9 @@ bool cbPWMDecodeMsg(pb_istream_t *stream, const pb_field_t *field, void **arg) { #ifdef USE_DISPLAY char buffer[100]; - snprintf(buffer, 100, "[PWM] Writing duty cycle %d % to pin %s\n.", + snprintf(buffer, 100, "[PWM] Writing duty cycle %d % to pin %D\n.", (int)msgPWMWriteDutyCycleRequest.duty_cycle, - msgPWMWriteDutyCycleRequest.pin); + atoi(pwmPin)); WS._ui_helper->add_text_to_terminal(buffer); #endif diff --git a/src/components/digitalIO/Wippersnapper_DigitalGPIO.cpp b/src/components/digitalIO/Wippersnapper_DigitalGPIO.cpp index 5d9397bcc..2e6689de3 100644 --- a/src/components/digitalIO/Wippersnapper_DigitalGPIO.cpp +++ b/src/components/digitalIO/Wippersnapper_DigitalGPIO.cpp @@ -112,7 +112,7 @@ void Wippersnapper_DigitalGPIO::initDigitalPin( #ifdef USE_DISPLAY char buffer[100]; snprintf(buffer, 100, - "[Pin] Configured Digital Input on D%u, polling every %lmS\n", + "[Pin] Configured Digital Input on D%u, polling every %l mS\n", pinName, periodMs); WS._ui_helper->add_text_to_terminal(buffer); #endif From f2fe7e79c1f7a74ef18c159d69801aa6e749b2bf Mon Sep 17 00:00:00 2001 From: brentru Date: Fri, 23 Jun 2023 13:21:44 -0400 Subject: [PATCH 72/90] printf 2 --- src/Wippersnapper.cpp | 2 +- src/components/digitalIO/Wippersnapper_DigitalGPIO.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Wippersnapper.cpp b/src/Wippersnapper.cpp index 9615150a5..605e46765 100644 --- a/src/Wippersnapper.cpp +++ b/src/Wippersnapper.cpp @@ -1227,7 +1227,7 @@ bool cbPWMDecodeMsg(pb_istream_t *stream, const pb_field_t *field, void **arg) { #ifdef USE_DISPLAY char buffer[100]; - snprintf(buffer, 100, "[PWM] Writing duty cycle %d % to pin %D\n.", + snprintf(buffer, 100, "[PWM] Writing duty cycle %d to pin %d\n.", (int)msgPWMWriteDutyCycleRequest.duty_cycle, atoi(pwmPin)); WS._ui_helper->add_text_to_terminal(buffer); diff --git a/src/components/digitalIO/Wippersnapper_DigitalGPIO.cpp b/src/components/digitalIO/Wippersnapper_DigitalGPIO.cpp index 2e6689de3..3c063a487 100644 --- a/src/components/digitalIO/Wippersnapper_DigitalGPIO.cpp +++ b/src/components/digitalIO/Wippersnapper_DigitalGPIO.cpp @@ -112,7 +112,7 @@ void Wippersnapper_DigitalGPIO::initDigitalPin( #ifdef USE_DISPLAY char buffer[100]; snprintf(buffer, 100, - "[Pin] Configured Digital Input on D%u, polling every %l mS\n", + "[Pin] Configured Digital Input on D%u, polling every %lu mS\n", pinName, periodMs); WS._ui_helper->add_text_to_terminal(buffer); #endif From 4d60680a0dc7b4d2c850ebc0aea0715a6101ea32 Mon Sep 17 00:00:00 2001 From: brentru Date: Fri, 23 Jun 2023 13:31:03 -0400 Subject: [PATCH 73/90] use lv_conf.h from brentru/ dev branch --- .github/workflows/build-clang-doxy.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/build-clang-doxy.yml b/.github/workflows/build-clang-doxy.yml index b304774b0..bad05e28e 100644 --- a/.github/workflows/build-clang-doxy.yml +++ b/.github/workflows/build-clang-doxy.yml @@ -44,14 +44,13 @@ jobs: git clone --quiet https://github.com/brentru/Adafruit_MQTT_Library.git /home/runner/Arduino/libraries/Adafruit_MQTT_Library git clone --quiet https://github.com/milesburton/Arduino-Temperature-Control-Library.git /home/runner/Arduino/libraries/Arduino-Temperature-Control-Library git clone --quiet https://github.com/PaulStoffregen/OneWire.git /home/runner/Arduino/libraries/OneWire - git clone --quiet https://github.com/adafruit/Adafruit_LvGL_Glue.git /home/runner/Arduino/libraries/Adafruit_LittlevGL_Glue_Library git clone --quiet https://github.com/adafruit/Adafruit_HX8357_Library.git /home/runner/Arduino/libraries/Adafruit_HX8357_Library git clone --quiet https://github.com/adafruit/Adafruit_ILI9341.git /home/runner/Arduino/libraries/Adafruit_ILI9341 git clone --quiet https://github.com/adafruit/Adafruit_STMPE610.git /home/runner/Arduino/libraries/Adafruit_STMPE610 git clone --quiet https://github.com/adafruit/Adafruit-ST7735-Library.git /home/runner/Arduino/libraries/Adafruit-ST7735-Library git clone --quiet https://github.com/adafruit/Adafruit_TouchScreen.git /home/runner/Arduino/libraries/Adafruit_TouchScreen git clone --depth 1 --branch v8.2.0 https://github.com/lvgl/lvgl.git /home/runner/Arduino/libraries/lvgl - + git clone --depth 1 --branch development https://github.com/brentru/Adafruit_LvGL_Glue.git /home/runner/Arduino/libraries/Adafruit_LittlevGL_Glue_Library - name: List all files in Adafruit_LittlevGL_Glue_Library folder run: | ls /home/runner/Arduino/libraries/Adafruit_LittlevGL_Glue_Library From aef9428923dfe161a21811134d4f4ebcd70608ad Mon Sep 17 00:00:00 2001 From: brentru Date: Fri, 23 Jun 2023 13:47:58 -0400 Subject: [PATCH 74/90] remove unused variables --- src/display/ws_display_ui_helper.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/display/ws_display_ui_helper.cpp b/src/display/ws_display_ui_helper.cpp index 40a832e90..6ff821e7a 100644 --- a/src/display/ws_display_ui_helper.cpp +++ b/src/display/ws_display_ui_helper.cpp @@ -19,7 +19,6 @@ * STATIC VARIABLES **********************/ /* Loading screen */ -static lv_obj_t *imgWSLogo; static lv_obj_t *lblIconFile; static lv_obj_t *lblIconWiFi; static lv_obj_t *labelTurtleBar; @@ -30,7 +29,6 @@ static lv_style_t styleIconFile; static lv_style_t styleIconWiFi; static lv_style_t styleIconTurtleStatusbar; static lv_style_t styleIconCloud; -static lv_style_t styleIconCheckmark; /* Error screen */ static lv_obj_t *labelErrorTriangle; @@ -41,8 +39,6 @@ static lv_style_t styleLabelErrorLarge; static lv_style_t styleLabelErrorSmall; /* Monitor screen */ -static lv_obj_t *canvasStatusBar; -static lv_draw_rect_dsc_t *rect_dsc; static lv_obj_t *statusbar_icon_bat; static lv_obj_t *statusbar_icon_wifi; static lv_obj_t *terminalLabel; From 144a13334a3a962fd2e7cddad87e4c0612037a25 Mon Sep 17 00:00:00 2001 From: brentru Date: Fri, 23 Jun 2023 13:53:14 -0400 Subject: [PATCH 75/90] remove my_log_cb --- src/display/ws_display_driver.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/display/ws_display_driver.cpp b/src/display/ws_display_driver.cpp index 9619be5c7..0e9a285c8 100644 --- a/src/display/ws_display_driver.cpp +++ b/src/display/ws_display_driver.cpp @@ -21,7 +21,7 @@ Data to write out to serial. */ /**************************************************************************/ -static void my_log_cb(const char *buf) { WS_DEBUG_PRINTLN(buf); } +// static void my_log_cb(const char *buf) { WS_DEBUG_PRINTLN(buf); } /**************************************************************************/ /*! From 10d8c9c4e884d2443cceb02c84d269468de908c5 Mon Sep 17 00:00:00 2001 From: brentru Date: Fri, 23 Jun 2023 15:48:46 -0400 Subject: [PATCH 76/90] fix for non-fh target --- src/display/cloud_30px.c | 3 +++ src/display/errorTriangle.c | 3 ++- src/display/file.c | 3 ++- src/display/turtle_16.c | 3 ++- src/display/turtle_30px.c | 3 ++- src/display/wifi_30px.c | 3 ++- 6 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/display/cloud_30px.c b/src/display/cloud_30px.c index 2341772bd..eb0feca11 100644 --- a/src/display/cloud_30px.c +++ b/src/display/cloud_30px.c @@ -4,6 +4,8 @@ * Opts: ******************************************************************************/ +#ifdef USE_DISPLAY + #ifdef LV_LVGL_H_INCLUDE_SIMPLE #include "lvgl.h" #else @@ -171,3 +173,4 @@ lv_font_t cloud_30px = { #endif /*#if CLOUD_30PX*/ +#endif // USE_DISPLAY \ No newline at end of file diff --git a/src/display/errorTriangle.c b/src/display/errorTriangle.c index a0bdd0c46..a6d06830d 100644 --- a/src/display/errorTriangle.c +++ b/src/display/errorTriangle.c @@ -3,7 +3,7 @@ * Bpp: 4 * Opts: ******************************************************************************/ - +#ifdef USE_DISPLAY #ifdef LV_LVGL_H_INCLUDE_SIMPLE #include "lvgl.h" #else @@ -674,3 +674,4 @@ lv_font_t errorTriangle = { #endif /*#if ERRORTRIANGLE*/ +#endif \ No newline at end of file diff --git a/src/display/file.c b/src/display/file.c index 60b6af72c..da2afd5cf 100644 --- a/src/display/file.c +++ b/src/display/file.c @@ -3,6 +3,7 @@ * Bpp: 4 * Opts: ******************************************************************************/ +#ifdef USE_DISPLAY #ifdef LV_LVGL_H_INCLUDE_SIMPLE #include "lvgl.h" @@ -147,7 +148,7 @@ lv_font_t file = { .dsc = &font_dsc /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */ }; - +#endif #endif /*#if FILE*/ diff --git a/src/display/turtle_16.c b/src/display/turtle_16.c index 3565874cb..ab215cf6a 100644 --- a/src/display/turtle_16.c +++ b/src/display/turtle_16.c @@ -3,7 +3,7 @@ * Bpp: 4 * Opts: ******************************************************************************/ - +#ifdef USE_DISPLAY #ifdef LV_LVGL_H_INCLUDE_SIMPLE #include "lvgl.h" #else @@ -122,3 +122,4 @@ lv_font_t turtle_16 = { #endif /*#if TURTLE_16*/ +#endif \ No newline at end of file diff --git a/src/display/turtle_30px.c b/src/display/turtle_30px.c index e9886bd6a..9bdd8f658 100644 --- a/src/display/turtle_30px.c +++ b/src/display/turtle_30px.c @@ -3,7 +3,7 @@ * Bpp: 4 * Opts: ******************************************************************************/ - +#ifdef USE_DISPLAY #ifdef LV_LVGL_H_INCLUDE_SIMPLE #include "lvgl.h" #else @@ -164,3 +164,4 @@ lv_font_t turtle_30px = { #endif /*#if TURTLE_30PX*/ +#endif \ No newline at end of file diff --git a/src/display/wifi_30px.c b/src/display/wifi_30px.c index bea863712..5db2e22a6 100644 --- a/src/display/wifi_30px.c +++ b/src/display/wifi_30px.c @@ -3,7 +3,7 @@ * Bpp: 4 * Opts: ******************************************************************************/ - +#ifdef USE_DISPLAY #ifdef LV_LVGL_H_INCLUDE_SIMPLE #include "lvgl.h" #else @@ -172,3 +172,4 @@ lv_font_t wifi_30px = { #endif /*#if WIFI_30PX*/ +#endif \ No newline at end of file From 374b101b9790e9c0c39a8b7578de02845e2fb44c Mon Sep 17 00:00:00 2001 From: brentru Date: Fri, 23 Jun 2023 15:54:18 -0400 Subject: [PATCH 77/90] guard around ws_display_x classes --- src/display/ws_display_driver.cpp | 5 ++++- src/display/ws_display_ui_helper.cpp | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/display/ws_display_driver.cpp b/src/display/ws_display_driver.cpp index 0e9a285c8..be7154792 100644 --- a/src/display/ws_display_driver.cpp +++ b/src/display/ws_display_driver.cpp @@ -12,6 +12,7 @@ * BSD license, all text here must be included in any redistribution. * */ +#ifdef USE_DISPLAY #include "ws_display_driver.h" /**************************************************************************/ @@ -147,4 +148,6 @@ void ws_display_driver::esp32_lvgl_acquire() { /**************************************************************************/ void ws_display_driver::esp32_lvgl_release() { _glue->lvgl_release(); -} \ No newline at end of file +} + +#endif \ No newline at end of file diff --git a/src/display/ws_display_ui_helper.cpp b/src/display/ws_display_ui_helper.cpp index 6ff821e7a..d0136c78e 100644 --- a/src/display/ws_display_ui_helper.cpp +++ b/src/display/ws_display_ui_helper.cpp @@ -12,7 +12,7 @@ * BSD license, all text here must be included in any redistribution. * */ - +#ifdef USE_DISPLAY #include "ws_display_ui_helper.h" /********************** @@ -465,3 +465,5 @@ void ws_display_ui_helper::addToTerminal(const char *txt_in) { lv_label_set_text_static(terminalLabel, terminalTextBuffer); _dispDriver->esp32_lvgl_release(); } + +#endif \ No newline at end of file From cf81a502fb16dc327f78d85a62b9de15274f9654 Mon Sep 17 00:00:00 2001 From: brentru Date: Mon, 26 Jun 2023 10:52:15 -0400 Subject: [PATCH 78/90] typedef displayConfig struct? --- src/display/ws_display_driver.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/display/ws_display_driver.h b/src/display/ws_display_driver.h index 7d3273590..f507f665a 100644 --- a/src/display/ws_display_driver.h +++ b/src/display/ws_display_driver.h @@ -21,7 +21,7 @@ #include #include -struct displayConfig { +typedef struct { char driver[10]; ///< Display driver type int width; ///< Display width int height; ///< Display height @@ -33,7 +33,7 @@ struct displayConfig { uint8_t pinMOSI; ///< Display MOSI pin uint8_t pinSCK; ///< Display SCK pin uint8_t pinRST; ///< Display RST pin -}; ///< Display configuration struct +} displayConfig; LV_FONT_DECLARE(errorTriangle); ///< Error triangle symbol/font From 0b7e681d53b0a6714d3dc88eb8a28f933386b92a Mon Sep 17 00:00:00 2001 From: brentru Date: Mon, 26 Jun 2023 11:13:45 -0400 Subject: [PATCH 79/90] revert past 3 --- src/display/{ => symbols}/cloud_30px.c | 4 ++-- src/display/{ => symbols}/errorTriangle.c | 4 ++-- src/display/{ => symbols}/file.c | 4 ++-- src/display/{ => symbols}/turtle_16.c | 4 ++-- src/display/{ => symbols}/turtle_30px.c | 4 ++-- src/display/{ => symbols}/wifi_30px.c | 4 ++-- src/display/ws_display_driver.cpp | 4 ++-- src/display/ws_display_driver.h | 4 ++-- src/display/ws_display_ui_helper.cpp | 4 ++-- 9 files changed, 18 insertions(+), 18 deletions(-) rename src/display/{ => symbols}/cloud_30px.c (99%) rename src/display/{ => symbols}/errorTriangle.c (99%) rename src/display/{ => symbols}/file.c (99%) rename src/display/{ => symbols}/turtle_16.c (99%) rename src/display/{ => symbols}/turtle_30px.c (99%) rename src/display/{ => symbols}/wifi_30px.c (99%) diff --git a/src/display/cloud_30px.c b/src/display/symbols/cloud_30px.c similarity index 99% rename from src/display/cloud_30px.c rename to src/display/symbols/cloud_30px.c index eb0feca11..43f616034 100644 --- a/src/display/cloud_30px.c +++ b/src/display/symbols/cloud_30px.c @@ -4,7 +4,7 @@ * Opts: ******************************************************************************/ -#ifdef USE_DISPLAY +//#ifdef USE_DISPLAY #ifdef LV_LVGL_H_INCLUDE_SIMPLE #include "lvgl.h" @@ -173,4 +173,4 @@ lv_font_t cloud_30px = { #endif /*#if CLOUD_30PX*/ -#endif // USE_DISPLAY \ No newline at end of file +// #endif // USE_DISPLAY \ No newline at end of file diff --git a/src/display/errorTriangle.c b/src/display/symbols/errorTriangle.c similarity index 99% rename from src/display/errorTriangle.c rename to src/display/symbols/errorTriangle.c index a6d06830d..3cb9417dd 100644 --- a/src/display/errorTriangle.c +++ b/src/display/symbols/errorTriangle.c @@ -3,7 +3,7 @@ * Bpp: 4 * Opts: ******************************************************************************/ -#ifdef USE_DISPLAY +// #ifdef USE_DISPLAY #ifdef LV_LVGL_H_INCLUDE_SIMPLE #include "lvgl.h" #else @@ -674,4 +674,4 @@ lv_font_t errorTriangle = { #endif /*#if ERRORTRIANGLE*/ -#endif \ No newline at end of file +// #endif \ No newline at end of file diff --git a/src/display/file.c b/src/display/symbols/file.c similarity index 99% rename from src/display/file.c rename to src/display/symbols/file.c index da2afd5cf..53505f00b 100644 --- a/src/display/file.c +++ b/src/display/symbols/file.c @@ -3,7 +3,7 @@ * Bpp: 4 * Opts: ******************************************************************************/ -#ifdef USE_DISPLAY +// #ifdef USE_DISPLAY #ifdef LV_LVGL_H_INCLUDE_SIMPLE #include "lvgl.h" @@ -148,7 +148,7 @@ lv_font_t file = { .dsc = &font_dsc /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */ }; -#endif +// #endif #endif /*#if FILE*/ diff --git a/src/display/turtle_16.c b/src/display/symbols/turtle_16.c similarity index 99% rename from src/display/turtle_16.c rename to src/display/symbols/turtle_16.c index ab215cf6a..564fb27a1 100644 --- a/src/display/turtle_16.c +++ b/src/display/symbols/turtle_16.c @@ -3,7 +3,7 @@ * Bpp: 4 * Opts: ******************************************************************************/ -#ifdef USE_DISPLAY +// #ifdef USE_DISPLAY #ifdef LV_LVGL_H_INCLUDE_SIMPLE #include "lvgl.h" #else @@ -122,4 +122,4 @@ lv_font_t turtle_16 = { #endif /*#if TURTLE_16*/ -#endif \ No newline at end of file +// #endif \ No newline at end of file diff --git a/src/display/turtle_30px.c b/src/display/symbols/turtle_30px.c similarity index 99% rename from src/display/turtle_30px.c rename to src/display/symbols/turtle_30px.c index 9bdd8f658..d14d8b219 100644 --- a/src/display/turtle_30px.c +++ b/src/display/symbols/turtle_30px.c @@ -3,7 +3,7 @@ * Bpp: 4 * Opts: ******************************************************************************/ -#ifdef USE_DISPLAY +//#ifdef USE_DISPLAY #ifdef LV_LVGL_H_INCLUDE_SIMPLE #include "lvgl.h" #else @@ -164,4 +164,4 @@ lv_font_t turtle_30px = { #endif /*#if TURTLE_30PX*/ -#endif \ No newline at end of file +// #endif \ No newline at end of file diff --git a/src/display/wifi_30px.c b/src/display/symbols/wifi_30px.c similarity index 99% rename from src/display/wifi_30px.c rename to src/display/symbols/wifi_30px.c index 5db2e22a6..23d66e2e5 100644 --- a/src/display/wifi_30px.c +++ b/src/display/symbols/wifi_30px.c @@ -3,7 +3,7 @@ * Bpp: 4 * Opts: ******************************************************************************/ -#ifdef USE_DISPLAY +// #ifdef USE_DISPLAY #ifdef LV_LVGL_H_INCLUDE_SIMPLE #include "lvgl.h" #else @@ -172,4 +172,4 @@ lv_font_t wifi_30px = { #endif /*#if WIFI_30PX*/ -#endif \ No newline at end of file +// #endif \ No newline at end of file diff --git a/src/display/ws_display_driver.cpp b/src/display/ws_display_driver.cpp index be7154792..318f07ce3 100644 --- a/src/display/ws_display_driver.cpp +++ b/src/display/ws_display_driver.cpp @@ -12,7 +12,7 @@ * BSD license, all text here must be included in any redistribution. * */ -#ifdef USE_DISPLAY +//#ifdef USE_DISPLAY #include "ws_display_driver.h" /**************************************************************************/ @@ -150,4 +150,4 @@ void ws_display_driver::esp32_lvgl_release() { _glue->lvgl_release(); } -#endif \ No newline at end of file +// #endif \ No newline at end of file diff --git a/src/display/ws_display_driver.h b/src/display/ws_display_driver.h index f507f665a..54044c88f 100644 --- a/src/display/ws_display_driver.h +++ b/src/display/ws_display_driver.h @@ -21,7 +21,7 @@ #include #include -typedef struct { +struct displayConfig { char driver[10]; ///< Display driver type int width; ///< Display width int height; ///< Display height @@ -33,7 +33,7 @@ typedef struct { uint8_t pinMOSI; ///< Display MOSI pin uint8_t pinSCK; ///< Display SCK pin uint8_t pinRST; ///< Display RST pin -} displayConfig; +}; LV_FONT_DECLARE(errorTriangle); ///< Error triangle symbol/font diff --git a/src/display/ws_display_ui_helper.cpp b/src/display/ws_display_ui_helper.cpp index d0136c78e..f85a64341 100644 --- a/src/display/ws_display_ui_helper.cpp +++ b/src/display/ws_display_ui_helper.cpp @@ -12,7 +12,7 @@ * BSD license, all text here must be included in any redistribution. * */ -#ifdef USE_DISPLAY +// #ifdef USE_DISPLAY #include "ws_display_ui_helper.h" /********************** @@ -466,4 +466,4 @@ void ws_display_ui_helper::addToTerminal(const char *txt_in) { _dispDriver->esp32_lvgl_release(); } -#endif \ No newline at end of file +// #endif \ No newline at end of file From d94899589a3f67356c436a1a562af60cbc889883 Mon Sep 17 00:00:00 2001 From: brentru Date: Mon, 26 Jun 2023 11:33:07 -0400 Subject: [PATCH 80/90] refactor parseDisplayConfig --- src/Wippersnapper.cpp | 3 ++- src/provisioning/tinyusb/Wippersnapper_FS.cpp | 6 +----- src/provisioning/tinyusb/Wippersnapper_FS.h | 2 +- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/Wippersnapper.cpp b/src/Wippersnapper.cpp index 605e46765..8b6cb532f 100644 --- a/src/Wippersnapper.cpp +++ b/src/Wippersnapper.cpp @@ -106,7 +106,8 @@ void Wippersnapper::provision() { #ifdef USE_DISPLAY // Initialize the display - displayConfig config = WS._fileSystem->parseDisplayConfig(); + displayConfig config; + WS._fileSystem->parseDisplayConfig(config); WS._display = new ws_display_driver(config); // Begin display if (!WS._display->begin()) { diff --git a/src/provisioning/tinyusb/Wippersnapper_FS.cpp b/src/provisioning/tinyusb/Wippersnapper_FS.cpp index 79fd31c67..660cf9c9b 100644 --- a/src/provisioning/tinyusb/Wippersnapper_FS.cpp +++ b/src/provisioning/tinyusb/Wippersnapper_FS.cpp @@ -494,7 +494,7 @@ void Wippersnapper_FS::createDisplayConfig() { delay(2500); } -displayConfig Wippersnapper_FS::parseDisplayConfig() { +void Wippersnapper_FS::parseDisplayConfig(displayConfig& displayFile) { StaticJsonDocument<384> doc; DeserializationError error; @@ -514,8 +514,6 @@ displayConfig Wippersnapper_FS::parseDisplayConfig() { yield(); } - // let's parse the deserialized array into a displayConfig struct! - displayConfig displayFile; // generic fields strcpy(displayFile.driver, doc["driver"]); displayFile.height = doc["height"]; @@ -538,8 +536,6 @@ displayConfig Wippersnapper_FS::parseDisplayConfig() { "ERROR: Display device lacks a hardware interface, failing out..."); // TODO: Halt? } - - return displayFile; } /**************************************************************************/ diff --git a/src/provisioning/tinyusb/Wippersnapper_FS.h b/src/provisioning/tinyusb/Wippersnapper_FS.h index 846f0eac9..e7c815436 100644 --- a/src/provisioning/tinyusb/Wippersnapper_FS.h +++ b/src/provisioning/tinyusb/Wippersnapper_FS.h @@ -59,7 +59,7 @@ class Wippersnapper_FS { void parseSecrets(); - displayConfig parseDisplayConfig(); + void parseDisplayConfig(displayConfig& displayFile); void createDisplayConfig(); // NOTE: calculated capacity with maximum From ce3d5ad99166b58fcb40babe4079622cdedfb50f Mon Sep 17 00:00:00 2001 From: brentru Date: Mon, 26 Jun 2023 12:08:03 -0400 Subject: [PATCH 81/90] include display driver.h within fs --- src/provisioning/tinyusb/Wippersnapper_FS.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/provisioning/tinyusb/Wippersnapper_FS.h b/src/provisioning/tinyusb/Wippersnapper_FS.h index e7c815436..45500be5a 100644 --- a/src/provisioning/tinyusb/Wippersnapper_FS.h +++ b/src/provisioning/tinyusb/Wippersnapper_FS.h @@ -23,6 +23,8 @@ #include "fatfs/ff.h" // NOTE: This should be #included before fatfs/diskio.h!!! #include "fatfs/diskio.h" +#include "display/ws_display_driver.h" + #include "Wippersnapper.h" // forward decl. From 64308e8fc78d48cda63da32b15e7c03e622bf04a Mon Sep 17 00:00:00 2001 From: brentru Date: Mon, 26 Jun 2023 14:05:23 -0400 Subject: [PATCH 82/90] use_display ifdef --- src/display/ws_display_driver.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/display/ws_display_driver.h b/src/display/ws_display_driver.h index 54044c88f..7bb289584 100644 --- a/src/display/ws_display_driver.h +++ b/src/display/ws_display_driver.h @@ -15,6 +15,8 @@ #ifndef WIPPERSNAPPER_DISPLAY_H #define WIPPERSNAPPER_DISPLAY_H +#ifdef USE_DISPLAY + #include "Wippersnapper.h" #include // Always include this BEFORE lvgl.h! @@ -67,4 +69,5 @@ class ws_display_driver { }; extern Wippersnapper WS; -#endif // WIPPERSNAPPER_DISPLAY_H \ No newline at end of file +#endif // WIPPERSNAPPER_DISPLAY_H +#endif // USE_DISPLAY \ No newline at end of file From 47aebf65fb3535b619992a915b7618eaae25d6f7 Mon Sep 17 00:00:00 2001 From: brentru Date: Mon, 26 Jun 2023 14:37:52 -0400 Subject: [PATCH 83/90] #ifdef ARDUINO_FUNHOUSE_ESP32S2 --- src/display/symbols/cloud_30px.c | 4 ++-- src/display/symbols/errorTriangle.c | 4 ++-- src/display/symbols/file.c | 4 ++-- src/display/symbols/turtle_16.c | 4 ++-- src/display/symbols/turtle_30px.c | 4 ++-- src/display/symbols/wifi_30px.c | 4 ++-- src/display/ws_display_driver.cpp | 4 ++-- src/display/ws_display_ui_helper.cpp | 4 ++-- src/provisioning/tinyusb/Wippersnapper_FS.h | 2 -- 9 files changed, 16 insertions(+), 18 deletions(-) diff --git a/src/display/symbols/cloud_30px.c b/src/display/symbols/cloud_30px.c index 43f616034..4a4db8c30 100644 --- a/src/display/symbols/cloud_30px.c +++ b/src/display/symbols/cloud_30px.c @@ -4,7 +4,7 @@ * Opts: ******************************************************************************/ -//#ifdef USE_DISPLAY +#ifdef ARDUINO_FUNHOUSE_ESP32S2 #ifdef LV_LVGL_H_INCLUDE_SIMPLE #include "lvgl.h" @@ -173,4 +173,4 @@ lv_font_t cloud_30px = { #endif /*#if CLOUD_30PX*/ -// #endif // USE_DISPLAY \ No newline at end of file +#endif \ No newline at end of file diff --git a/src/display/symbols/errorTriangle.c b/src/display/symbols/errorTriangle.c index 3cb9417dd..cfca9254a 100644 --- a/src/display/symbols/errorTriangle.c +++ b/src/display/symbols/errorTriangle.c @@ -3,7 +3,7 @@ * Bpp: 4 * Opts: ******************************************************************************/ -// #ifdef USE_DISPLAY +#ifdef ARDUINO_FUNHOUSE_ESP32S2 #ifdef LV_LVGL_H_INCLUDE_SIMPLE #include "lvgl.h" #else @@ -674,4 +674,4 @@ lv_font_t errorTriangle = { #endif /*#if ERRORTRIANGLE*/ -// #endif \ No newline at end of file +#endif \ No newline at end of file diff --git a/src/display/symbols/file.c b/src/display/symbols/file.c index 53505f00b..c38746792 100644 --- a/src/display/symbols/file.c +++ b/src/display/symbols/file.c @@ -3,7 +3,7 @@ * Bpp: 4 * Opts: ******************************************************************************/ -// #ifdef USE_DISPLAY +#ifdef ARDUINO_FUNHOUSE_ESP32S2 #ifdef LV_LVGL_H_INCLUDE_SIMPLE #include "lvgl.h" @@ -148,7 +148,7 @@ lv_font_t file = { .dsc = &font_dsc /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */ }; -// #endif +#endif #endif /*#if FILE*/ diff --git a/src/display/symbols/turtle_16.c b/src/display/symbols/turtle_16.c index 564fb27a1..c3cd97039 100644 --- a/src/display/symbols/turtle_16.c +++ b/src/display/symbols/turtle_16.c @@ -3,7 +3,7 @@ * Bpp: 4 * Opts: ******************************************************************************/ -// #ifdef USE_DISPLAY +#ifdef ARDUINO_FUNHOUSE_ESP32S2 #ifdef LV_LVGL_H_INCLUDE_SIMPLE #include "lvgl.h" #else @@ -122,4 +122,4 @@ lv_font_t turtle_16 = { #endif /*#if TURTLE_16*/ -// #endif \ No newline at end of file +#endif \ No newline at end of file diff --git a/src/display/symbols/turtle_30px.c b/src/display/symbols/turtle_30px.c index d14d8b219..549949620 100644 --- a/src/display/symbols/turtle_30px.c +++ b/src/display/symbols/turtle_30px.c @@ -3,7 +3,7 @@ * Bpp: 4 * Opts: ******************************************************************************/ -//#ifdef USE_DISPLAY +#ifdef ARDUINO_FUNHOUSE_ESP32S2 #ifdef LV_LVGL_H_INCLUDE_SIMPLE #include "lvgl.h" #else @@ -164,4 +164,4 @@ lv_font_t turtle_30px = { #endif /*#if TURTLE_30PX*/ -// #endif \ No newline at end of file +#endif \ No newline at end of file diff --git a/src/display/symbols/wifi_30px.c b/src/display/symbols/wifi_30px.c index 23d66e2e5..9f5f24504 100644 --- a/src/display/symbols/wifi_30px.c +++ b/src/display/symbols/wifi_30px.c @@ -3,7 +3,7 @@ * Bpp: 4 * Opts: ******************************************************************************/ -// #ifdef USE_DISPLAY +#ifdef ARDUINO_FUNHOUSE_ESP32S2 #ifdef LV_LVGL_H_INCLUDE_SIMPLE #include "lvgl.h" #else @@ -172,4 +172,4 @@ lv_font_t wifi_30px = { #endif /*#if WIFI_30PX*/ -// #endif \ No newline at end of file +#endif \ No newline at end of file diff --git a/src/display/ws_display_driver.cpp b/src/display/ws_display_driver.cpp index 318f07ce3..8a0a8f4a5 100644 --- a/src/display/ws_display_driver.cpp +++ b/src/display/ws_display_driver.cpp @@ -12,7 +12,7 @@ * BSD license, all text here must be included in any redistribution. * */ -//#ifdef USE_DISPLAY +#ifdef ARDUINO_FUNHOUSE_ESP32S2 #include "ws_display_driver.h" /**************************************************************************/ @@ -150,4 +150,4 @@ void ws_display_driver::esp32_lvgl_release() { _glue->lvgl_release(); } -// #endif \ No newline at end of file +#endif \ No newline at end of file diff --git a/src/display/ws_display_ui_helper.cpp b/src/display/ws_display_ui_helper.cpp index f85a64341..56907bef1 100644 --- a/src/display/ws_display_ui_helper.cpp +++ b/src/display/ws_display_ui_helper.cpp @@ -12,7 +12,7 @@ * BSD license, all text here must be included in any redistribution. * */ -// #ifdef USE_DISPLAY +#ifdef ARDUINO_FUNHOUSE_ESP32S2 #include "ws_display_ui_helper.h" /********************** @@ -466,4 +466,4 @@ void ws_display_ui_helper::addToTerminal(const char *txt_in) { _dispDriver->esp32_lvgl_release(); } -// #endif \ No newline at end of file +#endif \ No newline at end of file diff --git a/src/provisioning/tinyusb/Wippersnapper_FS.h b/src/provisioning/tinyusb/Wippersnapper_FS.h index 45500be5a..e7c815436 100644 --- a/src/provisioning/tinyusb/Wippersnapper_FS.h +++ b/src/provisioning/tinyusb/Wippersnapper_FS.h @@ -23,8 +23,6 @@ #include "fatfs/ff.h" // NOTE: This should be #included before fatfs/diskio.h!!! #include "fatfs/diskio.h" -#include "display/ws_display_driver.h" - #include "Wippersnapper.h" // forward decl. From c528bcaed96045a19bdeac50cbe52019a73c35c2 Mon Sep 17 00:00:00 2001 From: brentru Date: Mon, 26 Jun 2023 14:53:34 -0400 Subject: [PATCH 84/90] remove #DISPLAY flag --- src/display/ws_display_driver.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/display/ws_display_driver.h b/src/display/ws_display_driver.h index 7bb289584..54044c88f 100644 --- a/src/display/ws_display_driver.h +++ b/src/display/ws_display_driver.h @@ -15,8 +15,6 @@ #ifndef WIPPERSNAPPER_DISPLAY_H #define WIPPERSNAPPER_DISPLAY_H -#ifdef USE_DISPLAY - #include "Wippersnapper.h" #include // Always include this BEFORE lvgl.h! @@ -69,5 +67,4 @@ class ws_display_driver { }; extern Wippersnapper WS; -#endif // WIPPERSNAPPER_DISPLAY_H -#endif // USE_DISPLAY \ No newline at end of file +#endif // WIPPERSNAPPER_DISPLAY_H \ No newline at end of file From db8e1329a78b4848410085d3c1a593bff3b704fe Mon Sep 17 00:00:00 2001 From: brentru Date: Mon, 26 Jun 2023 15:00:58 -0400 Subject: [PATCH 85/90] guards for displayconfig funcn --- src/provisioning/tinyusb/Wippersnapper_FS.cpp | 4 ++++ src/provisioning/tinyusb/Wippersnapper_FS.h | 2 ++ 2 files changed, 6 insertions(+) diff --git a/src/provisioning/tinyusb/Wippersnapper_FS.cpp b/src/provisioning/tinyusb/Wippersnapper_FS.cpp index 660cf9c9b..f82242b4d 100644 --- a/src/provisioning/tinyusb/Wippersnapper_FS.cpp +++ b/src/provisioning/tinyusb/Wippersnapper_FS.cpp @@ -468,6 +468,7 @@ void Wippersnapper_FS::fsHalt() { } } +#ifdef ARDUINO_FUNHOUSE_ESP32S2 void Wippersnapper_FS::createDisplayConfig() { StaticJsonDocument<256> doc; @@ -500,7 +501,9 @@ void Wippersnapper_FS::parseDisplayConfig(displayConfig& displayFile) { if (!wipperFatFs.exists("/display_config.json")) { WS_DEBUG_PRINTLN("Could not find display_config.json, generating..."); + #ifdef ARDUINO_FUNHOUSE_ESP32S2 createDisplayConfig(); + #endif } File32 file = wipperFatFs.open("/display_config.json", FILE_READ); @@ -537,6 +540,7 @@ void Wippersnapper_FS::parseDisplayConfig(displayConfig& displayFile) { // TODO: Halt? } } +#endif // ARDUINO_FUNHOUSE_ESP32S2 /**************************************************************************/ /*! diff --git a/src/provisioning/tinyusb/Wippersnapper_FS.h b/src/provisioning/tinyusb/Wippersnapper_FS.h index e7c815436..a44cc33aa 100644 --- a/src/provisioning/tinyusb/Wippersnapper_FS.h +++ b/src/provisioning/tinyusb/Wippersnapper_FS.h @@ -59,8 +59,10 @@ class Wippersnapper_FS { void parseSecrets(); + #ifdef ARDUINO_FUNHOUSE_ESP32S2 void parseDisplayConfig(displayConfig& displayFile); void createDisplayConfig(); + #endif // NOTE: calculated capacity with maximum // length of usernames/passwords/tokens From 094c6e1c8910da3cf54787865808618197462a3e Mon Sep 17 00:00:00 2001 From: brentru Date: Mon, 26 Jun 2023 16:11:33 -0400 Subject: [PATCH 86/90] switch between ps_malloc for esp32 and malloc for non-esp32 --- src/Wippersnapper.cpp | 118 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 118 insertions(+) diff --git a/src/Wippersnapper.cpp b/src/Wippersnapper.cpp index 8b6cb532f..ba22e6e52 100644 --- a/src/Wippersnapper.cpp +++ b/src/Wippersnapper.cpp @@ -1613,8 +1613,13 @@ void cbThrottleTopic(char *throttleData, uint16_t len) { /**************************************************************************/ bool Wippersnapper::generateWSErrorTopics() { // dynamically allocate memory for err topic + #ifdef ARDUINO_ARCH_ESP32 WS._err_topic = (char *)ps_malloc( sizeof(char) * (strlen(WS._username) + strlen(TOPIC_IO_ERRORS) + 1)); + #else + WS._err_topic = (char *)malloc( + sizeof(char) * (strlen(WS._username) + strlen(TOPIC_IO_ERRORS) + 1)); + #endif if (WS._err_topic) { // build error topic strcpy(WS._err_topic, WS._username); @@ -1630,8 +1635,13 @@ bool Wippersnapper::generateWSErrorTopics() { _err_sub->setCallback(cbErrorTopic); // dynamically allocate memory for throttle topic + #ifdef ARDUINO_ARCH_ESP32 WS._throttle_topic = (char *)ps_malloc( sizeof(char) * (strlen(WS._username) + strlen(TOPIC_IO_THROTTLE) + 1)); + #else + WS._throttle_topic = (char *)malloc( + sizeof(char) * (strlen(WS._username) + strlen(TOPIC_IO_THROTTLE) + 1)); + #endif if (WS._throttle_topic) { // build throttle topic strcpy(WS._throttle_topic, WS._username); @@ -1684,8 +1694,13 @@ bool Wippersnapper::generateDeviceUID() { itoa(atoi(WS.sUID), mac_uid, 10); // Attempt to malloc a the device identifier string + #ifdef ARDUINO_ARCH_ESP32 _device_uid = (char *)ps_malloc(sizeof(char) + strlen("io-wipper-") + strlen(WS._boardId) + strlen(mac_uid) + 1); + #else + _device_uid = (char *)malloc(sizeof(char) + strlen("io-wipper-") + + strlen(WS._boardId) + strlen(mac_uid) + 1); + #endif if (_device_uid == NULL) { WS_DEBUG_PRINTLN("ERROR: Unable to create device uid, Malloc failure"); return false; @@ -1707,9 +1722,15 @@ bool Wippersnapper::generateDeviceUID() { /**************************************************************************/ bool Wippersnapper::generateWSTopics() { // Create global registration topic + #ifdef ARDUINO_ARCH_ESP32 WS._topic_description = (char *)ps_malloc( sizeof(char) * strlen(WS._username) + strlen("/wprsnpr") + strlen(TOPIC_INFO) + strlen("status") + 1); + #else + WS._topic_description = (char *)malloc( + sizeof(char) * strlen(WS._username) + strlen("/wprsnpr") + + strlen(TOPIC_INFO) + strlen("status") + 1); + #endif if (WS._topic_description != NULL) { strcpy(WS._topic_description, WS._username); strcat(WS._topic_description, "/wprsnpr"); @@ -1721,10 +1742,17 @@ bool Wippersnapper::generateWSTopics() { } // Create registration status topic + #ifdef ARDUINO_ARCH_ESP32 WS._topic_description_status = (char *)ps_malloc( sizeof(char) * strlen(WS._username) + strlen("/wprsnpr/") + strlen(_device_uid) + strlen(TOPIC_INFO) + strlen("status/") + strlen("broker") + 1); + #else + WS._topic_description_status = (char *)malloc( + sizeof(char) * strlen(WS._username) + strlen("/wprsnpr/") + + strlen(_device_uid) + strlen(TOPIC_INFO) + strlen("status/") + + strlen("broker") + 1); + #endif if (WS._topic_description_status != NULL) { strcpy(WS._topic_description_status, WS._username); strcat(WS._topic_description_status, "/wprsnpr/"); @@ -1744,10 +1772,17 @@ bool Wippersnapper::generateWSTopics() { _topic_description_sub->setCallback(cbRegistrationStatus); // Create registration status complete topic + #ifdef ARDUINO_ARCH_ESP32 WS._topic_description_status_complete = (char *)ps_malloc( sizeof(char) * strlen(WS._username) + strlen("/wprsnpr/") + strlen(_device_uid) + strlen(TOPIC_INFO) + strlen("status") + strlen("/device/complete") + 1); + #else + WS._topic_description_status_complete = (char *)malloc( + sizeof(char) * strlen(WS._username) + strlen("/wprsnpr/") + + strlen(_device_uid) + strlen(TOPIC_INFO) + strlen("status") + + strlen("/device/complete") + 1); + #endif if (WS._topic_description_status_complete != NULL) { strcpy(WS._topic_description_status_complete, WS._username); strcat(WS._topic_description_status_complete, "/wprsnpr/"); @@ -1761,9 +1796,15 @@ bool Wippersnapper::generateWSTopics() { } // Create device-to-broker signal topic + #ifdef ARDUINO_ARCH_ESP32 WS._topic_signal_device = (char *)ps_malloc( sizeof(char) * strlen(WS._username) + strlen("/wprsnpr/") + strlen(_device_uid) + strlen(TOPIC_SIGNALS) + strlen("device") + 1); + #else + WS._topic_signal_device = (char *)malloc( + sizeof(char) * strlen(WS._username) + strlen("/wprsnpr/") + + strlen(_device_uid) + strlen(TOPIC_SIGNALS) + strlen("device") + 1); + #endif if (WS._topic_signal_device != NULL) { strcpy(WS._topic_signal_device, WS._username); strcat(WS._topic_signal_device, "/wprsnpr/"); @@ -1776,10 +1817,17 @@ bool Wippersnapper::generateWSTopics() { } // Create pin configuration complete topic + #ifdef ARDUINO_ARCH_ESP32 WS._topic_device_pin_config_complete = (char *)ps_malloc( sizeof(char) * strlen(WS._username) + strlen("/wprsnpr/") + strlen(_device_uid) + strlen(TOPIC_SIGNALS) + strlen("device/pinConfigComplete") + 1); + #else + WS._topic_device_pin_config_complete = (char *)malloc( + sizeof(char) * strlen(WS._username) + strlen("/wprsnpr/") + + strlen(_device_uid) + strlen(TOPIC_SIGNALS) + + strlen("device/pinConfigComplete") + 1); + #endif if (WS._topic_device_pin_config_complete != NULL) { strcpy(WS._topic_device_pin_config_complete, WS._username); strcat(WS._topic_device_pin_config_complete, "/wprsnpr/"); @@ -1793,9 +1841,15 @@ bool Wippersnapper::generateWSTopics() { } // Create broker-to-device signal topic + #ifdef ARDUINO_ARCH_ESP32 WS._topic_signal_brkr = (char *)ps_malloc( sizeof(char) * strlen(WS._username) + strlen("/wprsnpr/") + strlen(_device_uid) + strlen(TOPIC_SIGNALS) + strlen("broker") + 1); + #else + WS._topic_signal_brkr = (char *)malloc( + sizeof(char) * strlen(WS._username) + strlen("/wprsnpr/") + + strlen(_device_uid) + strlen(TOPIC_SIGNALS) + strlen("broker") + 1); + #endif if (WS._topic_signal_brkr != NULL) { strcpy(WS._topic_signal_brkr, WS._username); strcat(WS._topic_signal_brkr, "/wprsnpr/"); @@ -1814,10 +1868,17 @@ bool Wippersnapper::generateWSTopics() { _topic_signal_brkr_sub->setCallback(cbSignalTopic); // Create device-to-broker i2c signal topic + #ifdef ARDUINO_ARCH_ESP32 WS._topic_signal_i2c_brkr = (char *)ps_malloc( sizeof(char) * strlen(WS._username) + +strlen("/") + strlen(_device_uid) + strlen("/wprsnpr/") + strlen(TOPIC_SIGNALS) + strlen("broker") + strlen(TOPIC_I2C) + 1); + #else + WS._topic_signal_i2c_brkr = (char *)malloc( + sizeof(char) * strlen(WS._username) + +strlen("/") + strlen(_device_uid) + + strlen("/wprsnpr/") + strlen(TOPIC_SIGNALS) + strlen("broker") + + strlen(TOPIC_I2C) + 1); + #endif if (WS._topic_signal_i2c_brkr != NULL) { strcpy(WS._topic_signal_i2c_brkr, WS._username); strcat(WS._topic_signal_i2c_brkr, TOPIC_WS); @@ -1837,10 +1898,17 @@ bool Wippersnapper::generateWSTopics() { _topic_signal_i2c_sub->setCallback(cbSignalI2CReq); // Create broker-to-device i2c signal topic + #ifdef ARDUINO_ARCH_ESP32 WS._topic_signal_i2c_device = (char *)ps_malloc( sizeof(char) * strlen(WS._username) + +strlen("/") + strlen(_device_uid) + strlen("/wprsnpr/") + strlen(TOPIC_SIGNALS) + strlen("device") + strlen(TOPIC_I2C) + 1); + #else + WS._topic_signal_i2c_device = (char *)malloc( + sizeof(char) * strlen(WS._username) + +strlen("/") + strlen(_device_uid) + + strlen("/wprsnpr/") + strlen(TOPIC_SIGNALS) + strlen("device") + + strlen(TOPIC_I2C) + 1); + #endif if (WS._topic_signal_i2c_device != NULL) { strcpy(WS._topic_signal_i2c_device, WS._username); strcat(WS._topic_signal_i2c_device, TOPIC_WS); @@ -1854,10 +1922,17 @@ bool Wippersnapper::generateWSTopics() { } // Create device-to-broker ds18x20 topic + #ifdef ARDUINO_ARCH_ESP32 WS._topic_signal_ds18_brkr = (char *)ps_malloc( sizeof(char) * strlen(WS._username) + +strlen("/") + strlen(_device_uid) + strlen("/wprsnpr/") + strlen(TOPIC_SIGNALS) + strlen("broker/") + strlen("ds18x20") + 1); + #else + WS._topic_signal_ds18_brkr = (char *)malloc( + sizeof(char) * strlen(WS._username) + +strlen("/") + strlen(_device_uid) + + strlen("/wprsnpr/") + strlen(TOPIC_SIGNALS) + strlen("broker/") + + strlen("ds18x20") + 1); + #endif if (WS._topic_signal_ds18_brkr != NULL) { strcpy(WS._topic_signal_ds18_brkr, WS._username); strcat(WS._topic_signal_ds18_brkr, TOPIC_WS); @@ -1876,10 +1951,17 @@ bool Wippersnapper::generateWSTopics() { _topic_signal_ds18_sub->setCallback(cbSignalDSReq); // Create broker-to-device ds18x20 topic + #ifdef ARDUINO_ARCH_ESP32 WS._topic_signal_ds18_device = (char *)ps_malloc( sizeof(char) * strlen(WS._username) + +strlen("/") + strlen(_device_uid) + strlen("/wprsnpr/") + strlen(TOPIC_SIGNALS) + strlen("device/") + strlen("ds18x20") + 1); + #else + WS._topic_signal_ds18_device = (char *)malloc( + sizeof(char) * strlen(WS._username) + +strlen("/") + strlen(_device_uid) + + strlen("/wprsnpr/") + strlen(TOPIC_SIGNALS) + strlen("device/") + + strlen("ds18x20") + 1); + #endif if (WS._topic_signal_ds18_device != NULL) { strcpy(WS._topic_signal_ds18_device, WS._username); strcat(WS._topic_signal_ds18_device, TOPIC_WS); @@ -1892,9 +1974,15 @@ bool Wippersnapper::generateWSTopics() { } // Create device-to-broker servo signal topic + #ifdef ARDUINO_ARCH_ESP32 WS._topic_signal_servo_brkr = (char *)ps_malloc( sizeof(char) * strlen(WS._username) + strlen("/") + strlen(_device_uid) + strlen("/wprsnpr/signals/broker/servo") + 1); + #else + WS._topic_signal_servo_brkr = (char *)malloc( + sizeof(char) * strlen(WS._username) + strlen("/") + strlen(_device_uid) + + strlen("/wprsnpr/signals/broker/servo") + 1); + #endif if (WS._topic_signal_servo_brkr != NULL) { strcpy(WS._topic_signal_servo_brkr, WS._username); strcat(WS._topic_signal_servo_brkr, TOPIC_WS); @@ -1913,9 +2001,15 @@ bool Wippersnapper::generateWSTopics() { _topic_signal_servo_sub->setCallback(cbServoMsg); // Create broker-to-device servo signal topic + #ifdef ARDUINO_ARCH_ESP32 WS._topic_signal_servo_device = (char *)ps_malloc( sizeof(char) * strlen(WS._username) + strlen("/") + strlen(_device_uid) + strlen("/wprsnpr/signals/device/servo") + 1); + #else + WS._topic_signal_servo_device = (char *)malloc( + sizeof(char) * strlen(WS._username) + strlen("/") + strlen(_device_uid) + + strlen("/wprsnpr/signals/device/servo") + 1); + #endif if (WS._topic_signal_servo_device != NULL) { strcpy(WS._topic_signal_servo_device, WS._username); strcat(WS._topic_signal_servo_device, TOPIC_WS); @@ -1928,9 +2022,15 @@ bool Wippersnapper::generateWSTopics() { } // Topic for pwm messages from broker->device + #ifdef ARDUINO_ARCH_ESP32 WS._topic_signal_pwm_brkr = (char *)ps_malloc( sizeof(char) * strlen(WS._username) + strlen("/") + strlen(_device_uid) + strlen("/wprsnpr/signals/broker/pwm") + 1); + #else + WS._topic_signal_pwm_brkr = (char *)malloc( + sizeof(char) * strlen(WS._username) + strlen("/") + strlen(_device_uid) + + strlen("/wprsnpr/signals/broker/pwm") + 1); + #endif // Create device-to-broker pwm signal topic if (WS._topic_signal_pwm_brkr != NULL) { strcpy(WS._topic_signal_pwm_brkr, WS._username); @@ -1950,9 +2050,15 @@ bool Wippersnapper::generateWSTopics() { _topic_signal_pwm_sub->setCallback(cbPWMMsg); // Topic for pwm messages from device->broker + #ifdef ARDUINO_ARCH_ESP32 WS._topic_signal_pwm_device = (char *)ps_malloc( sizeof(char) * strlen(WS._username) + strlen("/") + strlen(_device_uid) + strlen("/wprsnpr/signals/device/pwm") + 1); + #else + WS._topic_signal_pwm_device = (char *)malloc( + sizeof(char) * strlen(WS._username) + strlen("/") + strlen(_device_uid) + + strlen("/wprsnpr/signals/device/pwm") + 1); + #endif if (WS._topic_signal_pwm_device != NULL) { strcpy(WS._topic_signal_pwm_device, WS._username); strcat(WS._topic_signal_pwm_device, TOPIC_WS); @@ -1965,9 +2071,15 @@ bool Wippersnapper::generateWSTopics() { } // Topic for pixel messages from broker->device + #ifdef ARDUINO_ARCH_ESP32 WS._topic_signal_pixels_brkr = (char *)ps_malloc( sizeof(char) * strlen(WS._username) + strlen("/") + strlen(_device_uid) + strlen("/wprsnpr/signals/broker/pixels") + 1); + #else + WS._topic_signal_pixels_brkr = (char *)malloc( + sizeof(char) * strlen(WS._username) + strlen("/") + strlen(_device_uid) + + strlen("/wprsnpr/signals/broker/pixels") + 1); + #endif if (WS._topic_signal_pixels_brkr != NULL) { strcpy(WS._topic_signal_pixels_brkr, WS._username); strcat(WS._topic_signal_pixels_brkr, TOPIC_WS); @@ -1985,9 +2097,15 @@ bool Wippersnapper::generateWSTopics() { _topic_signal_pixels_sub->setCallback(cbPixelsMsg); // Topic for pixel messages from device->broker + #ifdef ARDUINO_ARCH_ESP32 WS._topic_signal_pixels_device = (char *)ps_malloc( sizeof(char) * strlen(WS._username) + strlen("/") + strlen(_device_uid) + strlen("/wprsnpr/signals/device/pixels") + 1); + #else + WS._topic_signal_pixels_device = (char *)malloc( + sizeof(char) * strlen(WS._username) + strlen("/") + strlen(_device_uid) + + strlen("/wprsnpr/signals/device/pixels") + 1); + #endif if (WS._topic_signal_pixels_device != NULL) { strcpy(WS._topic_signal_pixels_device, WS._username); strcat(WS._topic_signal_pixels_device, TOPIC_WS); From d984bc5d5521cab89a58db15691299339dd4a7ae Mon Sep 17 00:00:00 2001 From: brentru Date: Mon, 26 Jun 2023 16:33:41 -0400 Subject: [PATCH 87/90] clang --- src/Wippersnapper.cpp | 195 ++-- src/Wippersnapper.h | 16 +- src/display/symbols/cloud_30px.c | 164 ++- src/display/symbols/errorTriangle.c | 1003 +++++++----------- src/display/symbols/file.c | 130 ++- src/display/symbols/turtle_16.c | 83 +- src/display/symbols/turtle_30px.c | 153 ++- src/display/symbols/wifi_30px.c | 166 ++- src/display/ws_display_driver.cpp | 22 +- src/display/ws_display_ui_helper.h | 2 - src/network_interfaces/Wippersnapper_ESP32.h | 8 +- 11 files changed, 842 insertions(+), 1100 deletions(-) diff --git a/src/Wippersnapper.cpp b/src/Wippersnapper.cpp index ba22e6e52..d6ea4551b 100644 --- a/src/Wippersnapper.cpp +++ b/src/Wippersnapper.cpp @@ -1229,8 +1229,7 @@ bool cbPWMDecodeMsg(pb_istream_t *stream, const pb_field_t *field, void **arg) { #ifdef USE_DISPLAY char buffer[100]; snprintf(buffer, 100, "[PWM] Writing duty cycle %d to pin %d\n.", - (int)msgPWMWriteDutyCycleRequest.duty_cycle, - atoi(pwmPin)); + (int)msgPWMWriteDutyCycleRequest.duty_cycle, atoi(pwmPin)); WS._ui_helper->add_text_to_terminal(buffer); #endif @@ -1612,14 +1611,14 @@ void cbThrottleTopic(char *throttleData, uint16_t len) { */ /**************************************************************************/ bool Wippersnapper::generateWSErrorTopics() { - // dynamically allocate memory for err topic - #ifdef ARDUINO_ARCH_ESP32 +// dynamically allocate memory for err topic +#ifdef ARDUINO_ARCH_ESP32 WS._err_topic = (char *)ps_malloc( sizeof(char) * (strlen(WS._username) + strlen(TOPIC_IO_ERRORS) + 1)); - #else - WS._err_topic = (char *)malloc( +#else + WS._err_topic = (char *)malloc( sizeof(char) * (strlen(WS._username) + strlen(TOPIC_IO_ERRORS) + 1)); - #endif +#endif if (WS._err_topic) { // build error topic strcpy(WS._err_topic, WS._username); @@ -1634,14 +1633,14 @@ bool Wippersnapper::generateWSErrorTopics() { WS._mqtt->subscribe(_err_sub); _err_sub->setCallback(cbErrorTopic); - // dynamically allocate memory for throttle topic - #ifdef ARDUINO_ARCH_ESP32 +// dynamically allocate memory for throttle topic +#ifdef ARDUINO_ARCH_ESP32 WS._throttle_topic = (char *)ps_malloc( sizeof(char) * (strlen(WS._username) + strlen(TOPIC_IO_THROTTLE) + 1)); - #else - WS._throttle_topic = (char *)malloc( +#else + WS._throttle_topic = (char *)malloc( sizeof(char) * (strlen(WS._username) + strlen(TOPIC_IO_THROTTLE) + 1)); - #endif +#endif if (WS._throttle_topic) { // build throttle topic strcpy(WS._throttle_topic, WS._username); @@ -1693,14 +1692,14 @@ bool Wippersnapper::generateDeviceUID() { char mac_uid[13]; itoa(atoi(WS.sUID), mac_uid, 10); - // Attempt to malloc a the device identifier string - #ifdef ARDUINO_ARCH_ESP32 +// Attempt to malloc a the device identifier string +#ifdef ARDUINO_ARCH_ESP32 _device_uid = (char *)ps_malloc(sizeof(char) + strlen("io-wipper-") + strlen(WS._boardId) + strlen(mac_uid) + 1); - #else +#else _device_uid = (char *)malloc(sizeof(char) + strlen("io-wipper-") + - strlen(WS._boardId) + strlen(mac_uid) + 1); - #endif + strlen(WS._boardId) + strlen(mac_uid) + 1); +#endif if (_device_uid == NULL) { WS_DEBUG_PRINTLN("ERROR: Unable to create device uid, Malloc failure"); return false; @@ -1721,16 +1720,16 @@ bool Wippersnapper::generateDeviceUID() { */ /**************************************************************************/ bool Wippersnapper::generateWSTopics() { - // Create global registration topic - #ifdef ARDUINO_ARCH_ESP32 +// Create global registration topic +#ifdef ARDUINO_ARCH_ESP32 WS._topic_description = (char *)ps_malloc( sizeof(char) * strlen(WS._username) + strlen("/wprsnpr") + strlen(TOPIC_INFO) + strlen("status") + 1); - #else - WS._topic_description = (char *)malloc( - sizeof(char) * strlen(WS._username) + strlen("/wprsnpr") + - strlen(TOPIC_INFO) + strlen("status") + 1); - #endif +#else + WS._topic_description = + (char *)malloc(sizeof(char) * strlen(WS._username) + strlen("/wprsnpr") + + strlen(TOPIC_INFO) + strlen("status") + 1); +#endif if (WS._topic_description != NULL) { strcpy(WS._topic_description, WS._username); strcat(WS._topic_description, "/wprsnpr"); @@ -1741,18 +1740,18 @@ bool Wippersnapper::generateWSTopics() { return false; } - // Create registration status topic - #ifdef ARDUINO_ARCH_ESP32 +// Create registration status topic +#ifdef ARDUINO_ARCH_ESP32 WS._topic_description_status = (char *)ps_malloc( sizeof(char) * strlen(WS._username) + strlen("/wprsnpr/") + strlen(_device_uid) + strlen(TOPIC_INFO) + strlen("status/") + strlen("broker") + 1); - #else - WS._topic_description_status = (char *)malloc( - sizeof(char) * strlen(WS._username) + strlen("/wprsnpr/") + - strlen(_device_uid) + strlen(TOPIC_INFO) + strlen("status/") + - strlen("broker") + 1); - #endif +#else + WS._topic_description_status = + (char *)malloc(sizeof(char) * strlen(WS._username) + strlen("/wprsnpr/") + + strlen(_device_uid) + strlen(TOPIC_INFO) + + strlen("status/") + strlen("broker") + 1); +#endif if (WS._topic_description_status != NULL) { strcpy(WS._topic_description_status, WS._username); strcat(WS._topic_description_status, "/wprsnpr/"); @@ -1771,18 +1770,18 @@ bool Wippersnapper::generateWSTopics() { WS._mqtt->subscribe(_topic_description_sub); _topic_description_sub->setCallback(cbRegistrationStatus); - // Create registration status complete topic - #ifdef ARDUINO_ARCH_ESP32 +// Create registration status complete topic +#ifdef ARDUINO_ARCH_ESP32 WS._topic_description_status_complete = (char *)ps_malloc( sizeof(char) * strlen(WS._username) + strlen("/wprsnpr/") + strlen(_device_uid) + strlen(TOPIC_INFO) + strlen("status") + strlen("/device/complete") + 1); - #else - WS._topic_description_status_complete = (char *)malloc( - sizeof(char) * strlen(WS._username) + strlen("/wprsnpr/") + - strlen(_device_uid) + strlen(TOPIC_INFO) + strlen("status") + - strlen("/device/complete") + 1); - #endif +#else + WS._topic_description_status_complete = + (char *)malloc(sizeof(char) * strlen(WS._username) + strlen("/wprsnpr/") + + strlen(_device_uid) + strlen(TOPIC_INFO) + + strlen("status") + strlen("/device/complete") + 1); +#endif if (WS._topic_description_status_complete != NULL) { strcpy(WS._topic_description_status_complete, WS._username); strcat(WS._topic_description_status_complete, "/wprsnpr/"); @@ -1795,16 +1794,16 @@ bool Wippersnapper::generateWSTopics() { return false; } - // Create device-to-broker signal topic - #ifdef ARDUINO_ARCH_ESP32 +// Create device-to-broker signal topic +#ifdef ARDUINO_ARCH_ESP32 WS._topic_signal_device = (char *)ps_malloc( sizeof(char) * strlen(WS._username) + strlen("/wprsnpr/") + strlen(_device_uid) + strlen(TOPIC_SIGNALS) + strlen("device") + 1); - #else +#else WS._topic_signal_device = (char *)malloc( sizeof(char) * strlen(WS._username) + strlen("/wprsnpr/") + strlen(_device_uid) + strlen(TOPIC_SIGNALS) + strlen("device") + 1); - #endif +#endif if (WS._topic_signal_device != NULL) { strcpy(WS._topic_signal_device, WS._username); strcat(WS._topic_signal_device, "/wprsnpr/"); @@ -1816,18 +1815,18 @@ bool Wippersnapper::generateWSTopics() { return false; } - // Create pin configuration complete topic - #ifdef ARDUINO_ARCH_ESP32 +// Create pin configuration complete topic +#ifdef ARDUINO_ARCH_ESP32 WS._topic_device_pin_config_complete = (char *)ps_malloc( sizeof(char) * strlen(WS._username) + strlen("/wprsnpr/") + strlen(_device_uid) + strlen(TOPIC_SIGNALS) + strlen("device/pinConfigComplete") + 1); - #else - WS._topic_device_pin_config_complete = (char *)malloc( - sizeof(char) * strlen(WS._username) + strlen("/wprsnpr/") + - strlen(_device_uid) + strlen(TOPIC_SIGNALS) + - strlen("device/pinConfigComplete") + 1); - #endif +#else + WS._topic_device_pin_config_complete = + (char *)malloc(sizeof(char) * strlen(WS._username) + strlen("/wprsnpr/") + + strlen(_device_uid) + strlen(TOPIC_SIGNALS) + + strlen("device/pinConfigComplete") + 1); +#endif if (WS._topic_device_pin_config_complete != NULL) { strcpy(WS._topic_device_pin_config_complete, WS._username); strcat(WS._topic_device_pin_config_complete, "/wprsnpr/"); @@ -1840,16 +1839,16 @@ bool Wippersnapper::generateWSTopics() { return false; } - // Create broker-to-device signal topic - #ifdef ARDUINO_ARCH_ESP32 +// Create broker-to-device signal topic +#ifdef ARDUINO_ARCH_ESP32 WS._topic_signal_brkr = (char *)ps_malloc( sizeof(char) * strlen(WS._username) + strlen("/wprsnpr/") + strlen(_device_uid) + strlen(TOPIC_SIGNALS) + strlen("broker") + 1); - #else +#else WS._topic_signal_brkr = (char *)malloc( sizeof(char) * strlen(WS._username) + strlen("/wprsnpr/") + strlen(_device_uid) + strlen(TOPIC_SIGNALS) + strlen("broker") + 1); - #endif +#endif if (WS._topic_signal_brkr != NULL) { strcpy(WS._topic_signal_brkr, WS._username); strcat(WS._topic_signal_brkr, "/wprsnpr/"); @@ -1867,18 +1866,18 @@ bool Wippersnapper::generateWSTopics() { WS._mqtt->subscribe(_topic_signal_brkr_sub); _topic_signal_brkr_sub->setCallback(cbSignalTopic); - // Create device-to-broker i2c signal topic - #ifdef ARDUINO_ARCH_ESP32 +// Create device-to-broker i2c signal topic +#ifdef ARDUINO_ARCH_ESP32 WS._topic_signal_i2c_brkr = (char *)ps_malloc( sizeof(char) * strlen(WS._username) + +strlen("/") + strlen(_device_uid) + strlen("/wprsnpr/") + strlen(TOPIC_SIGNALS) + strlen("broker") + strlen(TOPIC_I2C) + 1); - #else +#else WS._topic_signal_i2c_brkr = (char *)malloc( sizeof(char) * strlen(WS._username) + +strlen("/") + strlen(_device_uid) + strlen("/wprsnpr/") + strlen(TOPIC_SIGNALS) + strlen("broker") + strlen(TOPIC_I2C) + 1); - #endif +#endif if (WS._topic_signal_i2c_brkr != NULL) { strcpy(WS._topic_signal_i2c_brkr, WS._username); strcat(WS._topic_signal_i2c_brkr, TOPIC_WS); @@ -1897,18 +1896,18 @@ bool Wippersnapper::generateWSTopics() { WS._mqtt->subscribe(_topic_signal_i2c_sub); _topic_signal_i2c_sub->setCallback(cbSignalI2CReq); - // Create broker-to-device i2c signal topic - #ifdef ARDUINO_ARCH_ESP32 +// Create broker-to-device i2c signal topic +#ifdef ARDUINO_ARCH_ESP32 WS._topic_signal_i2c_device = (char *)ps_malloc( sizeof(char) * strlen(WS._username) + +strlen("/") + strlen(_device_uid) + strlen("/wprsnpr/") + strlen(TOPIC_SIGNALS) + strlen("device") + strlen(TOPIC_I2C) + 1); - #else +#else WS._topic_signal_i2c_device = (char *)malloc( sizeof(char) * strlen(WS._username) + +strlen("/") + strlen(_device_uid) + strlen("/wprsnpr/") + strlen(TOPIC_SIGNALS) + strlen("device") + strlen(TOPIC_I2C) + 1); - #endif +#endif if (WS._topic_signal_i2c_device != NULL) { strcpy(WS._topic_signal_i2c_device, WS._username); strcat(WS._topic_signal_i2c_device, TOPIC_WS); @@ -1921,18 +1920,18 @@ bool Wippersnapper::generateWSTopics() { return false; } - // Create device-to-broker ds18x20 topic - #ifdef ARDUINO_ARCH_ESP32 +// Create device-to-broker ds18x20 topic +#ifdef ARDUINO_ARCH_ESP32 WS._topic_signal_ds18_brkr = (char *)ps_malloc( sizeof(char) * strlen(WS._username) + +strlen("/") + strlen(_device_uid) + strlen("/wprsnpr/") + strlen(TOPIC_SIGNALS) + strlen("broker/") + strlen("ds18x20") + 1); - #else +#else WS._topic_signal_ds18_brkr = (char *)malloc( sizeof(char) * strlen(WS._username) + +strlen("/") + strlen(_device_uid) + strlen("/wprsnpr/") + strlen(TOPIC_SIGNALS) + strlen("broker/") + strlen("ds18x20") + 1); - #endif +#endif if (WS._topic_signal_ds18_brkr != NULL) { strcpy(WS._topic_signal_ds18_brkr, WS._username); strcat(WS._topic_signal_ds18_brkr, TOPIC_WS); @@ -1950,18 +1949,18 @@ bool Wippersnapper::generateWSTopics() { WS._mqtt->subscribe(_topic_signal_ds18_sub); _topic_signal_ds18_sub->setCallback(cbSignalDSReq); - // Create broker-to-device ds18x20 topic - #ifdef ARDUINO_ARCH_ESP32 +// Create broker-to-device ds18x20 topic +#ifdef ARDUINO_ARCH_ESP32 WS._topic_signal_ds18_device = (char *)ps_malloc( sizeof(char) * strlen(WS._username) + +strlen("/") + strlen(_device_uid) + strlen("/wprsnpr/") + strlen(TOPIC_SIGNALS) + strlen("device/") + strlen("ds18x20") + 1); - #else +#else WS._topic_signal_ds18_device = (char *)malloc( sizeof(char) * strlen(WS._username) + +strlen("/") + strlen(_device_uid) + strlen("/wprsnpr/") + strlen(TOPIC_SIGNALS) + strlen("device/") + strlen("ds18x20") + 1); - #endif +#endif if (WS._topic_signal_ds18_device != NULL) { strcpy(WS._topic_signal_ds18_device, WS._username); strcat(WS._topic_signal_ds18_device, TOPIC_WS); @@ -1973,16 +1972,16 @@ bool Wippersnapper::generateWSTopics() { return false; } - // Create device-to-broker servo signal topic - #ifdef ARDUINO_ARCH_ESP32 +// Create device-to-broker servo signal topic +#ifdef ARDUINO_ARCH_ESP32 WS._topic_signal_servo_brkr = (char *)ps_malloc( sizeof(char) * strlen(WS._username) + strlen("/") + strlen(_device_uid) + strlen("/wprsnpr/signals/broker/servo") + 1); - #else +#else WS._topic_signal_servo_brkr = (char *)malloc( sizeof(char) * strlen(WS._username) + strlen("/") + strlen(_device_uid) + strlen("/wprsnpr/signals/broker/servo") + 1); - #endif +#endif if (WS._topic_signal_servo_brkr != NULL) { strcpy(WS._topic_signal_servo_brkr, WS._username); strcat(WS._topic_signal_servo_brkr, TOPIC_WS); @@ -2000,16 +1999,16 @@ bool Wippersnapper::generateWSTopics() { WS._mqtt->subscribe(_topic_signal_servo_sub); _topic_signal_servo_sub->setCallback(cbServoMsg); - // Create broker-to-device servo signal topic - #ifdef ARDUINO_ARCH_ESP32 +// Create broker-to-device servo signal topic +#ifdef ARDUINO_ARCH_ESP32 WS._topic_signal_servo_device = (char *)ps_malloc( sizeof(char) * strlen(WS._username) + strlen("/") + strlen(_device_uid) + strlen("/wprsnpr/signals/device/servo") + 1); - #else +#else WS._topic_signal_servo_device = (char *)malloc( sizeof(char) * strlen(WS._username) + strlen("/") + strlen(_device_uid) + strlen("/wprsnpr/signals/device/servo") + 1); - #endif +#endif if (WS._topic_signal_servo_device != NULL) { strcpy(WS._topic_signal_servo_device, WS._username); strcat(WS._topic_signal_servo_device, TOPIC_WS); @@ -2021,16 +2020,16 @@ bool Wippersnapper::generateWSTopics() { return false; } - // Topic for pwm messages from broker->device - #ifdef ARDUINO_ARCH_ESP32 +// Topic for pwm messages from broker->device +#ifdef ARDUINO_ARCH_ESP32 WS._topic_signal_pwm_brkr = (char *)ps_malloc( sizeof(char) * strlen(WS._username) + strlen("/") + strlen(_device_uid) + strlen("/wprsnpr/signals/broker/pwm") + 1); - #else +#else WS._topic_signal_pwm_brkr = (char *)malloc( sizeof(char) * strlen(WS._username) + strlen("/") + strlen(_device_uid) + strlen("/wprsnpr/signals/broker/pwm") + 1); - #endif +#endif // Create device-to-broker pwm signal topic if (WS._topic_signal_pwm_brkr != NULL) { strcpy(WS._topic_signal_pwm_brkr, WS._username); @@ -2049,16 +2048,16 @@ bool Wippersnapper::generateWSTopics() { WS._mqtt->subscribe(_topic_signal_pwm_sub); _topic_signal_pwm_sub->setCallback(cbPWMMsg); - // Topic for pwm messages from device->broker - #ifdef ARDUINO_ARCH_ESP32 +// Topic for pwm messages from device->broker +#ifdef ARDUINO_ARCH_ESP32 WS._topic_signal_pwm_device = (char *)ps_malloc( sizeof(char) * strlen(WS._username) + strlen("/") + strlen(_device_uid) + strlen("/wprsnpr/signals/device/pwm") + 1); - #else +#else WS._topic_signal_pwm_device = (char *)malloc( sizeof(char) * strlen(WS._username) + strlen("/") + strlen(_device_uid) + strlen("/wprsnpr/signals/device/pwm") + 1); - #endif +#endif if (WS._topic_signal_pwm_device != NULL) { strcpy(WS._topic_signal_pwm_device, WS._username); strcat(WS._topic_signal_pwm_device, TOPIC_WS); @@ -2070,16 +2069,16 @@ bool Wippersnapper::generateWSTopics() { return false; } - // Topic for pixel messages from broker->device - #ifdef ARDUINO_ARCH_ESP32 +// Topic for pixel messages from broker->device +#ifdef ARDUINO_ARCH_ESP32 WS._topic_signal_pixels_brkr = (char *)ps_malloc( sizeof(char) * strlen(WS._username) + strlen("/") + strlen(_device_uid) + strlen("/wprsnpr/signals/broker/pixels") + 1); - #else - WS._topic_signal_pixels_brkr = (char *)malloc( +#else + WS._topic_signal_pixels_brkr = (char *)malloc( sizeof(char) * strlen(WS._username) + strlen("/") + strlen(_device_uid) + strlen("/wprsnpr/signals/broker/pixels") + 1); - #endif +#endif if (WS._topic_signal_pixels_brkr != NULL) { strcpy(WS._topic_signal_pixels_brkr, WS._username); strcat(WS._topic_signal_pixels_brkr, TOPIC_WS); @@ -2096,16 +2095,16 @@ bool Wippersnapper::generateWSTopics() { WS._mqtt->subscribe(_topic_signal_pixels_sub); _topic_signal_pixels_sub->setCallback(cbPixelsMsg); - // Topic for pixel messages from device->broker - #ifdef ARDUINO_ARCH_ESP32 +// Topic for pixel messages from device->broker +#ifdef ARDUINO_ARCH_ESP32 WS._topic_signal_pixels_device = (char *)ps_malloc( sizeof(char) * strlen(WS._username) + strlen("/") + strlen(_device_uid) + strlen("/wprsnpr/signals/device/pixels") + 1); - #else - WS._topic_signal_pixels_device = (char *)malloc( +#else + WS._topic_signal_pixels_device = (char *)malloc( sizeof(char) * strlen(WS._username) + strlen("/") + strlen(_device_uid) + strlen("/wprsnpr/signals/device/pixels") + 1); - #endif +#endif if (WS._topic_signal_pixels_device != NULL) { strcpy(WS._topic_signal_pixels_device, WS._username); strcat(WS._topic_signal_pixels_device, TOPIC_WS); diff --git a/src/Wippersnapper.h b/src/Wippersnapper.h index e3584cea1..ba04da61c 100644 --- a/src/Wippersnapper.h +++ b/src/Wippersnapper.h @@ -321,15 +321,15 @@ class Wippersnapper { Wippersnapper_FS *_fileSystem; ///< Instance of Filesystem (native USB) WipperSnapper_LittleFS *_littleFS; ///< Instance of LittleFS Filesystem (non-native USB) - #ifdef USE_DISPLAY +#ifdef USE_DISPLAY ws_display_driver *_display = nullptr; ///< Instance of display driver class - ws_display_ui_helper *_ui_helper = nullptr; ///< Instance of display UI helper class - #endif - ws_pixels *_ws_pixelsComponent; ///< ptr to instance of ws_pixels class - ws_pwm *_pwmComponent; ///< Instance of pwm class - ws_servo *_servoComponent; ///< Instance of servo class - ws_ds18x20 *_ds18x20Component; ///< Instance of DS18x20 class - + ws_display_ui_helper *_ui_helper = + nullptr; ///< Instance of display UI helper class +#endif + ws_pixels *_ws_pixelsComponent; ///< ptr to instance of ws_pixels class + ws_pwm *_pwmComponent; ///< Instance of pwm class + ws_servo *_servoComponent; ///< Instance of servo class + ws_ds18x20 *_ds18x20Component; ///< Instance of DS18x20 class // TODO: does this really need to be global? uint8_t _macAddr[6]; /*!< Unique network iface identifier */ diff --git a/src/display/symbols/cloud_30px.c b/src/display/symbols/cloud_30px.c index 4a4db8c30..9f41981db 100644 --- a/src/display/symbols/cloud_30px.c +++ b/src/display/symbols/cloud_30px.c @@ -1,7 +1,7 @@ /******************************************************************************* * Size: 30 px * Bpp: 4 - * Opts: + * Opts: ******************************************************************************/ #ifdef ARDUINO_FUNHOUSE_ESP32S2 @@ -25,99 +25,81 @@ /*Store the image of the glyphs*/ static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = { /* U+F0C2 "" */ - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3, 0x67, - 0x63, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x19, 0xef, 0xff, 0xff, 0xe9, 0x10, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x5, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xf6, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x6f, 0xff, 0xfa, - 0x75, 0x7a, 0xff, 0xff, 0x73, 0x8a, 0x96, 0x10, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x4, - 0xff, 0xfc, 0x20, 0x0, 0x0, 0x1c, 0xff, 0xff, - 0xff, 0xff, 0xf7, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0xe, 0xff, 0x90, 0x0, 0x0, 0x0, - 0x0, 0x8f, 0xff, 0xff, 0xff, 0x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0, 0x0, 0x5f, 0xf8, 0xbf, 0xf4, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x9f, 0xf6, 0x6f, 0xfd, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0xff, 0xf1, 0xe, 0xff, + 0x90, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x1b, 0xff, 0x90, 0x4, 0xff, 0xfd, 0x52, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x15, 0xef, 0xfe, 0x0, + 0x0, 0x6f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xe3, 0x0, 0x0, 0x4, 0xdf, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfb, + 0x10, 0x0, 0x0, 0x0, 0x4, 0x9c, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, + 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xc9, 0x40, 0x0, 0x0}; /*--------------------- * GLYPH DESCRIPTION *--------------------*/ static const lv_font_fmt_txt_glyph_dsc_t glyph_dsc[] = { - {.bitmap_index = 0, .adv_w = 0, .box_w = 0, .box_h = 0, .ofs_x = 0, .ofs_y = 0} /* id = 0 reserved */, - {.bitmap_index = 0, .adv_w = 600, .box_w = 38, .box_h = 27, .ofs_x = 0, .ofs_y = -2} -}; + {.bitmap_index = 0, + .adv_w = 0, + .box_w = 0, + .box_h = 0, + .ofs_x = 0, + .ofs_y = 0} /* id = 0 reserved */, + {.bitmap_index = 0, + .adv_w = 600, + .box_w = 38, + .box_h = 27, + .ofs_x = 0, + .ofs_y = -2}}; /*--------------------- * CHARACTER MAPPING *--------------------*/ - - /*Collect the unicode lists and glyph_id offsets*/ -static const lv_font_fmt_txt_cmap_t cmaps[] = -{ - { - .range_start = 61634, .range_length = 1, .glyph_id_start = 1, - .unicode_list = NULL, .glyph_id_ofs_list = NULL, .list_length = 0, .type = LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY - } -}; - - +static const lv_font_fmt_txt_cmap_t cmaps[] = { + {.range_start = 61634, + .range_length = 1, + .glyph_id_start = 1, + .unicode_list = NULL, + .glyph_id_ofs_list = NULL, + .list_length = 0, + .type = LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY}}; /*-------------------- * ALL CUSTOM DATA @@ -125,7 +107,7 @@ static const lv_font_fmt_txt_cmap_t cmaps[] = #if LV_VERSION_CHECK(8, 0, 0) /*Store all the custom data of the font*/ -static lv_font_fmt_txt_glyph_cache_t cache; +static lv_font_fmt_txt_glyph_cache_t cache; static const lv_font_fmt_txt_dsc_t font_dsc = { #else static lv_font_fmt_txt_dsc_t font_dsc = { @@ -144,7 +126,6 @@ static lv_font_fmt_txt_dsc_t font_dsc = { #endif }; - /*----------------- * PUBLIC FONT *----------------*/ @@ -155,10 +136,12 @@ const lv_font_t cloud_30px = { #else lv_font_t cloud_30px = { #endif - .get_glyph_dsc = lv_font_get_glyph_dsc_fmt_txt, /*Function pointer to get glyph's data*/ - .get_glyph_bitmap = lv_font_get_bitmap_fmt_txt, /*Function pointer to get glyph's bitmap*/ - .line_height = 27, /*The maximum line height required by the font*/ - .base_line = 2, /*Baseline measured from the bottom of the line*/ + .get_glyph_dsc = + lv_font_get_glyph_dsc_fmt_txt, /*Function pointer to get glyph's data*/ + .get_glyph_bitmap = + lv_font_get_bitmap_fmt_txt, /*Function pointer to get glyph's bitmap*/ + .line_height = 27, /*The maximum line height required by the font*/ + .base_line = 2, /*Baseline measured from the bottom of the line*/ #if !(LVGL_VERSION_MAJOR == 6 && LVGL_VERSION_MINOR == 0) .subpx = LV_FONT_SUBPX_NONE, #endif @@ -166,11 +149,10 @@ lv_font_t cloud_30px = { .underline_position = 0, .underline_thickness = 0, #endif - .dsc = &font_dsc /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */ + .dsc = &font_dsc /*The custom font data. Will be accessed by + `get_glyph_bitmap/dsc` */ }; - - #endif /*#if CLOUD_30PX*/ #endif \ No newline at end of file diff --git a/src/display/symbols/errorTriangle.c b/src/display/symbols/errorTriangle.c index cfca9254a..c4d108750 100644 --- a/src/display/symbols/errorTriangle.c +++ b/src/display/symbols/errorTriangle.c @@ -1,7 +1,7 @@ /******************************************************************************* * Size: 100 px * Bpp: 4 - * Opts: + * Opts: ******************************************************************************/ #ifdef ARDUINO_FUNHOUSE_ESP32S2 #ifdef LV_LVGL_H_INCLUDE_SIMPLE @@ -23,602 +23,417 @@ /*Store the image of the glyphs*/ static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = { /* U+F071 "" */ - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x11, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x4, 0xbf, 0xff, 0xea, 0x30, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0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x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0xc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0x50, 0x0, 0x0, 0x0, 0x5, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0x90, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x5f, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0x50, 0x0, 0x0, - 0x0, 0x5, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xf2, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xef, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0x50, 0x0, 0x0, 0x0, 0x5, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfb, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0x50, 0x0, 0x0, 0x0, 0x5, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0x50, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x2f, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x50, 0x0, - 0x0, 0x0, 0x5, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xbf, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0x50, 0x0, 0x0, 0x0, 0x5, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xf8, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x4, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0x50, 0x0, 0x0, 0x0, - 0x5, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0x20, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0xd, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x50, - 0x0, 0x0, 0x0, 0x5, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xb0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x7f, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0x50, 0x0, 0x0, 0x0, 0x5, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xf4, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x1, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0x50, 0x0, 0x0, - 0x0, 0x5, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xfd, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0xa, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0x50, 0x0, 0x0, 0x0, 0x5, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0x70, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3f, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0x50, 0x0, 0x0, 0x0, 0x5, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xf1, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0xdf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x50, 0x0, - 0x0, 0x0, 0x5, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfa, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x6, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0x50, 0x0, 0x0, 0x0, 0x5, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0x30, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1e, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0x50, 0x0, 0x0, 0x0, - 0x5, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x9f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x50, - 0x0, 0x0, 0x0, 0x5, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xf6, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x3, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0x50, 0x0, 0x0, 0x0, 0x5, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xfe, 0x10, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0x50, 0x0, 0x0, - 0x0, 0x5, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0x90, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x5f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0x50, 0x0, 0x0, 0x0, 0x5, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xf2, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0xef, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0x50, 0x0, 0x0, 0x0, 0x5, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x8, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0x0, - 0x0, 0x0, 0x8, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0x50, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x2f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xd0, 0x0, 0x0, 0x0, 0xd, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0xbf, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xf8, 0x0, 0x0, 0x0, - 0x9f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xf8, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x4, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xb4, 0x11, 0x4c, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0x20, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0xd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xb0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x7f, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xf4, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xfd, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0xa, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0x70, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x4f, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xf1, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xdf, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfa, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x6, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xc7, 0x44, 0x7d, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0x30, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x1f, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf7, - 0x0, 0x0, 0x0, 0x8f, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xd0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x9f, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0x40, 0x0, 0x0, 0x0, 0x5, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xf6, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x3, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xf9, 0x0, 0x0, 0x0, - 0x0, 0x0, 0xaf, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xfe, 0x10, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0xc, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf2, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x1f, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0x90, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x6f, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xe0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0xd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xf3, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0xef, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0xc, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x8, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xf0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xe, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0x50, 0x0, 0x0, 0x0, 0x0, 0x2f, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xf2, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x2f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x0, 0x0, - 0x0, 0x0, 0xbf, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfa, 0x0, - 0x0, 0x0, 0x0, 0x0, 0xbf, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xf8, 0x0, 0x0, 0x0, 0x5, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0x60, 0x0, 0x0, 0x0, 0x7, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0x20, 0x0, 0x0, 0xe, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xf9, 0x0, 0x0, - 0x1, 0xaf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xb0, - 0x0, 0x0, 0x8f, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xfb, 0x88, 0xbf, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xf4, 0x0, 0x1, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xfd, 0x0, 0x7, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0x40, 0xc, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0x90, 0xf, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc0, - 0xf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xd0, 0xe, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xb0, 0xb, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0x80, 0x4, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0x10, 0x0, 0xcf, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xf9, 0x0, 0x0, - 0x1e, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xc0, 0x0, 0x0, 0x1, 0xcf, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xfa, 0x0, 0x0, 0x0, 0x0, 0x5, - 0xbe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 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x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xbf, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0x50, 0x0, 0x0, 0x0, 0x5, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x4, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x50, 0x0, 0x0, 0x0, + 0x5, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0x20, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xd, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x50, + 0x0, 0x0, 0x0, 0x5, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xb0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0x50, 0x0, 0x0, 0x0, 0x5, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf4, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x1, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0x50, 0x0, 0x0, 0x0, 0x5, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfd, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xa, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x50, 0x0, 0x0, 0x0, + 0x5, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0x70, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3f, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x50, + 0x0, 0x0, 0x0, 0x5, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xf1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0xdf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0x50, 0x0, 0x0, 0x0, 0x5, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfa, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x6, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0x50, 0x0, 0x0, 0x0, 0x5, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x30, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1e, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x50, 0x0, 0x0, 0x0, + 0x5, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xc0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x9f, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x50, + 0x0, 0x0, 0x0, 0x5, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xf6, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0x50, 0x0, 0x0, 0x0, 0x5, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x10, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0xc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0x50, 0x0, 0x0, 0x0, 0x5, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0x90, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x5f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x50, 0x0, 0x0, 0x0, + 0x5, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xf2, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xef, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x50, + 0x0, 0x0, 0x0, 0x5, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x8, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0x80, 0x0, 0x0, 0x0, 0x8, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x50, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x2f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xd0, 0x0, 0x0, 0x0, 0xd, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xe0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0xbf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x0, 0x0, 0x0, + 0x9f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xf8, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x4, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xb4, 0x11, 0x4c, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x20, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xd, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xb0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xf4, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x1, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xfd, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0xa, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x70, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x4f, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xf1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xdf, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xfa, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x6, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc7, 0x44, 0x7d, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x30, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf7, + 0x0, 0x0, 0x0, 0x8f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xd0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x9f, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0x40, 0x0, 0x0, 0x0, 0x5, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xf6, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xf9, 0x0, 0x0, 0x0, 0x0, 0x0, 0xaf, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xfe, 0x10, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0xc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf2, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x90, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x6f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0xd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf3, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xef, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xc0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xfc, 0x0, 0x0, 0x0, 0x0, 0x0, 0x8, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xf0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xe, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x50, 0x0, 0x0, 0x0, 0x0, 0x2f, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf2, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x2f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x0, 0x0, + 0x0, 0x0, 0xbf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfa, 0x0, + 0x0, 0x0, 0x0, 0x0, 0xbf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xf8, 0x0, 0x0, 0x0, 0x5, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0x60, 0x0, 0x0, 0x0, 0x7, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0x20, 0x0, 0x0, 0xe, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xf9, 0x0, 0x0, 0x1, 0xaf, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xb0, 0x0, 0x0, 0x8f, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfb, 0x88, 0xbf, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf4, 0x0, + 0x1, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xfd, 0x0, 0x7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0x40, 0xc, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x90, 0xf, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc0, + 0xf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xd0, 0xe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xb0, 0xb, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0x4, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x10, + 0x0, 0xcf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xf9, 0x0, 0x0, 0x1e, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xc0, 0x0, 0x0, 0x1, 0xcf, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfa, 0x0, 0x0, 0x0, 0x0, 0x5, + 0xbe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xea, 0x40, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0}; /*--------------------- * GLYPH DESCRIPTION *--------------------*/ static const lv_font_fmt_txt_glyph_dsc_t glyph_dsc[] = { - {.bitmap_index = 0, .adv_w = 0, .box_w = 0, .box_h = 0, .ofs_x = 0, .ofs_y = 0} /* id = 0 reserved */, - {.bitmap_index = 0, .adv_w = 1600, .box_w = 102, .box_h = 89, .ofs_x = -1, .ofs_y = -7} -}; + {.bitmap_index = 0, + .adv_w = 0, + .box_w = 0, + .box_h = 0, + .ofs_x = 0, + .ofs_y = 0} /* id = 0 reserved */, + {.bitmap_index = 0, + .adv_w = 1600, + .box_w = 102, + .box_h = 89, + .ofs_x = -1, + .ofs_y = -7}}; /*--------------------- * CHARACTER MAPPING *--------------------*/ - - /*Collect the unicode lists and glyph_id offsets*/ -static const lv_font_fmt_txt_cmap_t cmaps[] = -{ - { - .range_start = 61553, .range_length = 1, .glyph_id_start = 1, - .unicode_list = NULL, .glyph_id_ofs_list = NULL, .list_length = 0, .type = LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY - } -}; - - +static const lv_font_fmt_txt_cmap_t cmaps[] = { + {.range_start = 61553, + .range_length = 1, + .glyph_id_start = 1, + .unicode_list = NULL, + .glyph_id_ofs_list = NULL, + .list_length = 0, + .type = LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY}}; /*-------------------- * ALL CUSTOM DATA @@ -626,7 +441,7 @@ static const lv_font_fmt_txt_cmap_t cmaps[] = #if LV_VERSION_CHECK(8, 0, 0) /*Store all the custom data of the font*/ -static lv_font_fmt_txt_glyph_cache_t cache; +static lv_font_fmt_txt_glyph_cache_t cache; static const lv_font_fmt_txt_dsc_t font_dsc = { #else static lv_font_fmt_txt_dsc_t font_dsc = { @@ -645,7 +460,6 @@ static lv_font_fmt_txt_dsc_t font_dsc = { #endif }; - /*----------------- * PUBLIC FONT *----------------*/ @@ -656,10 +470,12 @@ const lv_font_t errorTriangle = { #else lv_font_t errorTriangle = { #endif - .get_glyph_dsc = lv_font_get_glyph_dsc_fmt_txt, /*Function pointer to get glyph's data*/ - .get_glyph_bitmap = lv_font_get_bitmap_fmt_txt, /*Function pointer to get glyph's bitmap*/ - .line_height = 89, /*The maximum line height required by the font*/ - .base_line = 7, /*Baseline measured from the bottom of the line*/ + .get_glyph_dsc = + lv_font_get_glyph_dsc_fmt_txt, /*Function pointer to get glyph's data*/ + .get_glyph_bitmap = + lv_font_get_bitmap_fmt_txt, /*Function pointer to get glyph's bitmap*/ + .line_height = 89, /*The maximum line height required by the font*/ + .base_line = 7, /*Baseline measured from the bottom of the line*/ #if !(LVGL_VERSION_MAJOR == 6 && LVGL_VERSION_MINOR == 0) .subpx = LV_FONT_SUBPX_NONE, #endif @@ -667,11 +483,10 @@ lv_font_t errorTriangle = { .underline_position = 0, .underline_thickness = 0, #endif - .dsc = &font_dsc /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */ + .dsc = &font_dsc /*The custom font data. Will be accessed by + `get_glyph_bitmap/dsc` */ }; - - #endif /*#if ERRORTRIANGLE*/ #endif \ No newline at end of file diff --git a/src/display/symbols/file.c b/src/display/symbols/file.c index c38746792..071f76efa 100644 --- a/src/display/symbols/file.c +++ b/src/display/symbols/file.c @@ -1,7 +1,7 @@ /******************************************************************************* * Size: 30 px * Bpp: 4 - * Opts: + * Opts: ******************************************************************************/ #ifdef ARDUINO_FUNHOUSE_ESP32S2 @@ -24,79 +24,68 @@ /*Store the image of the glyphs*/ static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = { /* U+F1C9 "" */ - 0x0, 0x3, 0x33, 0x33, 0x33, 0x33, 0x30, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x6f, 0xff, 0xff, 0xff, - 0xff, 0xff, 0x10, 0xb0, 0x0, 0x0, 0x0, 0x5f, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xf1, 0xf, 0xb0, - 0x0, 0x0, 0xc, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0x10, 0xff, 0xb0, 0x0, 0x0, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xf1, 0xf, 0xff, 0xb0, - 0x0, 0xf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0x10, 0xff, 0xff, 0xb0, 0x0, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xf1, 0xf, 0xff, 0xff, 0xb0, - 0xf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x10, - 0xff, 0xff, 0xff, 0xb0, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xf2, 0x3, 0x33, 0x33, 0x33, 0x1f, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xa0, 0x0, - 0x0, 0x0, 0x0, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xfd, 0xdd, 0xdd, 0xdd, 0x7f, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0x8f, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0x8f, 0xff, 0xff, 0xff, - 0x89, 0xff, 0xff, 0xd6, 0xcf, 0xff, 0xff, 0xf8, - 0xff, 0xff, 0xff, 0x40, 0xc, 0xff, 0xf3, 0x0, - 0xaf, 0xff, 0xff, 0x8f, 0xff, 0xff, 0x40, 0x1, - 0xff, 0xff, 0x70, 0x0, 0xaf, 0xff, 0xf8, 0xff, - 0xff, 0x40, 0x0, 0xcf, 0xff, 0xff, 0x50, 0x0, - 0xbf, 0xff, 0x8f, 0xff, 0xd0, 0x0, 0x9f, 0xff, - 0xff, 0xff, 0x20, 0x4, 0xff, 0xf8, 0xff, 0xff, - 0x30, 0x1, 0xdf, 0xff, 0xff, 0x60, 0x0, 0xaf, - 0xff, 0x8f, 0xff, 0xfe, 0x20, 0x1, 0xff, 0xff, - 0x80, 0x0, 0x9f, 0xff, 0xf8, 0xff, 0xff, 0xfe, - 0x20, 0xb, 0xff, 0xf3, 0x0, 0x9f, 0xff, 0xff, - 0x8f, 0xff, 0xff, 0xfe, 0x66, 0xff, 0xff, 0xb4, - 0xaf, 0xff, 0xff, 0xf8, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x8f, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x8e, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xf7, 0xaf, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0x31, 0xef, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0x80, 0x1, 0x8c, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, - 0xcc, 0xcc, 0xca, 0x50, 0x0 -}; - + 0x0, 0x3, 0x33, 0x33, 0x33, 0x33, 0x30, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x6f, 0xff, 0xff, 0xff, 0xff, 0xff, 0x10, 0xb0, 0x0, 0x0, 0x0, 0x5f, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xf1, 0xf, 0xb0, 0x0, 0x0, 0xc, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0x10, 0xff, 0xb0, 0x0, 0x0, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xf1, 0xf, 0xff, 0xb0, 0x0, 0xf, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0x10, 0xff, 0xff, 0xb0, 0x0, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xf1, 0xf, 0xff, 0xff, 0xb0, 0xf, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x10, 0xff, 0xff, 0xff, 0xb0, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xf2, 0x3, 0x33, 0x33, 0x33, 0x1f, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xa0, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xfd, 0xdd, 0xdd, 0xdd, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0x8f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0x8f, 0xff, 0xff, 0xff, 0x89, 0xff, 0xff, 0xd6, + 0xcf, 0xff, 0xff, 0xf8, 0xff, 0xff, 0xff, 0x40, 0xc, 0xff, 0xf3, 0x0, + 0xaf, 0xff, 0xff, 0x8f, 0xff, 0xff, 0x40, 0x1, 0xff, 0xff, 0x70, 0x0, + 0xaf, 0xff, 0xf8, 0xff, 0xff, 0x40, 0x0, 0xcf, 0xff, 0xff, 0x50, 0x0, + 0xbf, 0xff, 0x8f, 0xff, 0xd0, 0x0, 0x9f, 0xff, 0xff, 0xff, 0x20, 0x4, + 0xff, 0xf8, 0xff, 0xff, 0x30, 0x1, 0xdf, 0xff, 0xff, 0x60, 0x0, 0xaf, + 0xff, 0x8f, 0xff, 0xfe, 0x20, 0x1, 0xff, 0xff, 0x80, 0x0, 0x9f, 0xff, + 0xf8, 0xff, 0xff, 0xfe, 0x20, 0xb, 0xff, 0xf3, 0x0, 0x9f, 0xff, 0xff, + 0x8f, 0xff, 0xff, 0xfe, 0x66, 0xff, 0xff, 0xb4, 0xaf, 0xff, 0xff, 0xf8, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x8f, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x8e, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf7, 0xaf, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x31, 0xef, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0x1, 0x8c, 0xcc, + 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xca, 0x50, 0x0}; /*--------------------- * GLYPH DESCRIPTION *--------------------*/ static const lv_font_fmt_txt_glyph_dsc_t glyph_dsc[] = { - {.bitmap_index = 0, .adv_w = 0, .box_w = 0, .box_h = 0, .ofs_x = 0, .ofs_y = 0} /* id = 0 reserved */, - {.bitmap_index = 0, .adv_w = 360, .box_w = 23, .box_h = 31, .ofs_x = 0, .ofs_y = -4} -}; + {.bitmap_index = 0, + .adv_w = 0, + .box_w = 0, + .box_h = 0, + .ofs_x = 0, + .ofs_y = 0} /* id = 0 reserved */, + {.bitmap_index = 0, + .adv_w = 360, + .box_w = 23, + .box_h = 31, + .ofs_x = 0, + .ofs_y = -4}}; /*--------------------- * CHARACTER MAPPING *--------------------*/ - - /*Collect the unicode lists and glyph_id offsets*/ -static const lv_font_fmt_txt_cmap_t cmaps[] = -{ - { - .range_start = 61897, .range_length = 1, .glyph_id_start = 1, - .unicode_list = NULL, .glyph_id_ofs_list = NULL, .list_length = 0, .type = LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY - } -}; - - +static const lv_font_fmt_txt_cmap_t cmaps[] = { + {.range_start = 61897, + .range_length = 1, + .glyph_id_start = 1, + .unicode_list = NULL, + .glyph_id_ofs_list = NULL, + .list_length = 0, + .type = LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY}}; /*-------------------- * ALL CUSTOM DATA @@ -104,7 +93,7 @@ static const lv_font_fmt_txt_cmap_t cmaps[] = #if LV_VERSION_CHECK(8, 0, 0) /*Store all the custom data of the font*/ -static lv_font_fmt_txt_glyph_cache_t cache; +static lv_font_fmt_txt_glyph_cache_t cache; static const lv_font_fmt_txt_dsc_t font_dsc = { #else static lv_font_fmt_txt_dsc_t font_dsc = { @@ -123,7 +112,6 @@ static lv_font_fmt_txt_dsc_t font_dsc = { #endif }; - /*----------------- * PUBLIC FONT *----------------*/ @@ -134,10 +122,12 @@ const lv_font_t file = { #else lv_font_t file = { #endif - .get_glyph_dsc = lv_font_get_glyph_dsc_fmt_txt, /*Function pointer to get glyph's data*/ - .get_glyph_bitmap = lv_font_get_bitmap_fmt_txt, /*Function pointer to get glyph's bitmap*/ - .line_height = 31, /*The maximum line height required by the font*/ - .base_line = 4, /*Baseline measured from the bottom of the line*/ + .get_glyph_dsc = + lv_font_get_glyph_dsc_fmt_txt, /*Function pointer to get glyph's data*/ + .get_glyph_bitmap = + lv_font_get_bitmap_fmt_txt, /*Function pointer to get glyph's bitmap*/ + .line_height = 31, /*The maximum line height required by the font*/ + .base_line = 4, /*Baseline measured from the bottom of the line*/ #if !(LVGL_VERSION_MAJOR == 6 && LVGL_VERSION_MINOR == 0) .subpx = LV_FONT_SUBPX_NONE, #endif @@ -145,10 +135,10 @@ lv_font_t file = { .underline_position = 0, .underline_thickness = 0, #endif - .dsc = &font_dsc /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */ + .dsc = &font_dsc /*The custom font data. Will be accessed by + `get_glyph_bitmap/dsc` */ }; #endif #endif /*#if FILE*/ - diff --git a/src/display/symbols/turtle_16.c b/src/display/symbols/turtle_16.c index c3cd97039..0729e503a 100644 --- a/src/display/symbols/turtle_16.c +++ b/src/display/symbols/turtle_16.c @@ -1,7 +1,7 @@ /******************************************************************************* * Size: 16 px * Bpp: 4 - * Opts: + * Opts: ******************************************************************************/ #ifdef ARDUINO_FUNHOUSE_ESP32S2 #ifdef LV_LVGL_H_INCLUDE_SIMPLE @@ -23,50 +23,49 @@ /*Store the image of the glyphs*/ static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = { /* U+F726 "" */ - 0x0, 0x1, 0x9c, 0xfc, 0x91, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x4e, 0xff, 0xff, 0xfe, 0x30, 0x0, - 0x0, 0x0, 0x1, 0xef, 0xff, 0xff, 0xff, 0xe1, - 0x8, 0x86, 0x10, 0x9, 0xff, 0xff, 0xff, 0xff, - 0xf9, 0xf, 0xff, 0xe3, 0xc, 0xff, 0xff, 0xff, - 0xff, 0xfc, 0xf, 0xff, 0xfc, 0xf, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xf, 0xf8, 0xff, 0xf, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xf, 0xff, 0xff, 0xf, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xf, 0xff, 0xff, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xf, 0xf0, - 0x0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xf0, 0x0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xf0, 0x0, 0x0, 0xff, 0xff, 0xf, 0xff, - 0xf0, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff, 0xf, - 0xff, 0xf0, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff, - 0xf, 0xff, 0xf0, 0x0, 0x0, 0x0 -}; - + 0x0, 0x1, 0x9c, 0xfc, 0x91, 0x0, 0x0, 0x0, 0x0, 0x0, 0x4e, 0xff, + 0xff, 0xfe, 0x30, 0x0, 0x0, 0x0, 0x1, 0xef, 0xff, 0xff, 0xff, 0xe1, + 0x8, 0x86, 0x10, 0x9, 0xff, 0xff, 0xff, 0xff, 0xf9, 0xf, 0xff, 0xe3, + 0xc, 0xff, 0xff, 0xff, 0xff, 0xfc, 0xf, 0xff, 0xfc, 0xf, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xf, 0xf8, 0xff, 0xf, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xf, 0xff, 0xff, 0xf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf, 0xff, 0xff, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xf, 0xf0, 0x0, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xf0, 0x0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xf0, 0x0, 0x0, 0xff, 0xff, 0xf, 0xff, 0xf0, 0x0, 0x0, 0x0, + 0x0, 0xff, 0xff, 0xf, 0xff, 0xf0, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff, + 0xf, 0xff, 0xf0, 0x0, 0x0, 0x0}; /*--------------------- * GLYPH DESCRIPTION *--------------------*/ static const lv_font_fmt_txt_glyph_dsc_t glyph_dsc[] = { - {.bitmap_index = 0, .adv_w = 0, .box_w = 0, .box_h = 0, .ofs_x = 0, .ofs_y = 0} /* id = 0 reserved */, - {.bitmap_index = 0, .adv_w = 288, .box_w = 18, .box_h = 14, .ofs_x = 0, .ofs_y = -1} -}; + {.bitmap_index = 0, + .adv_w = 0, + .box_w = 0, + .box_h = 0, + .ofs_x = 0, + .ofs_y = 0} /* id = 0 reserved */, + {.bitmap_index = 0, + .adv_w = 288, + .box_w = 18, + .box_h = 14, + .ofs_x = 0, + .ofs_y = -1}}; /*--------------------- * CHARACTER MAPPING *--------------------*/ - - /*Collect the unicode lists and glyph_id offsets*/ -static const lv_font_fmt_txt_cmap_t cmaps[] = -{ - { - .range_start = 63270, .range_length = 1, .glyph_id_start = 1, - .unicode_list = NULL, .glyph_id_ofs_list = NULL, .list_length = 0, .type = LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY - } -}; - - +static const lv_font_fmt_txt_cmap_t cmaps[] = { + {.range_start = 63270, + .range_length = 1, + .glyph_id_start = 1, + .unicode_list = NULL, + .glyph_id_ofs_list = NULL, + .list_length = 0, + .type = LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY}}; /*-------------------- * ALL CUSTOM DATA @@ -74,7 +73,7 @@ static const lv_font_fmt_txt_cmap_t cmaps[] = #if LV_VERSION_CHECK(8, 0, 0) /*Store all the custom data of the font*/ -static lv_font_fmt_txt_glyph_cache_t cache; +static lv_font_fmt_txt_glyph_cache_t cache; static const lv_font_fmt_txt_dsc_t font_dsc = { #else static lv_font_fmt_txt_dsc_t font_dsc = { @@ -93,7 +92,6 @@ static lv_font_fmt_txt_dsc_t font_dsc = { #endif }; - /*----------------- * PUBLIC FONT *----------------*/ @@ -104,10 +102,12 @@ const lv_font_t turtle_16 = { #else lv_font_t turtle_16 = { #endif - .get_glyph_dsc = lv_font_get_glyph_dsc_fmt_txt, /*Function pointer to get glyph's data*/ - .get_glyph_bitmap = lv_font_get_bitmap_fmt_txt, /*Function pointer to get glyph's bitmap*/ - .line_height = 14, /*The maximum line height required by the font*/ - .base_line = 1, /*Baseline measured from the bottom of the line*/ + .get_glyph_dsc = + lv_font_get_glyph_dsc_fmt_txt, /*Function pointer to get glyph's data*/ + .get_glyph_bitmap = + lv_font_get_bitmap_fmt_txt, /*Function pointer to get glyph's bitmap*/ + .line_height = 14, /*The maximum line height required by the font*/ + .base_line = 1, /*Baseline measured from the bottom of the line*/ #if !(LVGL_VERSION_MAJOR == 6 && LVGL_VERSION_MINOR == 0) .subpx = LV_FONT_SUBPX_NONE, #endif @@ -115,11 +115,10 @@ lv_font_t turtle_16 = { .underline_position = 0, .underline_thickness = 0, #endif - .dsc = &font_dsc /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */ + .dsc = &font_dsc /*The custom font data. Will be accessed by + `get_glyph_bitmap/dsc` */ }; - - #endif /*#if TURTLE_16*/ #endif \ No newline at end of file diff --git a/src/display/symbols/turtle_30px.c b/src/display/symbols/turtle_30px.c index 549949620..e3fe5fca8 100644 --- a/src/display/symbols/turtle_30px.c +++ b/src/display/symbols/turtle_30px.c @@ -1,7 +1,7 @@ /******************************************************************************* * Size: 30 px * Bpp: 4 - * Opts: + * Opts: ******************************************************************************/ #ifdef ARDUINO_FUNHOUSE_ESP32S2 #ifdef LV_LVGL_H_INCLUDE_SIMPLE @@ -23,92 +23,77 @@ /*Store the image of the glyphs*/ static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = { /* U+F726 "" */ - 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x10, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x6b, 0xff, 0xff, - 0xd9, 0x30, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x6e, 0xff, 0xff, - 0xff, 0xff, 0xfa, 0x10, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x9, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xe3, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x9f, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x10, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x5, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc0, - 0x0, 0x0, 0x15, 0x63, 0x0, 0x0, 0x0, 0xe, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xf6, 0x0, 0x6, 0xff, 0xff, 0xd3, 0x0, 0x0, - 0x6f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xfd, 0x0, 0x3f, 0xff, 0xff, 0xff, 0x50, - 0x0, 0xbf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0x20, 0x8f, 0xff, 0xff, 0xff, - 0xe1, 0x0, 0xef, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0x60, 0xaf, 0xff, 0xff, - 0xff, 0xf7, 0x0, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0x70, 0xaf, 0xff, - 0x87, 0xff, 0xfa, 0x1, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0xaf, - 0xff, 0x42, 0xff, 0xfc, 0x1, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80, - 0xaf, 0xff, 0xff, 0xff, 0xfb, 0x1, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0x80, 0xbf, 0xff, 0xff, 0xff, 0xf7, 0x0, 0xdf, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0x40, 0xef, 0xff, 0xff, 0xff, 0xc0, 0x0, - 0x2b, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, - 0xdd, 0xc6, 0x7, 0xff, 0xff, 0xdd, 0xb7, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x7f, 0xff, 0xf6, 0x0, 0x0, - 0x0, 0x18, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, - 0xaa, 0xaa, 0xaa, 0xbe, 0xff, 0xff, 0xd0, 0x0, - 0x0, 0x0, 0xbf, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x20, - 0x0, 0x0, 0x0, 0xef, 0xff,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e3, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x9f, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x10, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x5, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc0, + 0x0, 0x0, 0x15, 0x63, 0x0, 0x0, 0x0, 0xe, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xf6, 0x0, 0x6, 0xff, 0xff, 0xd3, 0x0, 0x0, + 0x6f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfd, 0x0, 0x3f, + 0xff, 0xff, 0xff, 0x50, 0x0, 0xbf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x20, 0x8f, 0xff, 0xff, 0xff, 0xe1, 0x0, 0xef, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x60, 0xaf, 0xff, 0xff, + 0xff, 0xf7, 0x0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0x70, 0xaf, 0xff, 0x87, 0xff, 0xfa, 0x1, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0xaf, 0xff, 0x42, 0xff, 0xfc, + 0x1, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80, + 0xaf, 0xff, 0xff, 0xff, 0xfb, 0x1, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0x80, 0xbf, 0xff, 0xff, 0xff, 0xf7, 0x0, 0xdf, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x40, 0xef, 0xff, + 0xff, 0xff, 0xc0, 0x0, 0x2b, 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 0xbb, 0xb5, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0}; /*--------------------- * GLYPH DESCRIPTION *--------------------*/ static const lv_font_fmt_txt_glyph_dsc_t glyph_dsc[] = { - {.bitmap_index = 0, .adv_w = 0, .box_w = 0, .box_h = 0, .ofs_x = 0, .ofs_y = 0} /* id = 0 reserved */, - {.bitmap_index = 0, .adv_w = 540, .box_w = 34, .box_h = 27, .ofs_x = 0, .ofs_y = -2} -}; + {.bitmap_index = 0, + .adv_w = 0, + .box_w = 0, + .box_h = 0, + .ofs_x = 0, + .ofs_y = 0} /* id = 0 reserved */, + {.bitmap_index = 0, + .adv_w = 540, + .box_w = 34, + .box_h = 27, + .ofs_x = 0, + .ofs_y = -2}}; /*--------------------- * CHARACTER MAPPING *--------------------*/ - - /*Collect the unicode lists and glyph_id offsets*/ -static const lv_font_fmt_txt_cmap_t cmaps[] = -{ - { - .range_start = 63270, .range_length = 1, .glyph_id_start = 1, - .unicode_list = NULL, .glyph_id_ofs_list = NULL, .list_length = 0, .type = LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY - } -}; - - +static const lv_font_fmt_txt_cmap_t cmaps[] = { + {.range_start = 63270, + .range_length = 1, + .glyph_id_start = 1, + .unicode_list = NULL, + .glyph_id_ofs_list = NULL, + .list_length = 0, + .type = LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY}}; /*-------------------- * ALL CUSTOM DATA @@ -116,7 +101,7 @@ static const lv_font_fmt_txt_cmap_t cmaps[] = #if LV_VERSION_CHECK(8, 0, 0) /*Store all the custom data of the font*/ -static lv_font_fmt_txt_glyph_cache_t cache; +static lv_font_fmt_txt_glyph_cache_t cache; static const lv_font_fmt_txt_dsc_t font_dsc = { #else static lv_font_fmt_txt_dsc_t font_dsc = { @@ -135,7 +120,6 @@ static lv_font_fmt_txt_dsc_t font_dsc = { #endif }; - /*----------------- * PUBLIC FONT *----------------*/ @@ -146,10 +130,12 @@ const lv_font_t turtle_30px = { #else lv_font_t turtle_30px = { #endif - .get_glyph_dsc = lv_font_get_glyph_dsc_fmt_txt, /*Function pointer to get glyph's data*/ - .get_glyph_bitmap = lv_font_get_bitmap_fmt_txt, /*Function pointer to get glyph's bitmap*/ - .line_height = 27, /*The maximum line height required by the font*/ - .base_line = 2, /*Baseline measured from the bottom of the line*/ + .get_glyph_dsc = + lv_font_get_glyph_dsc_fmt_txt, /*Function pointer to get glyph's data*/ + .get_glyph_bitmap = + lv_font_get_bitmap_fmt_txt, /*Function pointer to get glyph's bitmap*/ + .line_height = 27, /*The maximum line height required by the font*/ + .base_line = 2, /*Baseline measured from the bottom of the line*/ #if !(LVGL_VERSION_MAJOR == 6 && LVGL_VERSION_MINOR == 0) .subpx = LV_FONT_SUBPX_NONE, #endif @@ -157,11 +143,10 @@ lv_font_t turtle_30px = { .underline_position = 0, .underline_thickness = 0, #endif - .dsc = &font_dsc /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */ + .dsc = &font_dsc /*The custom font data. Will be accessed by + `get_glyph_bitmap/dsc` */ }; - - #endif /*#if TURTLE_30PX*/ #endif \ No newline at end of file diff --git a/src/display/symbols/wifi_30px.c b/src/display/symbols/wifi_30px.c index 9f5f24504..ca55fb199 100644 --- a/src/display/symbols/wifi_30px.c +++ b/src/display/symbols/wifi_30px.c @@ -1,7 +1,7 @@ /******************************************************************************* * Size: 30 px * Bpp: 4 - * Opts: + * Opts: ******************************************************************************/ #ifdef ARDUINO_FUNHOUSE_ESP32S2 #ifdef LV_LVGL_H_INCLUDE_SIMPLE @@ -23,100 +23,82 @@ /*Store the image of the glyphs*/ static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = { /* U+F1EB "" */ - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x12, 0x11, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x59, 0xce, 0xff, 0xff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 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x2, 0xff, 0xff, 0xf7, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2, + 0x9d, 0xb5, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}; /*--------------------- * GLYPH DESCRIPTION *--------------------*/ static const lv_font_fmt_txt_glyph_dsc_t glyph_dsc[] = { - {.bitmap_index = 0, .adv_w = 0, .box_w = 0, .box_h = 0, .ofs_x = 0, .ofs_y = 0} /* id = 0 reserved */, - {.bitmap_index = 0, .adv_w = 600, .box_w = 39, .box_h = 27, .ofs_x = -1, .ofs_y = -2} -}; + {.bitmap_index = 0, + .adv_w = 0, + .box_w = 0, + .box_h = 0, + .ofs_x = 0, + .ofs_y = 0} /* id = 0 reserved */, + {.bitmap_index = 0, + .adv_w = 600, + .box_w = 39, + .box_h = 27, + .ofs_x = -1, + .ofs_y = -2}}; /*--------------------- * CHARACTER MAPPING *--------------------*/ - - /*Collect the unicode lists and glyph_id offsets*/ -static const lv_font_fmt_txt_cmap_t cmaps[] = -{ - { - .range_start = 61931, .range_length = 1, .glyph_id_start = 1, - .unicode_list = NULL, .glyph_id_ofs_list = NULL, .list_length = 0, .type = LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY - } -}; - - +static const lv_font_fmt_txt_cmap_t cmaps[] = { + {.range_start = 61931, + .range_length = 1, + .glyph_id_start = 1, + .unicode_list = NULL, + .glyph_id_ofs_list = NULL, + .list_length = 0, + .type = LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY}}; /*-------------------- * ALL CUSTOM DATA @@ -124,7 +106,7 @@ static const lv_font_fmt_txt_cmap_t cmaps[] = #if LV_VERSION_CHECK(8, 0, 0) /*Store all the custom data of the font*/ -static lv_font_fmt_txt_glyph_cache_t cache; +static lv_font_fmt_txt_glyph_cache_t cache; static const lv_font_fmt_txt_dsc_t font_dsc = { #else static lv_font_fmt_txt_dsc_t font_dsc = { @@ -143,7 +125,6 @@ static lv_font_fmt_txt_dsc_t font_dsc = { #endif }; - /*----------------- * PUBLIC FONT *----------------*/ @@ -154,10 +135,12 @@ const lv_font_t wifi_30px = { #else lv_font_t wifi_30px = { #endif - .get_glyph_dsc = lv_font_get_glyph_dsc_fmt_txt, /*Function pointer to get glyph's data*/ - .get_glyph_bitmap = lv_font_get_bitmap_fmt_txt, /*Function pointer to get glyph's bitmap*/ - .line_height = 27, /*The maximum line height required by the font*/ - .base_line = 2, /*Baseline measured from the bottom of the line*/ + .get_glyph_dsc = + lv_font_get_glyph_dsc_fmt_txt, /*Function pointer to get glyph's data*/ + .get_glyph_bitmap = + lv_font_get_bitmap_fmt_txt, /*Function pointer to get glyph's bitmap*/ + .line_height = 27, /*The maximum line height required by the font*/ + .base_line = 2, /*Baseline measured from the bottom of the line*/ #if !(LVGL_VERSION_MAJOR == 6 && LVGL_VERSION_MINOR == 0) .subpx = LV_FONT_SUBPX_NONE, #endif @@ -165,11 +148,10 @@ lv_font_t wifi_30px = { .underline_position = 0, .underline_thickness = 0, #endif - .dsc = &font_dsc /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */ + .dsc = &font_dsc /*The custom font data. Will be accessed by + `get_glyph_bitmap/dsc` */ }; - - #endif /*#if WIFI_30PX*/ #endif \ No newline at end of file diff --git a/src/display/ws_display_driver.cpp b/src/display/ws_display_driver.cpp index 8a0a8f4a5..7fe2d7428 100644 --- a/src/display/ws_display_driver.cpp +++ b/src/display/ws_display_driver.cpp @@ -63,7 +63,7 @@ ws_display_driver::~ws_display_driver() { AFTER calling Serial.begin(). */ /**************************************************************************/ -void ws_display_driver::enableLogging() { } +void ws_display_driver::enableLogging() {} /**************************************************************************/ /*! @@ -107,18 +107,18 @@ bool ws_display_driver::begin() { return false; } - // Hardware-specific display commands - #ifdef ARDUINO_FUNHOUSE_ESP32S2 - pinMode(TFT_BACKLIGHT, OUTPUT); - digitalWrite(TFT_BACKLIGHT, HIGH); - #endif // ARDUINO_FUNHOUSE_ESP32S2 +// Hardware-specific display commands +#ifdef ARDUINO_FUNHOUSE_ESP32S2 + pinMode(TFT_BACKLIGHT, OUTPUT); + digitalWrite(TFT_BACKLIGHT, HIGH); +#endif // ARDUINO_FUNHOUSE_ESP32S2 // initialize lvgl_glue WS_DEBUG_PRINTLN("Initialize LVGL"); _glue = new Adafruit_LvGL_Glue(); LvGLStatus status = _glue->begin(_tft_st7789); WS_DEBUG_PRINT("LVGL RC: "); - WS_DEBUG_PRINTLN((int) status); + WS_DEBUG_PRINTLN((int)status); // check if lvgl initialized correctly if (status != LVGL_OK) { @@ -137,17 +137,13 @@ bool ws_display_driver::begin() { @brief Acquires the LVGL_Glue lock. */ /**************************************************************************/ -void ws_display_driver::esp32_lvgl_acquire() { - _glue->lvgl_acquire(); -} +void ws_display_driver::esp32_lvgl_acquire() { _glue->lvgl_acquire(); } /**************************************************************************/ /*! @brief Releases the LVGL_Glue lock. */ /**************************************************************************/ -void ws_display_driver::esp32_lvgl_release() { - _glue->lvgl_release(); -} +void ws_display_driver::esp32_lvgl_release() { _glue->lvgl_release(); } #endif \ No newline at end of file diff --git a/src/display/ws_display_ui_helper.h b/src/display/ws_display_ui_helper.h index afbb8c4cb..029b63883 100644 --- a/src/display/ws_display_ui_helper.h +++ b/src/display/ws_display_ui_helper.h @@ -52,8 +52,6 @@ enum loadBarIcons { loadBarIconCheckmark ///< Checkmark icon }; - - class ws_display_driver; /**************************************************************************/ diff --git a/src/network_interfaces/Wippersnapper_ESP32.h b/src/network_interfaces/Wippersnapper_ESP32.h index 53325aed7..c87a8a124 100644 --- a/src/network_interfaces/Wippersnapper_ESP32.h +++ b/src/network_interfaces/Wippersnapper_ESP32.h @@ -148,9 +148,8 @@ class Wippersnapper_ESP32 : public Wippersnapper { WS._mqttBrokerURL = "io.adafruit.com"; _mqtt_client->setCACert(_aio_root_ca_prod); - WS._mqtt = - new Adafruit_MQTT_Client(_mqtt_client, WS._mqttBrokerURL, 8883, - clientID, WS._username, WS._key); + WS._mqtt = new Adafruit_MQTT_Client(_mqtt_client, WS._mqttBrokerURL, 8883, + clientID, WS._username, WS._key); } /********************************************************/ @@ -172,9 +171,6 @@ class Wippersnapper_ESP32 : public Wippersnapper { } } - - - /*******************************************************************/ /*! @brief Returns the type of network connection used by Wippersnapper From f3c8cf6501815ee63b6d01f9ffee098134cac094 Mon Sep 17 00:00:00 2001 From: brentru Date: Mon, 26 Jun 2023 17:06:02 -0400 Subject: [PATCH 88/90] erroneous . on newline --- src/components/pixels/ws_pixels.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/pixels/ws_pixels.cpp b/src/components/pixels/ws_pixels.cpp index bd144fb45..dcc782b29 100644 --- a/src/components/pixels/ws_pixels.cpp +++ b/src/components/pixels/ws_pixels.cpp @@ -433,7 +433,7 @@ void ws_pixels::fillStrand( #ifdef USE_DISPLAY char buffer[100]; - snprintf(buffer, 100, "[Pixel] Filling strand on pin %s with color %u\n.", + snprintf(buffer, 100, "[Pixel] Filling strand on pin %s with color %u\n", pixelsWriteMsg->pixels_pin_data, pixelsWriteMsg->pixels_color); WS._ui_helper->add_text_to_terminal(buffer); #endif From cb58f996cb04841dc80aec36109034378df08b6a Mon Sep 17 00:00:00 2001 From: brentru Date: Tue, 27 Jun 2023 13:19:40 -0400 Subject: [PATCH 89/90] doxygen --- Doxyfile | 2 +- src/Wippersnapper_Boards.h | 16 ++++++++-------- src/display/ws_display_driver.cpp | 9 --------- src/display/ws_display_driver.h | 1 + src/display/ws_display_ui_helper.h | 7 +++++++ 5 files changed, 17 insertions(+), 18 deletions(-) diff --git a/Doxyfile b/Doxyfile index c8edd5442..c05228416 100644 --- a/Doxyfile +++ b/Doxyfile @@ -2074,7 +2074,7 @@ INCLUDE_FILE_PATTERNS = # recursively expanded use the := operator instead of the = operator. # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. -PREDEFINED = __cdecl=, ARDUINO_ARCH_ESP32 +PREDEFINED = __cdecl=, ARDUINO_ARCH_ESP32=1, ARDUINO_FUNHOUSE_ESP32S2=1 # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this # tag can be used to specify a list of macro names that should be expanded. The diff --git a/src/Wippersnapper_Boards.h b/src/Wippersnapper_Boards.h index cea046ac6..9ef700848 100644 --- a/src/Wippersnapper_Boards.h +++ b/src/Wippersnapper_Boards.h @@ -29,14 +29,14 @@ #define STATUS_NEOPIXEL_PIN 40 #define STATUS_NEOPIXEL_NUM 1 #elif defined(ARDUINO_FUNHOUSE_ESP32S2) -#define BOARD_ID "funhouse" -#define USE_TINYUSB -#define USE_STATUS_DOTSTAR -#define USE_DISPLAY -#define STATUS_DOTSTAR_PIN_DATA PIN_DOTSTAR_DATA -#define STATUS_DOTSTAR_PIN_CLK PIN_DOTSTAR_CLOCK -#define STATUS_DOTSTAR_NUM 5 -#define STATUS_DOTSTAR_COLOR_ORDER DOTSTAR_GBR +#define BOARD_ID "funhouse" ///< Board ID +#define USE_TINYUSB ///< Enable TinyUSB +#define USE_STATUS_DOTSTAR ///< Enable DotStar +#define USE_DISPLAY ///< Enable Display +#define STATUS_DOTSTAR_PIN_DATA PIN_DOTSTAR_DATA ///< DotStar Data Pin +#define STATUS_DOTSTAR_PIN_CLK PIN_DOTSTAR_CLOCK ///< DotStar Clock Pin +#define STATUS_DOTSTAR_NUM 5 ///< Number of DotStar LEDs +#define STATUS_DOTSTAR_COLOR_ORDER DOTSTAR_GBR ///< DotStar Color Order #elif defined(ARDUINO_METRO_ESP32S2) #define BOARD_ID "metroesp32s2" #define USE_TINYUSB diff --git a/src/display/ws_display_driver.cpp b/src/display/ws_display_driver.cpp index 7fe2d7428..38a3c57ef 100644 --- a/src/display/ws_display_driver.cpp +++ b/src/display/ws_display_driver.cpp @@ -15,15 +15,6 @@ #ifdef ARDUINO_FUNHOUSE_ESP32S2 #include "ws_display_driver.h" -/**************************************************************************/ -/*! - @brief Callback for LVGL logging through USB serial - @param buf - Data to write out to serial. -*/ -/**************************************************************************/ -// static void my_log_cb(const char *buf) { WS_DEBUG_PRINTLN(buf); } - /**************************************************************************/ /*! @brief Creates a new WipperSnapper display driver object from a diff --git a/src/display/ws_display_driver.h b/src/display/ws_display_driver.h index 54044c88f..03b4048d7 100644 --- a/src/display/ws_display_driver.h +++ b/src/display/ws_display_driver.h @@ -21,6 +21,7 @@ #include #include +/** Display driver configuration */ struct displayConfig { char driver[10]; ///< Display driver type int width; ///< Display width diff --git a/src/display/ws_display_ui_helper.h b/src/display/ws_display_ui_helper.h index 029b63883..909d6c73a 100644 --- a/src/display/ws_display_ui_helper.h +++ b/src/display/ws_display_ui_helper.h @@ -62,6 +62,13 @@ class ws_display_driver; /**************************************************************************/ class ws_display_ui_helper { public: + /**************************************************************************/ + /*! + @brief Constructor for the ws_display_ui_helper class. + @param drv + Pointer to the display driver. + */ + /**************************************************************************/ ws_display_ui_helper(ws_display_driver *drv) { _dispDriver = drv; }; ~ws_display_ui_helper(){}; From caf9992e303324037c8dd29d4552ccc2c24c3e8c Mon Sep 17 00:00:00 2001 From: brentru Date: Tue, 27 Jun 2023 15:27:21 -0400 Subject: [PATCH 90/90] add USE_PSRAM flag for dynamic topic allocation --- src/Wippersnapper.cpp | 38 +++++++++++++++++++------------------- src/Wippersnapper_Boards.h | 11 +++++++++++ 2 files changed, 30 insertions(+), 19 deletions(-) diff --git a/src/Wippersnapper.cpp b/src/Wippersnapper.cpp index d6ea4551b..82756259c 100644 --- a/src/Wippersnapper.cpp +++ b/src/Wippersnapper.cpp @@ -1612,7 +1612,7 @@ void cbThrottleTopic(char *throttleData, uint16_t len) { /**************************************************************************/ bool Wippersnapper::generateWSErrorTopics() { // dynamically allocate memory for err topic -#ifdef ARDUINO_ARCH_ESP32 +#ifdef USE_PSRAM WS._err_topic = (char *)ps_malloc( sizeof(char) * (strlen(WS._username) + strlen(TOPIC_IO_ERRORS) + 1)); #else @@ -1634,7 +1634,7 @@ bool Wippersnapper::generateWSErrorTopics() { _err_sub->setCallback(cbErrorTopic); // dynamically allocate memory for throttle topic -#ifdef ARDUINO_ARCH_ESP32 +#ifdef USE_PSRAM WS._throttle_topic = (char *)ps_malloc( sizeof(char) * (strlen(WS._username) + strlen(TOPIC_IO_THROTTLE) + 1)); #else @@ -1693,7 +1693,7 @@ bool Wippersnapper::generateDeviceUID() { itoa(atoi(WS.sUID), mac_uid, 10); // Attempt to malloc a the device identifier string -#ifdef ARDUINO_ARCH_ESP32 +#ifdef USE_PSRAM _device_uid = (char *)ps_malloc(sizeof(char) + strlen("io-wipper-") + strlen(WS._boardId) + strlen(mac_uid) + 1); #else @@ -1721,7 +1721,7 @@ bool Wippersnapper::generateDeviceUID() { /**************************************************************************/ bool Wippersnapper::generateWSTopics() { // Create global registration topic -#ifdef ARDUINO_ARCH_ESP32 +#ifdef USE_PSRAM WS._topic_description = (char *)ps_malloc( sizeof(char) * strlen(WS._username) + strlen("/wprsnpr") + strlen(TOPIC_INFO) + strlen("status") + 1); @@ -1741,7 +1741,7 @@ bool Wippersnapper::generateWSTopics() { } // Create registration status topic -#ifdef ARDUINO_ARCH_ESP32 +#ifdef USE_PSRAM WS._topic_description_status = (char *)ps_malloc( sizeof(char) * strlen(WS._username) + strlen("/wprsnpr/") + strlen(_device_uid) + strlen(TOPIC_INFO) + strlen("status/") + @@ -1771,7 +1771,7 @@ bool Wippersnapper::generateWSTopics() { _topic_description_sub->setCallback(cbRegistrationStatus); // Create registration status complete topic -#ifdef ARDUINO_ARCH_ESP32 +#ifdef USE_PSRAM WS._topic_description_status_complete = (char *)ps_malloc( sizeof(char) * strlen(WS._username) + strlen("/wprsnpr/") + strlen(_device_uid) + strlen(TOPIC_INFO) + strlen("status") + @@ -1795,7 +1795,7 @@ bool Wippersnapper::generateWSTopics() { } // Create device-to-broker signal topic -#ifdef ARDUINO_ARCH_ESP32 +#ifdef USE_PSRAM WS._topic_signal_device = (char *)ps_malloc( sizeof(char) * strlen(WS._username) + strlen("/wprsnpr/") + strlen(_device_uid) + strlen(TOPIC_SIGNALS) + strlen("device") + 1); @@ -1816,7 +1816,7 @@ bool Wippersnapper::generateWSTopics() { } // Create pin configuration complete topic -#ifdef ARDUINO_ARCH_ESP32 +#ifdef USE_PSRAM WS._topic_device_pin_config_complete = (char *)ps_malloc( sizeof(char) * strlen(WS._username) + strlen("/wprsnpr/") + strlen(_device_uid) + strlen(TOPIC_SIGNALS) + @@ -1840,7 +1840,7 @@ bool Wippersnapper::generateWSTopics() { } // Create broker-to-device signal topic -#ifdef ARDUINO_ARCH_ESP32 +#ifdef USE_PSRAM WS._topic_signal_brkr = (char *)ps_malloc( sizeof(char) * strlen(WS._username) + strlen("/wprsnpr/") + strlen(_device_uid) + strlen(TOPIC_SIGNALS) + strlen("broker") + 1); @@ -1867,7 +1867,7 @@ bool Wippersnapper::generateWSTopics() { _topic_signal_brkr_sub->setCallback(cbSignalTopic); // Create device-to-broker i2c signal topic -#ifdef ARDUINO_ARCH_ESP32 +#ifdef USE_PSRAM WS._topic_signal_i2c_brkr = (char *)ps_malloc( sizeof(char) * strlen(WS._username) + +strlen("/") + strlen(_device_uid) + strlen("/wprsnpr/") + strlen(TOPIC_SIGNALS) + strlen("broker") + @@ -1897,7 +1897,7 @@ bool Wippersnapper::generateWSTopics() { _topic_signal_i2c_sub->setCallback(cbSignalI2CReq); // Create broker-to-device i2c signal topic -#ifdef ARDUINO_ARCH_ESP32 +#ifdef USE_PSRAM WS._topic_signal_i2c_device = (char *)ps_malloc( sizeof(char) * strlen(WS._username) + +strlen("/") + strlen(_device_uid) + strlen("/wprsnpr/") + strlen(TOPIC_SIGNALS) + strlen("device") + @@ -1921,7 +1921,7 @@ bool Wippersnapper::generateWSTopics() { } // Create device-to-broker ds18x20 topic -#ifdef ARDUINO_ARCH_ESP32 +#ifdef USE_PSRAM WS._topic_signal_ds18_brkr = (char *)ps_malloc( sizeof(char) * strlen(WS._username) + +strlen("/") + strlen(_device_uid) + strlen("/wprsnpr/") + strlen(TOPIC_SIGNALS) + strlen("broker/") + @@ -1950,7 +1950,7 @@ bool Wippersnapper::generateWSTopics() { _topic_signal_ds18_sub->setCallback(cbSignalDSReq); // Create broker-to-device ds18x20 topic -#ifdef ARDUINO_ARCH_ESP32 +#ifdef USE_PSRAM WS._topic_signal_ds18_device = (char *)ps_malloc( sizeof(char) * strlen(WS._username) + +strlen("/") + strlen(_device_uid) + strlen("/wprsnpr/") + strlen(TOPIC_SIGNALS) + strlen("device/") + @@ -1973,7 +1973,7 @@ bool Wippersnapper::generateWSTopics() { } // Create device-to-broker servo signal topic -#ifdef ARDUINO_ARCH_ESP32 +#ifdef USE_PSRAM WS._topic_signal_servo_brkr = (char *)ps_malloc( sizeof(char) * strlen(WS._username) + strlen("/") + strlen(_device_uid) + strlen("/wprsnpr/signals/broker/servo") + 1); @@ -2000,7 +2000,7 @@ bool Wippersnapper::generateWSTopics() { _topic_signal_servo_sub->setCallback(cbServoMsg); // Create broker-to-device servo signal topic -#ifdef ARDUINO_ARCH_ESP32 +#ifdef USE_PSRAM WS._topic_signal_servo_device = (char *)ps_malloc( sizeof(char) * strlen(WS._username) + strlen("/") + strlen(_device_uid) + strlen("/wprsnpr/signals/device/servo") + 1); @@ -2021,7 +2021,7 @@ bool Wippersnapper::generateWSTopics() { } // Topic for pwm messages from broker->device -#ifdef ARDUINO_ARCH_ESP32 +#ifdef USE_PSRAM WS._topic_signal_pwm_brkr = (char *)ps_malloc( sizeof(char) * strlen(WS._username) + strlen("/") + strlen(_device_uid) + strlen("/wprsnpr/signals/broker/pwm") + 1); @@ -2049,7 +2049,7 @@ bool Wippersnapper::generateWSTopics() { _topic_signal_pwm_sub->setCallback(cbPWMMsg); // Topic for pwm messages from device->broker -#ifdef ARDUINO_ARCH_ESP32 +#ifdef USE_PSRAM WS._topic_signal_pwm_device = (char *)ps_malloc( sizeof(char) * strlen(WS._username) + strlen("/") + strlen(_device_uid) + strlen("/wprsnpr/signals/device/pwm") + 1); @@ -2070,7 +2070,7 @@ bool Wippersnapper::generateWSTopics() { } // Topic for pixel messages from broker->device -#ifdef ARDUINO_ARCH_ESP32 +#ifdef USE_PSRAM WS._topic_signal_pixels_brkr = (char *)ps_malloc( sizeof(char) * strlen(WS._username) + strlen("/") + strlen(_device_uid) + strlen("/wprsnpr/signals/broker/pixels") + 1); @@ -2096,7 +2096,7 @@ bool Wippersnapper::generateWSTopics() { _topic_signal_pixels_sub->setCallback(cbPixelsMsg); // Topic for pixel messages from device->broker -#ifdef ARDUINO_ARCH_ESP32 +#ifdef USE_PSRAM WS._topic_signal_pixels_device = (char *)ps_malloc( sizeof(char) * strlen(WS._username) + strlen("/") + strlen(_device_uid) + strlen("/wprsnpr/signals/device/pixels") + 1); diff --git a/src/Wippersnapper_Boards.h b/src/Wippersnapper_Boards.h index 9ef700848..b4b9517f5 100644 --- a/src/Wippersnapper_Boards.h +++ b/src/Wippersnapper_Boards.h @@ -37,24 +37,28 @@ #define STATUS_DOTSTAR_PIN_CLK PIN_DOTSTAR_CLOCK ///< DotStar Clock Pin #define STATUS_DOTSTAR_NUM 5 ///< Number of DotStar LEDs #define STATUS_DOTSTAR_COLOR_ORDER DOTSTAR_GBR ///< DotStar Color Order +#define USE_PSRAM ///< Board has PSRAM, use it for dynamic memory allocation #elif defined(ARDUINO_METRO_ESP32S2) #define BOARD_ID "metroesp32s2" #define USE_TINYUSB #define USE_STATUS_NEOPIXEL #define STATUS_NEOPIXEL_PIN 45 #define STATUS_NEOPIXEL_NUM 1 +#define USE_PSRAM ///< Board has PSRAM, use it for dynamic memory allocation #elif defined(ARDUINO_MAGTAG29_ESP32S2) #define BOARD_ID "magtag" #define USE_TINYUSB #define USE_STATUS_NEOPIXEL #define STATUS_NEOPIXEL_PIN 1 #define STATUS_NEOPIXEL_NUM 4 +#define USE_PSRAM ///< Board has PSRAM, use it for dynamic memory allocation #elif defined(ARDUINO_ADAFRUIT_FEATHER_ESP32S2) #define BOARD_ID "feather-esp32s2" #define USE_TINYUSB #define USE_STATUS_NEOPIXEL #define STATUS_NEOPIXEL_PIN 33 #define STATUS_NEOPIXEL_NUM 1 +#define USE_PSRAM ///< Board has PSRAM, use it for dynamic memory allocation #elif defined(ARDUINO_ADAFRUIT_FEATHER_ESP32S2_TFT) #define BOARD_ID "feather-esp32s2-tft" #define USE_TINYUSB @@ -62,6 +66,7 @@ #define STATUS_NEOPIXEL_PIN 33 #define STATUS_NEOPIXEL_NUM 1 #define PIN_I2C_POWER_INVERTED 7 +#define USE_PSRAM ///< Board has PSRAM, use it for dynamic memory allocation #elif defined(ARDUINO_ADAFRUIT_FEATHER_ESP32S3_NOPSRAM) #define BOARD_ID "feather-esp32s3" #define USE_TINYUSB @@ -74,24 +79,28 @@ #define USE_STATUS_NEOPIXEL #define STATUS_NEOPIXEL_PIN PIN_NEOPIXEL #define STATUS_NEOPIXEL_NUM NEOPIXEL_NUM +#define USE_PSRAM ///< Board has PSRAM, use it for dynamic memory allocation #elif defined(ARDUINO_ADAFRUIT_FEATHER_ESP32S3_TFT) #define BOARD_ID "feather-esp32s3-tft" #define USE_TINYUSB #define USE_STATUS_NEOPIXEL #define STATUS_NEOPIXEL_PIN PIN_NEOPIXEL #define STATUS_NEOPIXEL_NUM NEOPIXEL_NUM +#define USE_PSRAM ///< Board has PSRAM, use it for dynamic memory allocation #elif defined(ARDUINO_ADAFRUIT_FEATHER_ESP32S3_REVTFT) #define BOARD_ID "feather-esp32s3-reversetft" #define USE_TINYUSB #define USE_STATUS_NEOPIXEL #define STATUS_NEOPIXEL_PIN PIN_NEOPIXEL #define STATUS_NEOPIXEL_NUM NEOPIXEL_NUM +#define USE_PSRAM ///< Board has PSRAM, use it for dynamic memory allocation #elif defined(ARDUINO_ADAFRUIT_QTPY_ESP32S2) #define BOARD_ID "qtpy-esp32s2" #define USE_TINYUSB #define USE_STATUS_NEOPIXEL #define STATUS_NEOPIXEL_PIN PIN_NEOPIXEL #define STATUS_NEOPIXEL_NUM 1 +#define USE_PSRAM ///< Board has PSRAM, use it for dynamic memory allocation #elif defined(ARDUINO_ADAFRUIT_QTPY_ESP32S3_NOPSRAM) #define BOARD_ID "qtpy-esp32s3" #define USE_TINYUSB @@ -120,12 +129,14 @@ #define USE_STATUS_NEOPIXEL #define STATUS_NEOPIXEL_PIN PIN_NEOPIXEL #define STATUS_NEOPIXEL_NUM 1 +#define USE_PSRAM ///< Board has PSRAM, use it for dynamic memory allocation #elif defined(ARDUINO_ADAFRUIT_QTPY_ESP32_PICO) #define BOARD_ID "qtpy-esp32" #define USE_LITTLEFS #define USE_STATUS_NEOPIXEL #define STATUS_NEOPIXEL_PIN PIN_NEOPIXEL #define STATUS_NEOPIXEL_NUM 1 +#define USE_PSRAM ///< Board has PSRAM, use it for dynamic memory allocation #elif defined(ARDUINO_SAMD_NANO_33_IOT) #define BOARD_ID "nano-33-iot" #define USE_STATUS_LED