From 101d40da0108e11a192535736a9096ac04347ca0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20BOU=C3=89?= Date: Wed, 9 Oct 2024 14:50:21 +0200 Subject: [PATCH 1/9] Update platformio.ini M5STACK_CORE --- variants/m5stack_core/platformio.ini | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/variants/m5stack_core/platformio.ini b/variants/m5stack_core/platformio.ini index 95f5aea9f5..11ab631b81 100644 --- a/variants/m5stack_core/platformio.ini +++ b/variants/m5stack_core/platformio.ini @@ -7,7 +7,7 @@ build_src_filter = build_flags = ${esp32_base.build_flags} -I variants/m5stack_core -DILI9341_DRIVER - -DM5STACK + -DM5STACK_CORE -DUSER_SETUP_LOADED -DTFT_SDA_READ -DTFT_DRIVER=0x9341 @@ -25,4 +25,4 @@ lib_ignore = m5stack-core lib_deps = ${esp32_base.lib_deps} - lovyan03/LovyanGFX@^1.1.8 \ No newline at end of file + lovyan03/LovyanGFX@^1.1.8 From 6ce9a0f1fed592cc41bd8509d936f3ec61968b0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20BOU=C3=89?= Date: Wed, 9 Oct 2024 16:24:47 +0200 Subject: [PATCH 2/9] Update architecture.h Rename M5STACK to M5STACK_CORE --- src/platform/esp32/architecture.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/platform/esp32/architecture.h b/src/platform/esp32/architecture.h index 01f4166296..0bb2557813 100644 --- a/src/platform/esp32/architecture.h +++ b/src/platform/esp32/architecture.h @@ -102,8 +102,8 @@ #define HW_VENDOR meshtastic_HardwareModel_PRIVATE_HW #elif defined(NANO_G1) #define HW_VENDOR meshtastic_HardwareModel_NANO_G1 -#elif defined(M5STACK) -#define HW_VENDOR meshtastic_HardwareModel_M5STACK +#elif defined(M5STACK_CORE) +#define HW_VENDOR meshtastic_HardwareModel_M5STACK_CORE #elif defined(STATION_G1) #define HW_VENDOR meshtastic_HardwareModel_STATION_G1 #elif defined(DR_DEV) From 394baa07589126ed315c4ae9a0ef521fe16db2fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20BOU=C3=89?= Date: Wed, 9 Oct 2024 16:26:50 +0200 Subject: [PATCH 3/9] Update Screen.cpp --- src/graphics/Screen.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/graphics/Screen.cpp b/src/graphics/Screen.cpp index ad42fa9798..47f9748f42 100644 --- a/src/graphics/Screen.cpp +++ b/src/graphics/Screen.cpp @@ -1606,7 +1606,7 @@ void Screen::handleSetOn(bool on, FrameCallback einkScreensaver) #endif #if defined(ST7789_CS) && \ - !defined(M5STACK) // set display brightness when turning on screens. Just moved function from TFTDisplay to here. + !defined(M5STACK_CORE) // set display brightness when turning on screens. Just moved function from TFTDisplay to here. static_cast(dispdev)->setDisplayBrightness(brightness); #endif @@ -2817,4 +2817,4 @@ int Screen::handleAdminMessage(const meshtastic_AdminMessage *arg) } // namespace graphics #else graphics::Screen::Screen(ScanI2C::DeviceAddress, meshtastic_Config_DisplayConfig_OledType, OLEDDISPLAY_GEOMETRY) {} -#endif // HAS_SCREEN \ No newline at end of file +#endif // HAS_SCREEN From e96776ccb42c283a2078ced8f94df36ae3adffc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20BOU=C3=89?= Date: Wed, 9 Oct 2024 16:29:37 +0200 Subject: [PATCH 4/9] Update TFTDisplay.cpp --- src/graphics/TFTDisplay.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/graphics/TFTDisplay.cpp b/src/graphics/TFTDisplay.cpp index 0c32a7c32e..f775eb22f6 100644 --- a/src/graphics/TFTDisplay.cpp +++ b/src/graphics/TFTDisplay.cpp @@ -718,7 +718,7 @@ void TFTDisplay::sendCommand(uint8_t com) display(true); if (settingsMap[displayBacklight] > 0) digitalWrite(settingsMap[displayBacklight], TFT_BACKLIGHT_ON); -#elif !defined(RAK14014) && !defined(M5STACK) && !defined(UNPHONE) +#elif !defined(RAK14014) && !defined(M5STACK_CORE) && !defined(UNPHONE) tft->wakeup(); tft->powerSaveOff(); #endif @@ -730,7 +730,7 @@ void TFTDisplay::sendCommand(uint8_t com) unphone.backlight(true); // using unPhone library #endif #ifdef RAK14014 -#elif !defined(M5STACK) && !defined(ST7789_CS) // T-Deck gets brightness set in Screen.cpp in the handleSetOn function +#elif !defined(M5STACK_CORE) && !defined(ST7789_CS) // T-Deck gets brightness set in Screen.cpp in the handleSetOn function tft->setBrightness(172); #endif break; @@ -742,7 +742,7 @@ void TFTDisplay::sendCommand(uint8_t com) tft->clear(); if (settingsMap[displayBacklight] > 0) digitalWrite(settingsMap[displayBacklight], !TFT_BACKLIGHT_ON); -#elif !defined(RAK14014) && !defined(M5STACK) && !defined(UNPHONE) +#elif !defined(RAK14014) && !defined(M5STACK_CORE) && !defined(UNPHONE) tft->sleep(); tft->powerSaveOn(); #endif @@ -754,7 +754,7 @@ void TFTDisplay::sendCommand(uint8_t com) unphone.backlight(false); // using unPhone library #endif #ifdef RAK14014 -#elif !defined(M5STACK) +#elif !defined(M5STACK_CORE) tft->setBrightness(0); #endif break; @@ -788,7 +788,7 @@ bool TFTDisplay::hasTouch(void) { #ifdef RAK14014 return true; -#elif !defined(M5STACK) +#elif !defined(M5STACK_CORE) return tft->touch() != nullptr; #else return false; @@ -807,7 +807,7 @@ bool TFTDisplay::getTouch(int16_t *x, int16_t *y) } else { return false; } -#elif !defined(M5STACK) +#elif !defined(M5STACK_CORE) return tft->getTouch(x, y); #else return false; @@ -839,7 +839,7 @@ bool TFTDisplay::connect() tft->init(); -#if defined(M5STACK) +#if defined(M5STACK_CORE) tft->setRotation(0); #elif defined(RAK14014) tft->setRotation(1); From bfe693af539855c47b6aabf0c2113fb94fbf5bf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20BOU=C3=89?= Date: Thu, 10 Oct 2024 08:53:19 +0200 Subject: [PATCH 5/9] Update Screen.cpp --- src/graphics/Screen.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/graphics/Screen.cpp b/src/graphics/Screen.cpp index 47f9748f42..561766ea8e 100644 --- a/src/graphics/Screen.cpp +++ b/src/graphics/Screen.cpp @@ -1606,7 +1606,7 @@ void Screen::handleSetOn(bool on, FrameCallback einkScreensaver) #endif #if defined(ST7789_CS) && \ - !defined(M5STACK_CORE) // set display brightness when turning on screens. Just moved function from TFTDisplay to here. + !defined(M5STACK_COREBASIC) // set display brightness when turning on screens. Just moved function from TFTDisplay to here. static_cast(dispdev)->setDisplayBrightness(brightness); #endif From a4f0b985a0cb1ca063f80a7923629eb6061a044e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20BOU=C3=89?= Date: Thu, 10 Oct 2024 08:54:11 +0200 Subject: [PATCH 6/9] Update TFTDisplay.cpp --- src/graphics/TFTDisplay.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/graphics/TFTDisplay.cpp b/src/graphics/TFTDisplay.cpp index f775eb22f6..8f08d76885 100644 --- a/src/graphics/TFTDisplay.cpp +++ b/src/graphics/TFTDisplay.cpp @@ -718,7 +718,7 @@ void TFTDisplay::sendCommand(uint8_t com) display(true); if (settingsMap[displayBacklight] > 0) digitalWrite(settingsMap[displayBacklight], TFT_BACKLIGHT_ON); -#elif !defined(RAK14014) && !defined(M5STACK_CORE) && !defined(UNPHONE) +#elif !defined(RAK14014) && !defined(M5STACK_COREBASICBASIC) && !defined(UNPHONE) tft->wakeup(); tft->powerSaveOff(); #endif @@ -730,7 +730,7 @@ void TFTDisplay::sendCommand(uint8_t com) unphone.backlight(true); // using unPhone library #endif #ifdef RAK14014 -#elif !defined(M5STACK_CORE) && !defined(ST7789_CS) // T-Deck gets brightness set in Screen.cpp in the handleSetOn function +#elif !defined(M5STACK_COREBASICBASIC) && !defined(ST7789_CS) // T-Deck gets brightness set in Screen.cpp in the handleSetOn function tft->setBrightness(172); #endif break; @@ -742,7 +742,7 @@ void TFTDisplay::sendCommand(uint8_t com) tft->clear(); if (settingsMap[displayBacklight] > 0) digitalWrite(settingsMap[displayBacklight], !TFT_BACKLIGHT_ON); -#elif !defined(RAK14014) && !defined(M5STACK_CORE) && !defined(UNPHONE) +#elif !defined(RAK14014) && !defined(M5STACK_COREBASICBASIC) && !defined(UNPHONE) tft->sleep(); tft->powerSaveOn(); #endif @@ -754,7 +754,7 @@ void TFTDisplay::sendCommand(uint8_t com) unphone.backlight(false); // using unPhone library #endif #ifdef RAK14014 -#elif !defined(M5STACK_CORE) +#elif !defined(M5STACK_COREBASICBASIC) tft->setBrightness(0); #endif break; @@ -788,7 +788,7 @@ bool TFTDisplay::hasTouch(void) { #ifdef RAK14014 return true; -#elif !defined(M5STACK_CORE) +#elif !defined(M5STACK_COREBASICBASIC) return tft->touch() != nullptr; #else return false; @@ -807,7 +807,7 @@ bool TFTDisplay::getTouch(int16_t *x, int16_t *y) } else { return false; } -#elif !defined(M5STACK_CORE) +#elif !defined(M5STACK_COREBASICBASIC) return tft->getTouch(x, y); #else return false; @@ -839,7 +839,7 @@ bool TFTDisplay::connect() tft->init(); -#if defined(M5STACK_CORE) +#if defined(M5STACK_COREBASICBASIC) tft->setRotation(0); #elif defined(RAK14014) tft->setRotation(1); From d2843a8b152f1d91bdce1e4d8b50606c5020ad8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20BOU=C3=89?= Date: Thu, 10 Oct 2024 08:55:37 +0200 Subject: [PATCH 7/9] Update architecture.h --- src/platform/esp32/architecture.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/platform/esp32/architecture.h b/src/platform/esp32/architecture.h index 0bb2557813..008fc9bdf6 100644 --- a/src/platform/esp32/architecture.h +++ b/src/platform/esp32/architecture.h @@ -102,8 +102,8 @@ #define HW_VENDOR meshtastic_HardwareModel_PRIVATE_HW #elif defined(NANO_G1) #define HW_VENDOR meshtastic_HardwareModel_NANO_G1 -#elif defined(M5STACK_CORE) -#define HW_VENDOR meshtastic_HardwareModel_M5STACK_CORE +#elif defined(M5STACK_COREBASIC) +#define HW_VENDOR meshtastic_HardwareModel_M5STACK_COREBASIC #elif defined(STATION_G1) #define HW_VENDOR meshtastic_HardwareModel_STATION_G1 #elif defined(DR_DEV) From f204643a747be052bdd5da9e52bcb58dbe837d86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20BOU=C3=89?= Date: Thu, 10 Oct 2024 08:59:54 +0200 Subject: [PATCH 8/9] Update platformio.ini --- variants/m5stack_core/platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/variants/m5stack_core/platformio.ini b/variants/m5stack_core/platformio.ini index 11ab631b81..8b4b9c5190 100644 --- a/variants/m5stack_core/platformio.ini +++ b/variants/m5stack_core/platformio.ini @@ -7,7 +7,7 @@ build_src_filter = build_flags = ${esp32_base.build_flags} -I variants/m5stack_core -DILI9341_DRIVER - -DM5STACK_CORE + -DM5STACK_COREBASIC -DUSER_SETUP_LOADED -DTFT_SDA_READ -DTFT_DRIVER=0x9341 From 2eb3e1739351a00f0264bda8db07e4a6b0bc6804 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20BOU=C3=89?= Date: Thu, 10 Oct 2024 09:00:46 +0200 Subject: [PATCH 9/9] Update TFTDisplay.cpp --- src/graphics/TFTDisplay.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/graphics/TFTDisplay.cpp b/src/graphics/TFTDisplay.cpp index 8f08d76885..22e46ca16a 100644 --- a/src/graphics/TFTDisplay.cpp +++ b/src/graphics/TFTDisplay.cpp @@ -718,7 +718,7 @@ void TFTDisplay::sendCommand(uint8_t com) display(true); if (settingsMap[displayBacklight] > 0) digitalWrite(settingsMap[displayBacklight], TFT_BACKLIGHT_ON); -#elif !defined(RAK14014) && !defined(M5STACK_COREBASICBASIC) && !defined(UNPHONE) +#elif !defined(RAK14014) && !defined(M5STACK_COREBASIC) && !defined(UNPHONE) tft->wakeup(); tft->powerSaveOff(); #endif @@ -730,7 +730,7 @@ void TFTDisplay::sendCommand(uint8_t com) unphone.backlight(true); // using unPhone library #endif #ifdef RAK14014 -#elif !defined(M5STACK_COREBASICBASIC) && !defined(ST7789_CS) // T-Deck gets brightness set in Screen.cpp in the handleSetOn function +#elif !defined(M5STACK_COREBASIC) && !defined(ST7789_CS) // T-Deck gets brightness set in Screen.cpp in the handleSetOn function tft->setBrightness(172); #endif break; @@ -742,7 +742,7 @@ void TFTDisplay::sendCommand(uint8_t com) tft->clear(); if (settingsMap[displayBacklight] > 0) digitalWrite(settingsMap[displayBacklight], !TFT_BACKLIGHT_ON); -#elif !defined(RAK14014) && !defined(M5STACK_COREBASICBASIC) && !defined(UNPHONE) +#elif !defined(RAK14014) && !defined(M5STACK_COREBASIC) && !defined(UNPHONE) tft->sleep(); tft->powerSaveOn(); #endif @@ -754,7 +754,7 @@ void TFTDisplay::sendCommand(uint8_t com) unphone.backlight(false); // using unPhone library #endif #ifdef RAK14014 -#elif !defined(M5STACK_COREBASICBASIC) +#elif !defined(M5STACK_COREBASIC) tft->setBrightness(0); #endif break; @@ -788,7 +788,7 @@ bool TFTDisplay::hasTouch(void) { #ifdef RAK14014 return true; -#elif !defined(M5STACK_COREBASICBASIC) +#elif !defined(M5STACK_COREBASIC) return tft->touch() != nullptr; #else return false; @@ -807,7 +807,7 @@ bool TFTDisplay::getTouch(int16_t *x, int16_t *y) } else { return false; } -#elif !defined(M5STACK_COREBASICBASIC) +#elif !defined(M5STACK_COREBASIC) return tft->getTouch(x, y); #else return false; @@ -839,7 +839,7 @@ bool TFTDisplay::connect() tft->init(); -#if defined(M5STACK_COREBASICBASIC) +#if defined(M5STACK_COREBASIC) tft->setRotation(0); #elif defined(RAK14014) tft->setRotation(1);