diff --git a/boards/t-watch-s3.json b/boards/t-watch-s3.json index 080389f39e..e6e3633053 100644 --- a/boards/t-watch-s3.json +++ b/boards/t-watch-s3.json @@ -16,7 +16,10 @@ "f_cpu": "240000000L", "f_flash": "80000000L", "flash_mode": "qio", - "hwids": [["0x303A", "0x1001"]], + "hwids": [ + ["0x303A", "0x1001"], + ["0x303A", "0x0002"] + ], "mcu": "esp32s3", "variant": "t-watch-s3" }, diff --git a/platformio.ini b/platformio.ini index f6d9bcf356..e3204f4d9c 100644 --- a/platformio.ini +++ b/platformio.ini @@ -69,8 +69,8 @@ build_flags = -Wno-missing-field-initializers monitor_speed = 115200 lib_deps = - jgromes/RadioLib@^6.3.0 - https://github.com/meshtastic/esp8266-oled-ssd1306.git#b38094e03dfa964fbc0e799bc374e91a605c1223 ; ESP8266_SSD1306 + jgromes/RadioLib@^6.4.0 + https://github.com/meshtastic/esp8266-oled-ssd1306.git#ee628ee6c9588d4c56c9e3da35f0fc9448ad54a8 ; ESP8266_SSD1306 mathertel/OneButton@^2.5.0 ; OneButton library for non-blocking button debounce https://github.com/meshtastic/arduino-fsm.git#7db3702bf0cfe97b783d6c72595e3f38e0b19159 https://github.com/meshtastic/TinyGPSPlus.git#076e8d2c8fb702d9be5b08c55b93ff76f8af7e61 diff --git a/src/graphics/EInkDisplay2.cpp b/src/graphics/EInkDisplay2.cpp index eb716ac030..787b47e1f7 100644 --- a/src/graphics/EInkDisplay2.cpp +++ b/src/graphics/EInkDisplay2.cpp @@ -55,7 +55,7 @@ GxEPD2_BW *adafruitDisplay; EInkDisplay::EInkDisplay(uint8_t address, int sda, int scl, OLEDDISPLAY_GEOMETRY geometry, HW_I2C i2cBus) { #if defined(TTGO_T_ECHO) - setGeometry(GEOMETRY_RAWMODE, TECHO_DISPLAY_MODEL::WIDTH, TECHO_DISPLAY_MODEL::HEIGHT); + setGeometry(GEOMETRY_RAWMODE, 200, 200); #elif defined(RAK4630) // GxEPD2_213_BN - RAK14000 2.13 inch b/w 250x122 @@ -129,8 +129,7 @@ bool EInkDisplay::forceDisplay(uint32_t msecLimit) LOG_DEBUG("Updating E-Paper... "); #if defined(TTGO_T_ECHO) - // ePaper.Reset(); // wake the screen from sleep - adafruitDisplay->display(false); // FIXME, use partial update mode + adafruitDisplay->nextPage(); #elif defined(RAK4630) || defined(MAKERPYTHON) // RAK14000 2.13 inch b/w 250x122 actually now does support partial updates @@ -210,6 +209,7 @@ bool EInkDisplay::connect() adafruitDisplay = new GxEPD2_BW(*lowLevel); adafruitDisplay->init(); adafruitDisplay->setRotation(3); + adafruitDisplay->setPartialWindow(0, 0, displayWidth, displayHeight); } #elif defined(RAK4630) || defined(MAKERPYTHON) { @@ -274,4 +274,4 @@ bool EInkDisplay::connect() return true; } -#endif +#endif \ No newline at end of file diff --git a/src/graphics/Screen.cpp b/src/graphics/Screen.cpp index 00880ad051..fb27e3c016 100644 --- a/src/graphics/Screen.cpp +++ b/src/graphics/Screen.cpp @@ -1052,7 +1052,11 @@ void Screen::setup() // Standard behaviour is to FLIP the screen (needed on T-Beam). If this config item is set, unflip it, and thereby logically // flip it. If you have a headache now, you're welcome. if (!config.display.flip_screen) { +#if defined(ST7735_CS) || defined(ILI9341_DRIVER) || defined(ST7789_CS) || defined(RAK14014) + static_cast(dispdev)->flipScreenVertically(); +#else dispdev->flipScreenVertically(); +#endif } #endif diff --git a/src/modules/AdminModule.cpp b/src/modules/AdminModule.cpp index 0b1e72f9aa..e197017988 100644 --- a/src/modules/AdminModule.cpp +++ b/src/modules/AdminModule.cpp @@ -280,6 +280,7 @@ void AdminModule::handleSetOwner(const meshtastic_User &o) void AdminModule::handleSetConfig(const meshtastic_Config &c) { + auto changes = SEGMENT_CONFIG; auto existingRole = config.device.role; bool isRegionUnset = (config.lora.region == meshtastic_Config_LoRaConfig_RegionCode_UNSET); @@ -320,6 +321,11 @@ void AdminModule::handleSetConfig(const meshtastic_Config &c) config.lora = c.payload_variant.lora; if (isRegionUnset && config.lora.region > meshtastic_Config_LoRaConfig_RegionCode_UNSET) { config.lora.tx_enabled = true; + initRegion(); + if (strcmp(moduleConfig.mqtt.root, default_mqtt_root) == 0) { + sprintf(moduleConfig.mqtt.root, "%s/%s", default_mqtt_root, myRegion->name); + changes = SEGMENT_CONFIG | SEGMENT_MODULECONFIG; + } } break; case meshtastic_Config_bluetooth_tag: @@ -329,7 +335,7 @@ void AdminModule::handleSetConfig(const meshtastic_Config &c) break; } - saveChanges(SEGMENT_CONFIG); + saveChanges(changes); } void AdminModule::handleSetModuleConfig(const meshtastic_ModuleConfig &c) @@ -715,4 +721,4 @@ AdminModule::AdminModule() : ProtobufModule("Admin", meshtastic_PortNum_ADMIN_AP { // restrict to the admin channel for rx boundChannel = Channels::adminChannel; -} +} \ No newline at end of file