From e75a8497006a70f53ef5a97a374c628300e4474c Mon Sep 17 00:00:00 2001 From: moononournation Date: Sat, 28 Dec 2024 21:30:42 +0800 Subject: [PATCH] Repositioning GFX_EXTRA_PRE_INIT() as DEV_DEVICE_INIT() --- examples/ArduinoVNC/ArduinoVNC.ino | 8 +++--- examples/AsciiTable/AsciiTable.ino | 8 +++--- examples/Clock/Clock.ino | 8 +++--- examples/HelloWorld/HelloWorld.ino | 8 +++--- .../HelloWorldGfxfont/HelloWorldGfxfont.ino | 8 +++--- .../ImgViewerAnimatedGIF_GIFDEC.ino | 8 +++--- .../ImgViewerAnimatedGIF_bitbank.ino | 8 +++--- .../ImgViewer/ImgViewerBmp/ImgViewerBmp.ino | 8 +++--- .../ImgViewerJpeg_ESP32_JPEG.ino | 8 +++--- .../ImgViewerJpeg_JPEGDEC.ino | 8 +++--- .../ImgViewerMjpeg_ESP32_JPEG.ino | 8 +++--- .../ImgViewerMjpeg_JPEGDEC.ino | 8 +++--- .../ImgViewerPROGMEM/ImgViewerPROGMEM.ino | 8 +++--- .../ImgViewerPng_PNGdec.ino | 8 +++--- .../ImgViewerTiff_G4/ImgViewerTiff_G4.ino | 8 +++--- .../LVGL/LVGL_Arduino_v8/LVGL_Arduino_v8.ino | 8 +++--- .../LVGL/LVGL_Arduino_v9/LVGL_Arduino_v9.ino | 8 +++--- examples/LVGL/LvglBenchmark/LvglBenchmark.ino | 8 +++--- .../LvglHelloNeoPixel/LvglHelloNeoPixel.ino | 8 +++--- .../MultipleAnimatedGIF.ino | 8 +++--- .../MultiplePDQgraphicstest.ino | 8 +++--- .../PDQgraphicstest/Arduino_GFX_dev_device.h | 26 ++++++++++--------- examples/PDQgraphicstest/PDQgraphicstest.ino | 8 +++--- examples/SetTextBound/SetTextBound.ino | 8 +++--- examples/Sprite/SpriteGif/SpriteGif.ino | 8 +++--- .../TouchCalibration/TouchCalibration.ino | 8 +++--- .../U8g2FontHelloWorld/U8g2FontHelloWorld.ino | 8 +++--- .../U8g2FontPrintUTF8/U8g2FontPrintUTF8.ino | 8 +++--- .../U8g2FontUTF8Chinese.ino | 8 +++--- .../U8g2FontUTF8FullCJK.ino | 8 +++--- .../U8g2FontUTF8FullUnifont.ino | 8 +++--- .../U8g2Font/U8g2RssReader/U8g2RssReader.ino | 8 +++--- .../ESPWiFiAnalyzer/ESPWiFiAnalyzer.ino | 8 +++--- .../ESPWiFiAnalyzerUTF8.ino | 8 +++--- .../PicoWiFiAnalyzer/PicoWiFiAnalyzer.ino | 8 +++--- .../PicoWiFiAnalyzerUTF8.ino | 8 +++--- .../RTLWiFiAnalyzer/RTLWiFiAnalyzer.ino | 8 +++--- .../RTLWiFiAnalyzerUTF8.ino | 8 +++--- .../WioWiFiAnalyzer/WioWiFiAnalyzer.ino | 8 +++--- examples/WiFiPhotoFrame/WiFiPhotoFrame.ino | 8 +++--- 40 files changed, 170 insertions(+), 168 deletions(-) diff --git a/examples/ArduinoVNC/ArduinoVNC.ino b/examples/ArduinoVNC/ArduinoVNC.ino index 64be891d..09c1b7fa 100644 --- a/examples/ArduinoVNC/ArduinoVNC.ino +++ b/examples/ArduinoVNC/ArduinoVNC.ino @@ -169,15 +169,15 @@ void handle_keyboard() void setup(void) { +#ifdef DEV_DEVICE_INIT + DEV_DEVICE_INIT(); +#endif + Serial.begin(115200); // Serial.setDebugOutput(true); // while(!Serial); Serial.println("Arduino_GFX VNC example"); -#ifdef GFX_EXTRA_PRE_INIT - GFX_EXTRA_PRE_INIT(); -#endif - // Init keyboard device keyboard_init(); diff --git a/examples/AsciiTable/AsciiTable.ino b/examples/AsciiTable/AsciiTable.ino index e53ea5b5..0a7eb6a0 100644 --- a/examples/AsciiTable/AsciiTable.ino +++ b/examples/AsciiTable/AsciiTable.ino @@ -46,15 +46,15 @@ Arduino_GFX *gfx = new Arduino_ILI9341(bus, DF_GFX_RST, 0 /* rotation */, false void setup(void) { +#ifdef DEV_DEVICE_INIT + DEV_DEVICE_INIT(); +#endif + Serial.begin(115200); // Serial.setDebugOutput(true); // while(!Serial); Serial.println("Arduino_GFX AsciiTable example"); -#ifdef GFX_EXTRA_PRE_INIT - GFX_EXTRA_PRE_INIT(); -#endif - // Init Display if (!gfx->begin()) { diff --git a/examples/Clock/Clock.ino b/examples/Clock/Clock.ino index df759617..03ea20fd 100644 --- a/examples/Clock/Clock.ino +++ b/examples/Clock/Clock.ino @@ -77,15 +77,15 @@ static int16_t *last_cached_point; void setup(void) { +#ifdef DEV_DEVICE_INIT + DEV_DEVICE_INIT(); +#endif + Serial.begin(115200); // Serial.setDebugOutput(true); // while(!Serial); Serial.println("Arduino_GFX Clock example"); -#ifdef GFX_EXTRA_PRE_INIT - GFX_EXTRA_PRE_INIT(); -#endif - // Init Display if (!gfx->begin()) { diff --git a/examples/HelloWorld/HelloWorld.ino b/examples/HelloWorld/HelloWorld.ino index 50a6340a..0ceb6c57 100644 --- a/examples/HelloWorld/HelloWorld.ino +++ b/examples/HelloWorld/HelloWorld.ino @@ -40,15 +40,15 @@ Arduino_GFX *gfx = new Arduino_ILI9341(bus, DF_GFX_RST, 0 /* rotation */, false void setup(void) { +#ifdef DEV_DEVICE_INIT + DEV_DEVICE_INIT(); +#endif + Serial.begin(115200); // Serial.setDebugOutput(true); // while(!Serial); Serial.println("Arduino_GFX Hello World example"); -#ifdef GFX_EXTRA_PRE_INIT - GFX_EXTRA_PRE_INIT(); -#endif - // Init Display if (!gfx->begin()) { diff --git a/examples/HelloWorldGfxfont/HelloWorldGfxfont.ino b/examples/HelloWorldGfxfont/HelloWorldGfxfont.ino index db0515bb..7271301d 100644 --- a/examples/HelloWorldGfxfont/HelloWorldGfxfont.ino +++ b/examples/HelloWorldGfxfont/HelloWorldGfxfont.ino @@ -45,15 +45,15 @@ Arduino_GFX *gfx = new Arduino_ILI9341(bus, DF_GFX_RST, 0 /* rotation */, false void setup(void) { +#ifdef DEV_DEVICE_INIT + DEV_DEVICE_INIT(); +#endif + Serial.begin(115200); // Serial.setDebugOutput(true); // while(!Serial); Serial.println("Arduino_GFX Hello World Gfxfont example"); -#ifdef GFX_EXTRA_PRE_INIT - GFX_EXTRA_PRE_INIT(); -#endif - // Init Display if (!gfx->begin()) { diff --git a/examples/ImgViewer/ImgViewerAnimatedGIF_GIFDEC/ImgViewerAnimatedGIF_GIFDEC.ino b/examples/ImgViewer/ImgViewerAnimatedGIF_GIFDEC/ImgViewerAnimatedGIF_GIFDEC.ino index 34820ec9..796cd5bd 100644 --- a/examples/ImgViewer/ImgViewerAnimatedGIF_GIFDEC/ImgViewerAnimatedGIF_GIFDEC.ino +++ b/examples/ImgViewer/ImgViewerAnimatedGIF_GIFDEC/ImgViewerAnimatedGIF_GIFDEC.ino @@ -103,15 +103,15 @@ static GifClass gifClass; void setup() { +#ifdef DEV_DEVICE_INIT + DEV_DEVICE_INIT(); +#endif + Serial.begin(115200); // Serial.setDebugOutput(true); // while(!Serial); Serial.println("Arduino_GFX Animated GIF Image Viewer example"); -#ifdef GFX_EXTRA_PRE_INIT - GFX_EXTRA_PRE_INIT(); -#endif - // Init Display if (!gfx->begin()) { diff --git a/examples/ImgViewer/ImgViewerAnimatedGIF_bitbank/ImgViewerAnimatedGIF_bitbank.ino b/examples/ImgViewer/ImgViewerAnimatedGIF_bitbank/ImgViewerAnimatedGIF_bitbank.ino index 82aebe0c..8494edf4 100644 --- a/examples/ImgViewer/ImgViewerAnimatedGIF_bitbank/ImgViewerAnimatedGIF_bitbank.ino +++ b/examples/ImgViewer/ImgViewerAnimatedGIF_bitbank/ImgViewerAnimatedGIF_bitbank.ino @@ -267,15 +267,15 @@ void GIFDraw(GIFDRAW *pDraw) void setup() { +#ifdef DEV_DEVICE_INIT + DEV_DEVICE_INIT(); +#endif + Serial.begin(115200); // Serial.setDebugOutput(true); // while(!Serial); Serial.println("Arduino_GFX Animated GIF Image Viewer example"); -#ifdef GFX_EXTRA_PRE_INIT - GFX_EXTRA_PRE_INIT(); -#endif - // Init Display if (!gfx->begin()) { diff --git a/examples/ImgViewer/ImgViewerBmp/ImgViewerBmp.ino b/examples/ImgViewer/ImgViewerBmp/ImgViewerBmp.ino index 98051e47..7fea80ad 100644 --- a/examples/ImgViewer/ImgViewerBmp/ImgViewerBmp.ino +++ b/examples/ImgViewer/ImgViewerBmp/ImgViewerBmp.ino @@ -101,15 +101,15 @@ static void bmpDrawCallback(int16_t x, int16_t y, uint16_t *bitmap, int16_t w, i void setup() { +#ifdef DEV_DEVICE_INIT + DEV_DEVICE_INIT(); +#endif + Serial.begin(115200); // Serial.setDebugOutput(true); // while(!Serial); Serial.println("Arduino_GFX BMP Image Viewer example"); -#ifdef GFX_EXTRA_PRE_INIT - GFX_EXTRA_PRE_INIT(); -#endif - // Init Display if (!gfx->begin()) { diff --git a/examples/ImgViewer/ImgViewerJpeg_ESP32_JPEG/ImgViewerJpeg_ESP32_JPEG.ino b/examples/ImgViewer/ImgViewerJpeg_ESP32_JPEG/ImgViewerJpeg_ESP32_JPEG.ino index a1ef0c13..2ec77426 100644 --- a/examples/ImgViewer/ImgViewerJpeg_ESP32_JPEG/ImgViewerJpeg_ESP32_JPEG.ino +++ b/examples/ImgViewer/ImgViewerJpeg_ESP32_JPEG/ImgViewerJpeg_ESP32_JPEG.ino @@ -139,15 +139,15 @@ _exit: void setup() { +#ifdef DEV_DEVICE_INIT + DEV_DEVICE_INIT(); +#endif + Serial.begin(115200); // Serial.setDebugOutput(true); // while(!Serial); Serial.println("Arduino_GFX ESP32 SIMD JPEG Image Viewer example"); -#ifdef GFX_EXTRA_PRE_INIT - GFX_EXTRA_PRE_INIT(); -#endif - // Init Display if (!gfx->begin()) { diff --git a/examples/ImgViewer/ImgViewerJpeg_JPEGDEC/ImgViewerJpeg_JPEGDEC.ino b/examples/ImgViewer/ImgViewerJpeg_JPEGDEC/ImgViewerJpeg_JPEGDEC.ino index 5996d592..fcf3f5be 100644 --- a/examples/ImgViewer/ImgViewerJpeg_JPEGDEC/ImgViewerJpeg_JPEGDEC.ino +++ b/examples/ImgViewer/ImgViewerJpeg_JPEGDEC/ImgViewerJpeg_JPEGDEC.ino @@ -100,15 +100,15 @@ static int jpegDrawCallback(JPEGDRAW *pDraw) void setup() { +#ifdef DEV_DEVICE_INIT + DEV_DEVICE_INIT(); +#endif + Serial.begin(115200); // Serial.setDebugOutput(true); // while(!Serial); Serial.println("Arduino_GFX JPEG Image Viewer example"); -#ifdef GFX_EXTRA_PRE_INIT - GFX_EXTRA_PRE_INIT(); -#endif - // Init Display if (!gfx->begin()) { diff --git a/examples/ImgViewer/ImgViewerMjpeg_ESP32_JPEG/ImgViewerMjpeg_ESP32_JPEG.ino b/examples/ImgViewer/ImgViewerMjpeg_ESP32_JPEG/ImgViewerMjpeg_ESP32_JPEG.ino index 656c78a4..14e70876 100644 --- a/examples/ImgViewer/ImgViewerMjpeg_ESP32_JPEG/ImgViewerMjpeg_ESP32_JPEG.ino +++ b/examples/ImgViewer/ImgViewerMjpeg_ESP32_JPEG/ImgViewerMjpeg_ESP32_JPEG.ino @@ -72,15 +72,15 @@ static int16_t x = -1, y = -1, w = -1, h = -1; void setup() { +#ifdef DEV_DEVICE_INIT + DEV_DEVICE_INIT(); +#endif + Serial.begin(115200); // Serial.setDebugOutput(true); // while(!Serial); Serial.println("Arduino_GFX Motion JPEG SIMD Decoder Image Viewer example"); -#ifdef GFX_EXTRA_PRE_INIT - GFX_EXTRA_PRE_INIT(); -#endif - // Init Display if (!gfx->begin()) { diff --git a/examples/ImgViewer/ImgViewerMjpeg_JPEGDEC/ImgViewerMjpeg_JPEGDEC.ino b/examples/ImgViewer/ImgViewerMjpeg_JPEGDEC/ImgViewerMjpeg_JPEGDEC.ino index c68ab60f..dccc8ec8 100644 --- a/examples/ImgViewer/ImgViewerMjpeg_JPEGDEC/ImgViewerMjpeg_JPEGDEC.ino +++ b/examples/ImgViewer/ImgViewerMjpeg_JPEGDEC/ImgViewerMjpeg_JPEGDEC.ino @@ -115,15 +115,15 @@ static int jpegDrawCallback(JPEGDRAW *pDraw) void setup() { +#ifdef DEV_DEVICE_INIT + DEV_DEVICE_INIT(); +#endif + Serial.begin(115200); // Serial.setDebugOutput(true); // while(!Serial); Serial.println("Arduino_GFX Motion JPEG Image Viewer example"); -#ifdef GFX_EXTRA_PRE_INIT - GFX_EXTRA_PRE_INIT(); -#endif - // Init Display if (!gfx->begin()) { diff --git a/examples/ImgViewer/ImgViewerPROGMEM/ImgViewerPROGMEM.ino b/examples/ImgViewer/ImgViewerPROGMEM/ImgViewerPROGMEM.ino index 85c86211..8fac8605 100644 --- a/examples/ImgViewer/ImgViewerPROGMEM/ImgViewerPROGMEM.ino +++ b/examples/ImgViewer/ImgViewerPROGMEM/ImgViewerPROGMEM.ino @@ -56,15 +56,15 @@ Arduino_GFX *gfx = new Arduino_ILI9341(bus, DF_GFX_RST, 3 /* rotation */, false void setup() { +#ifdef DEV_DEVICE_INIT + DEV_DEVICE_INIT(); +#endif + Serial.begin(115200); // Serial.setDebugOutput(true); // while(!Serial); Serial.println("Arduino_GFX PROGMEM Image Viewer example"); -#ifdef GFX_EXTRA_PRE_INIT - GFX_EXTRA_PRE_INIT(); -#endif - // Init Display if (!gfx->begin()) { diff --git a/examples/ImgViewer/ImgViewerPng_PNGdec/ImgViewerPng_PNGdec.ino b/examples/ImgViewer/ImgViewerPng_PNGdec/ImgViewerPng_PNGdec.ino index 0e629368..f94ea351 100644 --- a/examples/ImgViewer/ImgViewerPng_PNGdec/ImgViewerPng_PNGdec.ino +++ b/examples/ImgViewer/ImgViewerPng_PNGdec/ImgViewerPng_PNGdec.ino @@ -166,15 +166,15 @@ void PNGDraw(PNGDRAW *pDraw) void setup() { +#ifdef DEV_DEVICE_INIT + DEV_DEVICE_INIT(); +#endif + Serial.begin(115200); // Serial.setDebugOutput(true); // while(!Serial); Serial.println("Arduino_GFX PNG Image Viewer example"); -#ifdef GFX_EXTRA_PRE_INIT - GFX_EXTRA_PRE_INIT(); -#endif - // Init Display if (!gfx->begin()) { diff --git a/examples/ImgViewer/ImgViewerTiff_G4/ImgViewerTiff_G4.ino b/examples/ImgViewer/ImgViewerTiff_G4/ImgViewerTiff_G4.ino index 06de5ba3..c137c33b 100644 --- a/examples/ImgViewer/ImgViewerTiff_G4/ImgViewerTiff_G4.ino +++ b/examples/ImgViewer/ImgViewerTiff_G4/ImgViewerTiff_G4.ino @@ -145,15 +145,15 @@ void TIFFDraw(TIFFDRAW *pDraw) void setup() { +#ifdef DEV_DEVICE_INIT + DEV_DEVICE_INIT(); +#endif + Serial.begin(115200); // Serial.setDebugOutput(true); // while(!Serial); Serial.println("Arduino_GFX TIFF Image Viewer example"); -#ifdef GFX_EXTRA_PRE_INIT - GFX_EXTRA_PRE_INIT(); -#endif - // Init Display if (!gfx->begin()) { diff --git a/examples/LVGL/LVGL_Arduino_v8/LVGL_Arduino_v8.ino b/examples/LVGL/LVGL_Arduino_v8/LVGL_Arduino_v8.ino index dde89f91..6c516f9f 100644 --- a/examples/LVGL/LVGL_Arduino_v8/LVGL_Arduino_v8.ino +++ b/examples/LVGL/LVGL_Arduino_v8/LVGL_Arduino_v8.ino @@ -117,6 +117,10 @@ void my_touchpad_read(lv_indev_drv_t *indev_drv, lv_indev_data_t *data) void setup() { +#ifdef DEV_DEVICE_INIT + DEV_DEVICE_INIT(); +#endif + Serial.begin(115200); // Serial.setDebugOutput(true); // while(!Serial); @@ -124,10 +128,6 @@ void setup() String LVGL_Arduino = String('V') + lv_version_major() + "." + lv_version_minor() + "." + lv_version_patch(); Serial.println(LVGL_Arduino); -#ifdef GFX_EXTRA_PRE_INIT - GFX_EXTRA_PRE_INIT(); -#endif - // Init Display if (!gfx->begin()) { diff --git a/examples/LVGL/LVGL_Arduino_v9/LVGL_Arduino_v9.ino b/examples/LVGL/LVGL_Arduino_v9/LVGL_Arduino_v9.ino index 99a5c520..0b9458b7 100644 --- a/examples/LVGL/LVGL_Arduino_v9/LVGL_Arduino_v9.ino +++ b/examples/LVGL/LVGL_Arduino_v9/LVGL_Arduino_v9.ino @@ -118,6 +118,10 @@ void my_touchpad_read(lv_indev_t *indev, lv_indev_data_t *data) void setup() { +#ifdef DEV_DEVICE_INIT + DEV_DEVICE_INIT(); +#endif + Serial.begin(115200); // Serial.setDebugOutput(true); // while(!Serial); @@ -125,10 +129,6 @@ void setup() String LVGL_Arduino = String('V') + lv_version_major() + "." + lv_version_minor() + "." + lv_version_patch(); Serial.println(LVGL_Arduino); -#ifdef GFX_EXTRA_PRE_INIT - GFX_EXTRA_PRE_INIT(); -#endif - // Init Display if (!gfx->begin()) { diff --git a/examples/LVGL/LvglBenchmark/LvglBenchmark.ino b/examples/LVGL/LvglBenchmark/LvglBenchmark.ino index 4146e10e..8d66ac04 100644 --- a/examples/LVGL/LvglBenchmark/LvglBenchmark.ino +++ b/examples/LVGL/LvglBenchmark/LvglBenchmark.ino @@ -129,6 +129,10 @@ void my_touchpad_read(lv_indev_drv_t *indev_drv, lv_indev_data_t *data) void setup() { +#ifdef DEV_DEVICE_INIT + DEV_DEVICE_INIT(); +#endif + Serial.begin(115200); // Serial.setDebugOutput(true); // while(!Serial); @@ -136,10 +140,6 @@ void setup() String LVGL_Arduino = String('V') + lv_version_major() + "." + lv_version_minor() + "." + lv_version_patch(); Serial.println(LVGL_Arduino); -#ifdef GFX_EXTRA_PRE_INIT - GFX_EXTRA_PRE_INIT(); -#endif - // Init Display if (!gfx->begin()) { diff --git a/examples/LVGL/LvglHelloNeoPixel/LvglHelloNeoPixel.ino b/examples/LVGL/LvglHelloNeoPixel/LvglHelloNeoPixel.ino index 47fd5712..95340ec7 100644 --- a/examples/LVGL/LvglHelloNeoPixel/LvglHelloNeoPixel.ino +++ b/examples/LVGL/LvglHelloNeoPixel/LvglHelloNeoPixel.ino @@ -47,15 +47,15 @@ void my_disp_flush(lv_disp_drv_t *disp, const lv_area_t *area, lv_color_t *color void setup() { +#ifdef DEV_DEVICE_INIT + DEV_DEVICE_INIT(); +#endif + Serial.begin(115200); // Serial.setDebugOutput(true); // while(!Serial); Serial.println("Arduino_GFX LVGL Hello NeoPixel example"); -#ifdef GFX_EXTRA_PRE_INIT - GFX_EXTRA_PRE_INIT(); -#endif - // Init Display if (!gfx->begin()) { diff --git a/examples/MultipleDisplay/MultipleAnimatedGIF/MultipleAnimatedGIF.ino b/examples/MultipleDisplay/MultipleAnimatedGIF/MultipleAnimatedGIF.ino index 62517ddf..fc26a201 100644 --- a/examples/MultipleDisplay/MultipleAnimatedGIF/MultipleAnimatedGIF.ino +++ b/examples/MultipleDisplay/MultipleAnimatedGIF/MultipleAnimatedGIF.ino @@ -68,15 +68,15 @@ static GifClass gifClass4; void setup() { +#ifdef DEV_DEVICE_INIT + DEV_DEVICE_INIT(); +#endif + Serial.begin(115200); // Serial.setDebugOutput(true); // while(!Serial); Serial.println("Arduino_GFX Multiple Display Animated GIF example!"); -#ifdef GFX_EXTRA_PRE_INIT - GFX_EXTRA_PRE_INIT(); -#endif - // Init all displays if (!gfx1->begin()) diff --git a/examples/MultipleDisplay/MultiplePDQgraphicstest/MultiplePDQgraphicstest.ino b/examples/MultipleDisplay/MultiplePDQgraphicstest/MultiplePDQgraphicstest.ino index 6722a186..c561e7e5 100644 --- a/examples/MultipleDisplay/MultiplePDQgraphicstest/MultiplePDQgraphicstest.ino +++ b/examples/MultipleDisplay/MultiplePDQgraphicstest/MultiplePDQgraphicstest.ino @@ -31,15 +31,15 @@ uint8_t tsa, tsb, tsc, ds; void setup() { +#ifdef DEV_DEVICE_INIT + DEV_DEVICE_INIT(); +#endif + Serial.begin(115200); // Serial.setDebugOutput(true); // while(!Serial); Serial.println("Arduino_GFX Multiple Display example!"); -#ifdef GFX_EXTRA_PRE_INIT - GFX_EXTRA_PRE_INIT(); -#endif - // Init all displays if (!gfx1->begin()) diff --git a/examples/PDQgraphicstest/Arduino_GFX_dev_device.h b/examples/PDQgraphicstest/Arduino_GFX_dev_device.h index dfeb97ad..7bf9f875 100644 --- a/examples/PDQgraphicstest/Arduino_GFX_dev_device.h +++ b/examples/PDQgraphicstest/Arduino_GFX_dev_device.h @@ -57,7 +57,7 @@ #include #include Adafruit_AW9523 aw; -#define GFX_EXTRA_PRE_INIT() \ +#define DEV_DEVICE_INIT() \ { \ Wire.begin(6 /* SDA */, 5 /* SCL */); \ aw.begin(0x59); \ @@ -291,7 +291,7 @@ Arduino_GFX *gfx = new Arduino_ILI9342(bus, GFX_NOT_DEFINED /* RST */, 0 /* rota #elif defined(ESP32_S3_EYE) #define GFX_DEV_DEVICE ESP32_S3_EYE -#define GFX_EXTRA_PRE_INIT() \ +#define DEV_DEVICE_INIT() \ { \ pinMode(3 /* camera indicator */, OUTPUT); \ digitalWrite(3 /* camera indicator */, LOW); \ @@ -452,12 +452,14 @@ Arduino_GFX *gfx = new Arduino_ST77916(bus, 47 /* RST */, 0 /* rotation */, true #elif defined(LILYGO_T_DECK) #define GFX_DEV_DEVICE LILYGO_T_DECK -#define GFX_EXTRA_PRE_INIT() \ +#define DEV_DEVICE_INIT() \ { \ - pinMode(39 /* TDECK_SDCARD_CS */, OUTPUT); \ - digitalWrite(39 /* TDECK_SDCARD_CS */, HIGH); \ pinMode(9 /* TDECK_RADIO_CS */, OUTPUT); \ digitalWrite(9 /* TDECK_RADIO_CS */, HIGH); \ + pinMode(12 /* TDECK_LCD_CS */, OUTPUT); \ + digitalWrite(12 /* TDECK_LCD_CS */, HIGH); \ + pinMode(39 /* TDECK_SDCARD_CS */, OUTPUT); \ + digitalWrite(39 /* TDECK_SDCARD_CS */, HIGH); \ pinMode(10 /* TDECK_PERI_POWERON */, OUTPUT); \ digitalWrite(10 /* TDECK_PERI_POWERON */, HIGH); \ delay(500); \ @@ -474,7 +476,7 @@ Arduino_GFX *gfx = new Arduino_ST7789(bus, 23 /* RST */, 0 /* rotation */, true #elif defined(LILYGO_T_DISPLAY_S3) #define GFX_DEV_DEVICE LILYGO_T_DISPLAY_S3 -#define GFX_EXTRA_PRE_INIT() \ +#define DEV_DEVICE_INIT() \ { \ pinMode(15 /* PWD */, OUTPUT); \ digitalWrite(15 /* PWD */, HIGH); \ @@ -493,8 +495,8 @@ Arduino_GFX *gfx = new Arduino_RM67162(bus, 17 /* RST */, 0 /* rotation */); #elif defined(LILYGO_T_Display_S3_AMOLED_1_64) #define GFX_DEV_DEVICE LILYGO_T_DISPLAY_S3_AMOLED_1_64 -#define GFX_EXTRA_PRE_INIT() \ - { \ +#define DEV_DEVICE_INIT() \ + { \ pinMode(16 /* LCD_EN */, OUTPUT); \ digitalWrite(16 /* LCD_EN */, HIGH); \ } @@ -522,7 +524,7 @@ Arduino_GFX *gfx = new Arduino_ST7796(bus, 47 /* RST */, 0 /* rotation */, true #elif defined(LILYGO_T_QT) #define GFX_DEV_DEVICE LILYGO_T_QT -#define GFX_EXTRA_PRE_INIT() \ +#define DEV_DEVICE_INIT() \ { \ pinMode(10 /* BL */, OUTPUT); \ digitalWrite(10 /* BL */, LOW); \ @@ -533,7 +535,7 @@ Arduino_GFX *gfx = new Arduino_GC9107(bus, 1 /* RST */, 0 /* rotation */, true / #elif defined(LILYGO_T_RGB) #define GFX_DEV_DEVICE LILYGO_T_RGB #include -#define GFX_EXTRA_PRE_INIT() \ +#define DEV_DEVICE_INIT() \ { \ Wire.begin(8 /* SDA */, 48 /* SCL */, 800000L /* speed */); \ } @@ -555,7 +557,7 @@ Arduino_RGB_Display *gfx = new Arduino_RGB_Display( #elif defined(LILYGO_T_TRACK) #define GFX_DEV_DEVICE LILYGO_T_TRACK -#define GFX_EXTRA_PRE_INIT() \ +#define DEV_DEVICE_INIT() \ { \ pinMode(4 /* POWER */, OUTPUT); \ digitalWrite(4 /* POWER */, HIGH); \ @@ -573,7 +575,7 @@ Arduino_GFX *gfx = new Arduino_GC9A01(bus, 27 /* RST */, 0 /* rotation */, true #elif defined(LILYGO_T4_S3) #define GFX_DEV_DEVICE LILYGO_T4_S3 -#define GFX_EXTRA_PRE_INIT() \ +#define DEV_DEVICE_INIT() \ { \ pinMode(9 /* POWER */, OUTPUT); \ digitalWrite(9 /* POWER */, HIGH); \ diff --git a/examples/PDQgraphicstest/PDQgraphicstest.ino b/examples/PDQgraphicstest/PDQgraphicstest.ino index d38eb45c..c7e8c7af 100644 --- a/examples/PDQgraphicstest/PDQgraphicstest.ino +++ b/examples/PDQgraphicstest/PDQgraphicstest.ino @@ -39,15 +39,15 @@ uint8_t tsa, tsb, tsc, ds; void setup() { +#ifdef DEV_DEVICE_INIT + DEV_DEVICE_INIT(); +#endif + Serial.begin(115200); // Serial.setDebugOutput(true); // while(!Serial); Serial.println("Arduino_GFX PDQgraphicstest example!"); -#ifdef GFX_EXTRA_PRE_INIT - GFX_EXTRA_PRE_INIT(); -#endif - // Init Display if (!gfx->begin()) // if (!gfx->begin(80000000)) /* specify data bus speed */ diff --git a/examples/SetTextBound/SetTextBound.ino b/examples/SetTextBound/SetTextBound.ino index a0129e30..7ef4afcf 100644 --- a/examples/SetTextBound/SetTextBound.ino +++ b/examples/SetTextBound/SetTextBound.ino @@ -40,15 +40,15 @@ Arduino_GFX *gfx = new Arduino_ILI9341(bus, DF_GFX_RST, 0 /* rotation */, false void setup(void) { +#ifdef DEV_DEVICE_INIT + DEV_DEVICE_INIT(); +#endif + Serial.begin(115200); // Serial.setDebugOutput(true); // while(!Serial); Serial.println("Arduino_GFX Set Text Bound example"); -#ifdef GFX_EXTRA_PRE_INIT - GFX_EXTRA_PRE_INIT(); -#endif - // Init Display if (!gfx->begin()) { diff --git a/examples/Sprite/SpriteGif/SpriteGif.ino b/examples/Sprite/SpriteGif/SpriteGif.ino index 6c6992c0..2d27ebb4 100644 --- a/examples/Sprite/SpriteGif/SpriteGif.ino +++ b/examples/Sprite/SpriteGif/SpriteGif.ino @@ -108,15 +108,15 @@ unsigned long nextSnap = 0; void setup() { +#ifdef DEV_DEVICE_INIT + DEV_DEVICE_INIT(); +#endif + Serial.begin(115200); // Serial.setDebugOutput(true); // while(!Serial); Serial.println("Arduino_GFX GIF Sprite example"); -#ifdef GFX_EXTRA_PRE_INIT - GFX_EXTRA_PRE_INIT(); -#endif - // Init Display if (!canvasGfx->begin()) { diff --git a/examples/TouchCalibration/TouchCalibration.ino b/examples/TouchCalibration/TouchCalibration.ino index 5de93221..94ab2eb3 100644 --- a/examples/TouchCalibration/TouchCalibration.ino +++ b/examples/TouchCalibration/TouchCalibration.ino @@ -68,15 +68,15 @@ int16_t touched_y[4] = {-1}; void setup(void) { +#ifdef DEV_DEVICE_INIT + DEV_DEVICE_INIT(); +#endif + Serial.begin(115200); // Serial.setDebugOutput(true); // while(!Serial); Serial.println("Arduino_GFX Touch Calibration example"); -#ifdef GFX_EXTRA_PRE_INIT - GFX_EXTRA_PRE_INIT(); -#endif - Serial.println("Init display"); // Init Display if (!gfx->begin()) diff --git a/examples/U8g2Font/U8g2FontHelloWorld/U8g2FontHelloWorld.ino b/examples/U8g2Font/U8g2FontHelloWorld/U8g2FontHelloWorld.ino index ffd6565b..d9238cbd 100644 --- a/examples/U8g2Font/U8g2FontHelloWorld/U8g2FontHelloWorld.ino +++ b/examples/U8g2Font/U8g2FontHelloWorld/U8g2FontHelloWorld.ino @@ -43,15 +43,15 @@ Arduino_GFX *gfx = new Arduino_ILI9341(bus, DF_GFX_RST, 0 /* rotation */, false void setup(void) { +#ifdef DEV_DEVICE_INIT + DEV_DEVICE_INIT(); +#endif + Serial.begin(115200); // Serial.setDebugOutput(true); // while(!Serial); Serial.println("Arduino_GFX U8g2 Font Hello World example"); -#ifdef GFX_EXTRA_PRE_INIT - GFX_EXTRA_PRE_INIT(); -#endif - // Init Display if (!gfx->begin()) { diff --git a/examples/U8g2Font/U8g2FontPrintUTF8/U8g2FontPrintUTF8.ino b/examples/U8g2Font/U8g2FontPrintUTF8/U8g2FontPrintUTF8.ino index 80f3df1e..3f9cacd6 100644 --- a/examples/U8g2Font/U8g2FontPrintUTF8/U8g2FontPrintUTF8.ino +++ b/examples/U8g2Font/U8g2FontPrintUTF8/U8g2FontPrintUTF8.ino @@ -43,15 +43,15 @@ Arduino_GFX *gfx = new Arduino_ILI9341(bus, DF_GFX_RST, 0 /* rotation */, false void setup(void) { +#ifdef DEV_DEVICE_INIT + DEV_DEVICE_INIT(); +#endif + Serial.begin(115200); // Serial.setDebugOutput(true); // while(!Serial); Serial.println("Arduino_GFX U8g2 Font Print UTF8 example"); -#ifdef GFX_EXTRA_PRE_INIT - GFX_EXTRA_PRE_INIT(); -#endif - // Init Display if (!gfx->begin()) { diff --git a/examples/U8g2Font/U8g2FontUTF8Chinese/U8g2FontUTF8Chinese.ino b/examples/U8g2Font/U8g2FontUTF8Chinese/U8g2FontUTF8Chinese.ino index 248b7eaf..68863663 100644 --- a/examples/U8g2Font/U8g2FontUTF8Chinese/U8g2FontUTF8Chinese.ino +++ b/examples/U8g2Font/U8g2FontUTF8Chinese/U8g2FontUTF8Chinese.ino @@ -50,15 +50,15 @@ Arduino_GFX *gfx = new Arduino_ILI9341(bus, DF_GFX_RST, 0 /* rotation */, false void setup(void) { +#ifdef DEV_DEVICE_INIT + DEV_DEVICE_INIT(); +#endif + Serial.begin(115200); // Serial.setDebugOutput(true); // while(!Serial); Serial.println("Arduino_GFX U8g2 Font UTF8 Chinese example"); -#ifdef GFX_EXTRA_PRE_INIT - GFX_EXTRA_PRE_INIT(); -#endif - // Init Display if (!gfx->begin()) { diff --git a/examples/U8g2Font/U8g2FontUTF8FullCJK/U8g2FontUTF8FullCJK.ino b/examples/U8g2Font/U8g2FontUTF8FullCJK/U8g2FontUTF8FullCJK.ino index c088866e..681b2cad 100644 --- a/examples/U8g2Font/U8g2FontUTF8FullCJK/U8g2FontUTF8FullCJK.ino +++ b/examples/U8g2Font/U8g2FontUTF8FullCJK/U8g2FontUTF8FullCJK.ino @@ -50,15 +50,15 @@ Arduino_GFX *gfx = new Arduino_ILI9341(bus, DF_GFX_RST, 0 /* rotation */, false void setup(void) { +#ifdef DEV_DEVICE_INIT + DEV_DEVICE_INIT(); +#endif + Serial.begin(115200); // Serial.setDebugOutput(true); // while(!Serial); Serial.println("Arduino_GFX U8g2 Font UTF8 FullCJK example"); -#ifdef GFX_EXTRA_PRE_INIT - GFX_EXTRA_PRE_INIT(); -#endif - // Init Display if (!gfx->begin()) { diff --git a/examples/U8g2Font/U8g2FontUTF8FullUnifont/U8g2FontUTF8FullUnifont.ino b/examples/U8g2Font/U8g2FontUTF8FullUnifont/U8g2FontUTF8FullUnifont.ino index 3f495550..ea9ee644 100644 --- a/examples/U8g2Font/U8g2FontUTF8FullUnifont/U8g2FontUTF8FullUnifont.ino +++ b/examples/U8g2Font/U8g2FontUTF8FullUnifont/U8g2FontUTF8FullUnifont.ino @@ -129,15 +129,15 @@ String helloWorldStrings[] = { void setup(void) { +#ifdef DEV_DEVICE_INIT + DEV_DEVICE_INIT(); +#endif + Serial.begin(115200); // Serial.setDebugOutput(true); // while(!Serial); Serial.println("Arduino_GFX U8g2 Font UTF8 Full Unifont example"); -#ifdef GFX_EXTRA_PRE_INIT - GFX_EXTRA_PRE_INIT(); -#endif - // Init Display if (!gfx->begin()) { diff --git a/examples/U8g2Font/U8g2RssReader/U8g2RssReader.ino b/examples/U8g2Font/U8g2RssReader/U8g2RssReader.ino index b406e2ff..6a3e6690 100644 --- a/examples/U8g2Font/U8g2RssReader/U8g2RssReader.ino +++ b/examples/U8g2Font/U8g2RssReader/U8g2RssReader.ino @@ -85,15 +85,15 @@ HttpClient http(client); void setup(void) { +#ifdef DEV_DEVICE_INIT + DEV_DEVICE_INIT(); +#endif + Serial.begin(115200); // while (!Serial); // Serial.setDebugOutput(true); Serial.println("Arduino_GFX U8g2 Font RSS Reader example"); -#ifdef GFX_EXTRA_PRE_INIT - GFX_EXTRA_PRE_INIT(); -#endif - Serial.println("Init display"); if (!gfx->begin()) { diff --git a/examples/WiFiAnalyzer/ESPWiFiAnalyzer/ESPWiFiAnalyzer.ino b/examples/WiFiAnalyzer/ESPWiFiAnalyzer/ESPWiFiAnalyzer.ino index e4eb87b8..991020f4 100644 --- a/examples/WiFiAnalyzer/ESPWiFiAnalyzer/ESPWiFiAnalyzer.ino +++ b/examples/WiFiAnalyzer/ESPWiFiAnalyzer/ESPWiFiAnalyzer.ino @@ -70,6 +70,10 @@ uint8_t scan_count = 0; void setup() { +#ifdef DEV_DEVICE_INIT + DEV_DEVICE_INIT(); +#endif + Serial.begin(115200); // Serial.setDebugOutput(true); // while(!Serial); @@ -80,10 +84,6 @@ void setup() WiFi.disconnect(); delay(100); -#ifdef GFX_EXTRA_PRE_INIT - GFX_EXTRA_PRE_INIT(); -#endif - #if defined(LCD_PWR_PIN) pinMode(LCD_PWR_PIN, OUTPUT); // sets the pin as output digitalWrite(LCD_PWR_PIN, HIGH); // power on diff --git a/examples/WiFiAnalyzer/ESPWiFiAnalyzerUTF8/ESPWiFiAnalyzerUTF8.ino b/examples/WiFiAnalyzer/ESPWiFiAnalyzerUTF8/ESPWiFiAnalyzerUTF8.ino index 471df435..c9486068 100644 --- a/examples/WiFiAnalyzer/ESPWiFiAnalyzerUTF8/ESPWiFiAnalyzerUTF8.ino +++ b/examples/WiFiAnalyzer/ESPWiFiAnalyzerUTF8/ESPWiFiAnalyzerUTF8.ino @@ -71,6 +71,10 @@ uint8_t scan_count = 0; void setup() { +#ifdef DEV_DEVICE_INIT + DEV_DEVICE_INIT(); +#endif + Serial.begin(115200); // Serial.setDebugOutput(true); // while(!Serial); @@ -81,10 +85,6 @@ void setup() WiFi.disconnect(); delay(100); -#ifdef GFX_EXTRA_PRE_INIT - GFX_EXTRA_PRE_INIT(); -#endif - #if defined(LCD_PWR_PIN) pinMode(LCD_PWR_PIN, OUTPUT); // sets the pin as output digitalWrite(LCD_PWR_PIN, HIGH); // power on diff --git a/examples/WiFiAnalyzer/PicoWiFiAnalyzer/PicoWiFiAnalyzer.ino b/examples/WiFiAnalyzer/PicoWiFiAnalyzer/PicoWiFiAnalyzer.ino index 799937c8..14f68a65 100644 --- a/examples/WiFiAnalyzer/PicoWiFiAnalyzer/PicoWiFiAnalyzer.ino +++ b/examples/WiFiAnalyzer/PicoWiFiAnalyzer/PicoWiFiAnalyzer.ino @@ -64,6 +64,10 @@ uint8_t scan_count = 0; void setup() { +#ifdef DEV_DEVICE_INIT + DEV_DEVICE_INIT(); +#endif + Serial.begin(115200); // Serial.setDebugOutput(true); // while(!Serial); @@ -74,10 +78,6 @@ void setup() WiFi.disconnect(); delay(100); -#ifdef GFX_EXTRA_PRE_INIT - GFX_EXTRA_PRE_INIT(); -#endif - #ifdef GFX_BL pinMode(GFX_BL, OUTPUT); digitalWrite(GFX_BL, HIGH); diff --git a/examples/WiFiAnalyzer/PicoWiFiAnalyzerUTF8/PicoWiFiAnalyzerUTF8.ino b/examples/WiFiAnalyzer/PicoWiFiAnalyzerUTF8/PicoWiFiAnalyzerUTF8.ino index 05060d76..7cd8fd98 100644 --- a/examples/WiFiAnalyzer/PicoWiFiAnalyzerUTF8/PicoWiFiAnalyzerUTF8.ino +++ b/examples/WiFiAnalyzer/PicoWiFiAnalyzerUTF8/PicoWiFiAnalyzerUTF8.ino @@ -65,6 +65,10 @@ uint8_t scan_count = 0; void setup() { +#ifdef DEV_DEVICE_INIT + DEV_DEVICE_INIT(); +#endif + Serial.begin(115200); // Serial.setDebugOutput(true); // while(!Serial); @@ -75,10 +79,6 @@ void setup() WiFi.disconnect(); delay(100); -#ifdef GFX_EXTRA_PRE_INIT - GFX_EXTRA_PRE_INIT(); -#endif - #ifdef GFX_BL pinMode(GFX_BL, OUTPUT); digitalWrite(GFX_BL, HIGH); diff --git a/examples/WiFiAnalyzer/RTLWiFiAnalyzer/RTLWiFiAnalyzer.ino b/examples/WiFiAnalyzer/RTLWiFiAnalyzer/RTLWiFiAnalyzer.ino index eb92b1b8..6da73b31 100644 --- a/examples/WiFiAnalyzer/RTLWiFiAnalyzer/RTLWiFiAnalyzer.ino +++ b/examples/WiFiAnalyzer/RTLWiFiAnalyzer/RTLWiFiAnalyzer.ino @@ -144,6 +144,10 @@ static int8_t scanNetworks() void setup() { +#ifdef DEV_DEVICE_INIT + DEV_DEVICE_INIT(); +#endif + Serial.begin(115200); // Serial.setDebugOutput(true); // while(!Serial); @@ -152,10 +156,6 @@ void setup() LwIP_Init(); wifi_on(RTW_MODE_STA); -#ifdef GFX_EXTRA_PRE_INIT - GFX_EXTRA_PRE_INIT(); -#endif - #if defined(LCD_PWR_PIN) pinMode(LCD_PWR_PIN, OUTPUT); // sets the pin as output digitalWrite(LCD_PWR_PIN, HIGH); // power on diff --git a/examples/WiFiAnalyzer/RTLWiFiAnalyzerUTF8/RTLWiFiAnalyzerUTF8.ino b/examples/WiFiAnalyzer/RTLWiFiAnalyzerUTF8/RTLWiFiAnalyzerUTF8.ino index 06a00adc..c9bbe2a9 100644 --- a/examples/WiFiAnalyzer/RTLWiFiAnalyzerUTF8/RTLWiFiAnalyzerUTF8.ino +++ b/examples/WiFiAnalyzer/RTLWiFiAnalyzerUTF8/RTLWiFiAnalyzerUTF8.ino @@ -147,6 +147,10 @@ int8_t scanNetworks() void setup() { +#ifdef DEV_DEVICE_INIT + DEV_DEVICE_INIT(); +#endif + Serial.begin(115200); // Serial.setDebugOutput(true); // while(!Serial); @@ -155,10 +159,6 @@ void setup() LwIP_Init(); wifi_on(RTW_MODE_STA); -#ifdef GFX_EXTRA_PRE_INIT - GFX_EXTRA_PRE_INIT(); -#endif - #if defined(LCD_PWR_PIN) pinMode(LCD_PWR_PIN, OUTPUT); // sets the pin as output digitalWrite(LCD_PWR_PIN, HIGH); // power on diff --git a/examples/WiFiAnalyzer/WioWiFiAnalyzer/WioWiFiAnalyzer.ino b/examples/WiFiAnalyzer/WioWiFiAnalyzer/WioWiFiAnalyzer.ino index 0097b4c8..4f9ea28b 100644 --- a/examples/WiFiAnalyzer/WioWiFiAnalyzer/WioWiFiAnalyzer.ino +++ b/examples/WiFiAnalyzer/WioWiFiAnalyzer/WioWiFiAnalyzer.ino @@ -86,6 +86,10 @@ uint16_t channelIdx(int channel) void setup() { +#ifdef DEV_DEVICE_INIT + DEV_DEVICE_INIT(); +#endif + Serial.begin(115200); // Serial.setDebugOutput(true); // while(!Serial); @@ -96,10 +100,6 @@ void setup() WiFi.disconnect(); delay(100); -#ifdef GFX_EXTRA_PRE_INIT - GFX_EXTRA_PRE_INIT(); -#endif - #if defined(LCD_PWR_PIN) pinMode(LCD_PWR_PIN, OUTPUT); // sets the pin as output digitalWrite(LCD_PWR_PIN, HIGH); // power on diff --git a/examples/WiFiPhotoFrame/WiFiPhotoFrame.ino b/examples/WiFiPhotoFrame/WiFiPhotoFrame.ino index 6fc149af..bce7bdac 100644 --- a/examples/WiFiPhotoFrame/WiFiPhotoFrame.ino +++ b/examples/WiFiPhotoFrame/WiFiPhotoFrame.ino @@ -106,15 +106,15 @@ char http_path[1024]; void setup() { +#ifdef DEV_DEVICE_INIT + DEV_DEVICE_INIT(); +#endif + Serial.begin(115200); // Serial.setDebugOutput(true); // while(!Serial); Serial.println("Arduino_GFX WiFi Photo Frame example"); -#ifdef GFX_EXTRA_PRE_INIT - GFX_EXTRA_PRE_INIT(); -#endif - Serial.println("Init display"); if (!gfx->begin()) {