2
2
3
3
#if defined ARDUINO_M5Stack_Core_ESP32 \
4
4
|| defined ARDUINO_M5STACK_Core2 \
5
+ || defined ARDUINO_M5STACK_CORES3 \
5
6
|| defined ARDUINO_M5STACK_FIRE \
6
7
|| defined ARDUINO_ODROID_ESP32 \
7
8
|| defined ARDUINO_ESP32_DEV \
@@ -52,7 +53,7 @@ static const int AMIGABALL_YPOS = 50;
52
53
53
54
54
55
// 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
56
57
57
58
#if defined ARDUINO_M5Stack_Core_ESP32
58
59
//#undef WITH_WIFI // M5Stack has a small partition, disable WiFi
@@ -80,7 +81,14 @@ static const int AMIGABALL_YPOS = 50;
80
81
#define tft_initOrientation () tft.setRotation(0)
81
82
#undef USE_SD_UPDATER // Odroid-Go prefers CrashOverride's Application Loader
82
83
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
84
92
#undef HAS_EXTERNAL_RTC
85
93
#define HAS_EXTERNAL_RTC true
86
94
#undef RTC_SDA
@@ -109,7 +117,14 @@ static const int AMIGABALL_YPOS = 50;
109
117
110
118
#elif defined ARDUINO_ESP32_S3_BOX
111
119
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
+
113
128
114
129
#else
115
130
// M5Stack Classic, Fire
@@ -247,13 +262,17 @@ static const int AMIGABALL_YPOS = 50;
247
262
248
263
#endif
249
264
265
+
266
+ #define USE_SCREENSHOTS // load tft->snap() functions
250
267
#include <ESP32-Chimera-Core.h> // https://github.com/tobozo/ESP32-Chimera-Core
251
268
269
+
252
270
#if !defined ECC_VERSION_MAJOR || !defined ECC_VERSION_MAJOR || !defined ECC_VERSION_MAJOR
253
271
#error "This app only uses ESP32-Chimera-Core >= 1.2.3"
254
272
#else
255
273
#if ((ECC_VERSION_MAJOR << 16 ) | (ECC_VERSION_MINOR << 8 ) | (ECC_VERSION_PATCH )) >= ((1 << 16 ) | (2 << 8 ) | (3 ))
256
274
// 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
257
276
#else
258
277
#error "This app needs ESP32-Chimera-Core >= 1.2.3"
259
278
#endif
@@ -273,11 +292,12 @@ static const int AMIGABALL_YPOS = 50;
273
292
274
293
#pragma GCC diagnostic ignored "-Wunused-variable"
275
294
276
-
277
295
static TFT_eSprite gradientSprite ( & tft ); // gradient background
278
296
static TFT_eSprite heapGraphSprite ( & tft ); // activity graph
279
297
static TFT_eSprite hallOfMacSprite ( & tft ); // mac address badge holder
280
298
299
+
300
+ void tft_hScrollTo (uint16_t vsp );
281
301
static bool isQuerying = false; // state maintained while SD is accessed, useful when SD is used instead of SD_MMC
282
302
// TODO: make this SD-driver dependant rather than platform dependant
283
303
static bool isInQuery ()
@@ -293,7 +313,11 @@ static bool isInQuery()
293
313
void tft_begin ()
294
314
{
295
315
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
297
321
298
322
#if HAS_EXTERNAL_RTC
299
323
Wire .begin (RTC_SDA , RTC_SCL );
@@ -302,16 +326,21 @@ void tft_begin()
302
326
#endif
303
327
delay ( 100 );
304
328
#ifdef __M5STACKUPDATER_H
329
+
330
+ tft_hScrollTo (0 ); // reset scroll position
331
+
305
332
if ( hasHID () ) {
306
333
// build has buttons => enable SD Updater at boot
307
334
// New SD Updater support, requires the latest version of https://github.com/tobozo/M5Stack-SD-Updater/
335
+ SDUCfg .display = & tft ;
336
+
308
337
#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
315
344
#else
316
345
checkSDUpdater ();
317
346
#endif
0 commit comments