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 \
13
14
|| defined ARDUINO_TWATCH_2020_V1 \
14
15
|| defined ARDUINO_TWATCH_2020_V2 \
15
16
|| defined ARDUINO_LOLIN_D32_PRO \
17
+ || defined ARDUINO_ESP32_S3_BOX \
16
18
// yay! platform is supported
17
19
#else
18
20
#error "NO SUPPORTED BOARD DETECTED !!"
@@ -51,7 +53,7 @@ static const int AMIGABALL_YPOS = 50;
51
53
52
54
53
55
// display profiles switcher
54
- #if defined( ARDUINO_M5Stack_Core_ESP32 ) || defined( ARDUINO_M5STACK_FIRE ) || defined( ARDUINO_ODROID_ESP32 ) || defined( ARDUINO_M5STACK_Core2 ) || defined( ARDUINO_LOLIN_D32_PRO )
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
55
57
56
58
#if defined ARDUINO_M5Stack_Core_ESP32
57
59
//#undef WITH_WIFI // M5Stack has a small partition, disable WiFi
@@ -70,7 +72,7 @@ static const int AMIGABALL_YPOS = 50;
70
72
#undef hasHID
71
73
#define hasHID () (bool)false
72
74
73
- #elif defined( ARDUINO_ODROID_ESP32 ) // M5Core2
75
+ #elif defined( ARDUINO_ODROID_ESP32 ) // Odroid-Go
74
76
75
77
#undef WITH_WIFI // NTP is useless without a RTC module
76
78
#undef TIME_UPDATE_SOURCE // disable time update accordingly
@@ -79,7 +81,21 @@ static const int AMIGABALL_YPOS = 50;
79
81
#define tft_initOrientation () tft.setRotation(0)
80
82
#undef USE_SD_UPDATER // Odroid-Go prefers CrashOverride's Application Loader
81
83
82
- #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
92
+
93
+ #if ESP_ARDUINO_VERSION >= ESP_ARDUINO_VERSION_VAL (2 , 0 , 6 )
94
+ // espressif bloated the WiFi core since 2.0.7, now throwing
95
+ // an "IRAM0 segment data does not fit" linking error when used with NimBLE
96
+ #undef WITH_WIFI
97
+ #endif
98
+
83
99
#undef HAS_EXTERNAL_RTC
84
100
#define HAS_EXTERNAL_RTC true
85
101
#undef RTC_SDA
@@ -105,6 +121,18 @@ static const int AMIGABALL_YPOS = 50;
105
121
//#undef HEAPGRAPH_CORE
106
122
//#define HEAPGRAPH_CORE 0
107
123
124
+
125
+ #elif defined ARDUINO_ESP32_S3_BOX
126
+
127
+ #undef WITH_WIFI // can't fit on partition
128
+ #undef HAS_EXTERNAL_RTC
129
+ #define HAS_EXTERNAL_RTC true
130
+ #undef RTC_SDA
131
+ #undef RTC_SCL
132
+ #define RTC_SDA 41 // pin number
133
+ #define RTC_SCL 40 // pin number
134
+
135
+
108
136
#else
109
137
// M5Stack Classic, Fire
110
138
#undef HAS_EXTERNAL_RTC
@@ -241,13 +269,17 @@ static const int AMIGABALL_YPOS = 50;
241
269
242
270
#endif
243
271
272
+
273
+ #define USE_SCREENSHOTS // load tft->snap() functions
244
274
#include <ESP32-Chimera-Core.h> // https://github.com/tobozo/ESP32-Chimera-Core
245
275
276
+
246
277
#if !defined ECC_VERSION_MAJOR || !defined ECC_VERSION_MAJOR || !defined ECC_VERSION_MAJOR
247
278
#error "This app only uses ESP32-Chimera-Core >= 1.2.3"
248
279
#else
249
280
#if ((ECC_VERSION_MAJOR << 16 ) | (ECC_VERSION_MINOR << 8 ) | (ECC_VERSION_PATCH )) >= ((1 << 16 ) | (2 << 8 ) | (3 ))
250
281
// yay, minimal version requirements are met !
282
+ #define TFT_eSprite LGFX_Sprite // satisfy namespace requirements, comment this out if your version of chimera-core is too old
251
283
#else
252
284
#error "This app needs ESP32-Chimera-Core >= 1.2.3"
253
285
#endif
@@ -265,11 +297,14 @@ static const int AMIGABALL_YPOS = 50;
265
297
#define tft M5.Lcd // syntax sugar
266
298
//#include "HID_XPad.h" // external HID
267
299
300
+ #pragma GCC diagnostic ignored "-Wunused-variable"
268
301
269
302
static TFT_eSprite gradientSprite ( & tft ); // gradient background
270
303
static TFT_eSprite heapGraphSprite ( & tft ); // activity graph
271
304
static TFT_eSprite hallOfMacSprite ( & tft ); // mac address badge holder
272
305
306
+
307
+ void tft_hScrollTo (uint16_t vsp );
273
308
static bool isQuerying = false; // state maintained while SD is accessed, useful when SD is used instead of SD_MMC
274
309
// TODO: make this SD-driver dependant rather than platform dependant
275
310
static bool isInQuery ()
@@ -285,7 +320,11 @@ static bool isInQuery()
285
320
void tft_begin ()
286
321
{
287
322
288
- M5 .begin ( true, true, false, false, false ); // don't start Serial
323
+ #ifdef __M5STACKUPDATER_H
324
+ M5 .begin ( true, false, false, false, false ); // don't start Serial and SD
325
+ #else
326
+ M5 .begin ( true, true, false, false, false ); // don't start Serial
327
+ #endif
289
328
290
329
#if HAS_EXTERNAL_RTC
291
330
Wire .begin (RTC_SDA , RTC_SCL );
@@ -294,16 +333,21 @@ void tft_begin()
294
333
#endif
295
334
delay ( 100 );
296
335
#ifdef __M5STACKUPDATER_H
336
+
337
+ tft_hScrollTo (0 ); // reset scroll position
338
+
297
339
if ( hasHID () ) {
298
340
// build has buttons => enable SD Updater at boot
299
341
// New SD Updater support, requires the latest version of https://github.com/tobozo/M5Stack-SD-Updater/
342
+ SDUCfg .display = & tft ;
343
+
300
344
#if defined M5_SD_UPDATER_VERSION_INT
301
- SDUCfg .setLabelMenu ("<< Menu" );
302
- SDUCfg .setLabelSkip ("Launch" );
303
- SDUCfg .setAppName ( PLATFORM_NAME " BLE Collector" );
304
- SDUCfg .setBinFileName ( "/ESP32-BLECollector.bin" );
305
- //SDUCfg.useRolllback( false );
306
- checkSDUpdater ( BLE_FS , MENU_BIN , 5000 , TFCARD_CS_PIN ); // Filesystem, Launcher bin path, Wait delay, Sdcard CS pin
345
+ // SDUCfg.setLabelMenu("<< Menu");
346
+ // SDUCfg.setLabelSkip("Launch");
347
+ // SDUCfg.setAppName( PLATFORM_NAME " BLE Collector" );
348
+ // SDUCfg.setBinFileName( "/ESP32-BLECollector.bin" );
349
+ // SDUCfg.useRolllback( false );
350
+ checkSDUpdater ( BLE_FS , MENU_BIN , 15000 , TFCARD_CS_PIN ); // Filesystem, Launcher bin path, Wait delay, Sdcard CS pin
307
351
#else
308
352
checkSDUpdater ();
309
353
#endif
0 commit comments