22
33#if defined ARDUINO_M5Stack_Core_ESP32 \
44 || defined ARDUINO_M5STACK_Core2 \
5+ || defined ARDUINO_M5STACK_CORES3 \
56 || defined ARDUINO_M5STACK_FIRE \
67 || defined ARDUINO_ODROID_ESP32 \
78 || defined ARDUINO_ESP32_DEV \
@@ -52,7 +53,7 @@ static const int AMIGABALL_YPOS = 50;
5253
5354
5455// display profiles switcher
55- #if defined( ARDUINO_M5Stack_Core_ESP32 ) || defined( ARDUINO_M5STACK_FIRE ) || defined( ARDUINO_ODROID_ESP32 ) || defined( ARDUINO_M5STACK_Core2 ) || defined( ARDUINO_LOLIN_D32_PRO ) || defined ARDUINO_ESP32_S3_BOX
56+ #if defined( ARDUINO_M5Stack_Core_ESP32 ) || defined( ARDUINO_M5STACK_FIRE ) || defined( ARDUINO_ODROID_ESP32 ) || defined( ARDUINO_M5STACK_Core2 ) || defined( ARDUINO_LOLIN_D32_PRO ) || defined ARDUINO_ESP32_S3_BOX || defined ARDUINO_M5STACK_CORES3
5657
5758 #if defined ARDUINO_M5Stack_Core_ESP32
5859 //#undef WITH_WIFI // M5Stack has a small partition, disable WiFi
@@ -80,7 +81,14 @@ static const int AMIGABALL_YPOS = 50;
8081 #define tft_initOrientation () tft.setRotation(0)
8182 #undef USE_SD_UPDATER // Odroid-Go prefers CrashOverride's Application Loader
8283
83- #elif defined( ARDUINO_M5STACK_Core2 ) // M5Core2
84+ #elif defined ARDUINO_M5STACK_CORES3 // M5CoreS3
85+
86+ #undef HAS_EXTERNAL_RTC
87+ #define HAS_EXTERNAL_RTC false
88+ #undef BASE_BRIGHTNESS
89+ #define BASE_BRIGHTNESS 100
90+
91+ #elif defined ARDUINO_M5STACK_Core2 // M5Core2
8492 #undef HAS_EXTERNAL_RTC
8593 #define HAS_EXTERNAL_RTC true
8694 #undef RTC_SDA
@@ -109,7 +117,14 @@ static const int AMIGABALL_YPOS = 50;
109117
110118 #elif defined ARDUINO_ESP32_S3_BOX
111119
112- #undef WITH_WIFI // NTP is useless without a RTC module
120+ #undef WITH_WIFI // can't fit on partition
121+ #undef HAS_EXTERNAL_RTC
122+ #define HAS_EXTERNAL_RTC true
123+ #undef RTC_SDA
124+ #undef RTC_SCL
125+ #define RTC_SDA 41 // pin number
126+ #define RTC_SCL 40 // pin number
127+
113128
114129 #else
115130 // M5Stack Classic, Fire
@@ -247,13 +262,17 @@ static const int AMIGABALL_YPOS = 50;
247262
248263#endif
249264
265+
266+ #define USE_SCREENSHOTS // load tft->snap() functions
250267#include <ESP32-Chimera-Core.h> // https://github.com/tobozo/ESP32-Chimera-Core
251268
269+
252270#if !defined ECC_VERSION_MAJOR || !defined ECC_VERSION_MAJOR || !defined ECC_VERSION_MAJOR
253271 #error "This app only uses ESP32-Chimera-Core >= 1.2.3"
254272#else
255273 #if ((ECC_VERSION_MAJOR << 16 ) | (ECC_VERSION_MINOR << 8 ) | (ECC_VERSION_PATCH )) >= ((1 << 16 ) | (2 << 8 ) | (3 ))
256274 // yay, minimal version requirements are met !
275+ #define TFT_eSprite LGFX_Sprite // satisfy namespace requirements, comment this out if your version of chimera-core is too old
257276 #else
258277 #error "This app needs ESP32-Chimera-Core >= 1.2.3"
259278 #endif
@@ -273,11 +292,12 @@ static const int AMIGABALL_YPOS = 50;
273292
274293#pragma GCC diagnostic ignored "-Wunused-variable"
275294
276-
277295static TFT_eSprite gradientSprite ( & tft ); // gradient background
278296static TFT_eSprite heapGraphSprite ( & tft ); // activity graph
279297static TFT_eSprite hallOfMacSprite ( & tft ); // mac address badge holder
280298
299+
300+ void tft_hScrollTo (uint16_t vsp );
281301static bool isQuerying = false; // state maintained while SD is accessed, useful when SD is used instead of SD_MMC
282302// TODO: make this SD-driver dependant rather than platform dependant
283303static bool isInQuery ()
@@ -293,7 +313,11 @@ static bool isInQuery()
293313void tft_begin ()
294314{
295315
296- M5 .begin ( true, true, false, false, false ); // don't start Serial
316+ #ifdef __M5STACKUPDATER_H
317+ M5 .begin ( true, false, false, false, false ); // don't start Serial and SD
318+ #else
319+ M5 .begin ( true, true, false, false, false ); // don't start Serial
320+ #endif
297321
298322 #if HAS_EXTERNAL_RTC
299323 Wire .begin (RTC_SDA , RTC_SCL );
@@ -302,16 +326,21 @@ void tft_begin()
302326 #endif
303327 delay ( 100 );
304328 #ifdef __M5STACKUPDATER_H
329+
330+ tft_hScrollTo (0 ); // reset scroll position
331+
305332 if ( hasHID () ) {
306333 // build has buttons => enable SD Updater at boot
307334 // New SD Updater support, requires the latest version of https://github.com/tobozo/M5Stack-SD-Updater/
335+ SDUCfg .display = & tft ;
336+
308337 #if defined M5_SD_UPDATER_VERSION_INT
309- SDUCfg .setLabelMenu ("<< Menu" );
310- SDUCfg .setLabelSkip ("Launch" );
311- SDUCfg .setAppName ( PLATFORM_NAME " BLE Collector" );
312- SDUCfg .setBinFileName ( "/ESP32-BLECollector.bin" );
313- //SDUCfg.useRolllback( false );
314- checkSDUpdater ( BLE_FS , MENU_BIN , 5000 , TFCARD_CS_PIN ); // Filesystem, Launcher bin path, Wait delay, Sdcard CS pin
338+ // SDUCfg.setLabelMenu("<< Menu");
339+ // SDUCfg.setLabelSkip("Launch");
340+ // SDUCfg.setAppName( PLATFORM_NAME " BLE Collector" );
341+ // SDUCfg.setBinFileName( "/ESP32-BLECollector.bin" );
342+ // SDUCfg.useRolllback( false );
343+ checkSDUpdater ( BLE_FS , MENU_BIN , 15000 , TFCARD_CS_PIN ); // Filesystem, Launcher bin path, Wait delay, Sdcard CS pin
315344 #else
316345 checkSDUpdater ();
317346 #endif
0 commit comments