-
Notifications
You must be signed in to change notification settings - Fork 17
Arduino Matrix Portal ESP32-s3 support added #127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| # Name, Type, SubType, Offset, Size, Flags | ||
| nvs, data, nvs, 0x9000, 0x5000, | ||
| otadata, data, ota, 0xe000, 0x2000, | ||
| zedmd, app, ota_0, 0x10000, 0x200000, | ||
| spiffs, data, spiffs, 0x210000, 0x4D0000, | ||
| coredump, data, coredump, 0x6E0000, 0x20000, |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,11 +9,12 @@ | |
| ; https://docs.platformio.org/page/projectconf.html | ||
|
|
||
| [platformio] | ||
| default_envs = S3-N16R8_128x32 | ||
| default_envs = MatrixPortalS3_128x32 | ||
|
|
||
| [esp32] | ||
| framework = arduino | ||
| platform = https://github.com/pioarduino/platform-espressif32/releases/download/stable/platform-espressif32.zip | ||
| ;platform = https://github.com/pioarduino/platform-espressif32/releases/download/stable/platform-espressif32.zip | ||
| platform = https://github.com/pioarduino/platform-espressif32/releases/download/55.03.37/platform-espressif32.zip | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is that really required? |
||
| board = esp32dev | ||
| board_build.partitions = partitions.csv | ||
| board_build.filesystem = littlefs | ||
|
|
@@ -319,3 +320,20 @@ lib_deps = ${ppucdmd.lib_deps} | |
| build_flags = ${ppucdmd.build_flags} | ||
| -DZEDMD_HD=1 | ||
| -DSPEAKER_LIGHTS=1 | ||
|
|
||
| [env:MatrixPortalS3_128x32] | ||
| extends = esp32 | ||
| board = adafruit_matrixportal_esp32s3 | ||
| board_build.partitions = partitions_6MB.csv | ||
| board_build.filesystem = littlefs | ||
| lib_deps = ${esp32.lib_deps} | ||
| https://github.com/mrfaptastic/ESP32-HUB75-MatrixPanel-DMA#3.0.13 | ||
| https://github.com/adafruit/Adafruit_NeoPixel#1.12.4 | ||
| https://github.com/kitesurfer1404/WS2812FX#v1.4.5 | ||
| build_flags = ${esp32.build_flags} | ||
| -DBOARD_HAS_PSRAM=1 | ||
| -DARDUINO_USB_MODE=1 | ||
| -DARDUINO_USB_CDC_ON_BOOT=1 | ||
| -DDISPLAY_LED_MATRIX=1 | ||
| -DARDUINO_ADAFRUIT_MATRIXPORTAL_ESP32S3=1 | ||
| -DPIXEL_COLOR_DEPTH_BITS=8 | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,7 @@ | ||
| #if defined(DISPLAY_LED_MATRIX) && defined(ESP_BUILD) | ||
|
|
||
| #include "Esp32LedMatrix.h" | ||
| #include <HardwareSerial.h> | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think that this include could be removed. |
||
|
|
||
| Esp32LedMatrix::Esp32LedMatrix() { | ||
| int8_t colorPins1[3] = {R1_PIN, G1_PIN, B1_PIN}; | ||
|
|
@@ -19,7 +20,6 @@ Esp32LedMatrix::Esp32LedMatrix() { | |
| LAT_PIN, | ||
| OE_PIN, | ||
| CLK_PIN}; | ||
|
|
||
| HUB75_I2S_CFG mxconfig(PANEL_WIDTH, PANEL_HEIGHT, PANELS_NUMBER, pins); | ||
| // Without setting clkphase to false, HD panels seem to flicker. | ||
| mxconfig.clkphase = (panelClkphase == 1); | ||
|
|
@@ -31,7 +31,6 @@ Esp32LedMatrix::Esp32LedMatrix() { | |
| mxconfig.latch_blanking = panelLatchBlanking; | ||
| mxconfig.min_refresh_rate = panelMinRefreshRate; | ||
| mxconfig.driver = (HUB75_I2S_CFG::shift_driver)panelDriver; | ||
|
|
||
| dma_display = new MatrixPanel_I2S_DMA(mxconfig); | ||
| dma_display->begin(); | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -37,7 +37,9 @@ | |
| #endif | ||
|
|
||
| // Specific improvements and #define for the ESP32 S3 series | ||
| #if defined(ARDUINO_ESP32_S3_N16R8) || defined(DISPLAY_RM67162_AMOLED) | ||
| #if defined(ARDUINO_ESP32_S3_N16R8) || \ | ||
| defined(ARDUINO_ADAFRUIT_MATRIXPORTAL_ESP32S3) || \ | ||
| defined(DISPLAY_RM67162_AMOLED) | ||
| #include "S3Specific.h" | ||
| #endif | ||
| #ifndef PICO_BUILD | ||
|
|
@@ -69,7 +71,8 @@ | |
| #define BC 2 | ||
|
|
||
| #ifdef SPEAKER_LIGHTS | ||
| #ifdef ARDUINO_ESP32_S3_N16R8 | ||
| #if defined(ARDUINO_ESP32_S3_N16R8) || \ | ||
| defined(ARDUINO_ADAFRUIT_MATRIXPORTAL_ESP32S3) | ||
| #define SPEAKER_LIGHTS_LEFT_PIN 9 // Left speaker LED strip | ||
| #define SPEAKER_LIGHTS_RIGHT_PIN 10 // Right speaker LED strip | ||
| #elif defined(DMDREADER) | ||
|
|
@@ -261,8 +264,8 @@ void DoRestart(int sec) { | |
| if (rebootToBootloader) rp2040.rebootToBootloader(); | ||
| #endif | ||
|
|
||
| // Note: ESP.restart() or esp_restart() will keep the state of global and | ||
| // static variables. And not all sub-systems get resetted. | ||
| // Note: ESP.restart() or esp_restart() will keep the state of global and | ||
| // static variables. And not all sub-systems get resetted. | ||
| #if (defined(ARDUINO_USB_MODE) && ARDUINO_USB_MODE == 1) | ||
| #ifdef PICO_BUILD | ||
| rp2040.reboot(); | ||
|
|
@@ -1179,12 +1182,13 @@ uint8_t HandleData(uint8_t *pData, size_t len) { | |
| response[N_INTERMEDIATE_CTR_CHARS + 18] = 0; | ||
| #endif | ||
| #if defined(ARDUINO_ESP32_S3_N16R8) || defined(DISPLAY_RM67162_AMOLED) || \ | ||
| defined(PICO_BUILD) | ||
| defined(PICO_BUILD) || defined(ARDUINO_ADAFRUIT_MATRIXPORTAL_ESP32S3) | ||
| response[N_INTERMEDIATE_CTR_CHARS + 18] += 0b00000010; | ||
| #endif | ||
| response[N_INTERMEDIATE_CTR_CHARS + 19] = shortId & 0xff; | ||
| response[N_INTERMEDIATE_CTR_CHARS + 20] = (shortId >> 8) & 0xff; | ||
| #if defined(ARDUINO_ESP32_S3_N16R8) | ||
| #if defined(ARDUINO_ESP32_S3_N16R8) || \ | ||
| defined(ARDUINO_ADAFRUIT_MATRIXPORTAL_ESP32S3) | ||
| response[N_INTERMEDIATE_CTR_CHARS + 21] = 1; // ESP32 S3 | ||
| #elif defined(DISPLAY_RM67162_AMOLED) | ||
| response[N_INTERMEDIATE_CTR_CHARS + 21] = 2; // ESP32 S3 with | ||
|
|
@@ -1198,7 +1202,6 @@ uint8_t HandleData(uint8_t *pData, size_t len) { | |
| #else | ||
| response[N_INTERMEDIATE_CTR_CHARS + 21] = 0; // ESP32 | ||
| #endif | ||
|
|
||
| response[63 - N_ACK_CHARS] = 'R'; | ||
| Serial.write(response, 64 - N_ACK_CHARS); | ||
| // This flush is required for USB CDC on Windows. | ||
|
|
@@ -1861,7 +1864,7 @@ void setup() { | |
| #endif | ||
|
|
||
| bool fileSystemOK; | ||
| if ((fileSystemOK = LittleFS.begin())) { | ||
| if ((fileSystemOK = LittleFS.begin(true))) { | ||
| LoadSettingsMenu(); | ||
| LoadTransport(); | ||
|
|
||
|
|
@@ -1898,7 +1901,6 @@ void setup() { | |
| #endif | ||
| #endif | ||
| display->SetBrightness(brightness); | ||
|
|
||
| if (!fileSystemOK) { | ||
| display->DisplayText("Error reading file system!", 0, 0, 255, 0, 0); | ||
| display->DisplayText("Try to flash the firmware again.", 0, 6, 255, 0, 0); | ||
|
|
@@ -1963,7 +1965,6 @@ void setup() { | |
| } | ||
| memset(renderBuffer[i], 0, TOTAL_BYTES); | ||
| } | ||
|
|
||
| #ifndef DISPLAY_RM67162_AMOLED | ||
| if (settingsMenu) { | ||
| // Turn off settings menu after restart here. | ||
|
|
@@ -2229,6 +2230,7 @@ void setup() { | |
| #endif | ||
|
|
||
| pinMode(FORWARD_BUTTON_PIN, INPUT_PULLUP); | ||
|
|
||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. remove |
||
| #ifdef PICO_BUILD | ||
| // do not leave some pin configured as adc / floating | ||
| pinMode(BACKWARD_BUTTON_PIN, INPUT_PULLUP); | ||
|
|
@@ -2240,12 +2242,12 @@ void setup() { | |
| DisplayLogo(); | ||
| DisplayId(); | ||
| display->Render(); | ||
|
|
||
| // Create synchronization primitives | ||
| for (uint8_t i = 0; i < NUM_BUFFERS; i++) { | ||
| #ifdef BOARD_HAS_PSRAM | ||
| buffers[i] = (uint8_t *)heap_caps_malloc( | ||
| BUFFER_SIZE, MALLOC_CAP_SPIRAM | MALLOC_CAP_32BIT); | ||
|
|
||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. remove |
||
| #else | ||
| buffers[i] = (uint8_t *)malloc(BUFFER_SIZE); | ||
| #endif | ||
|
|
@@ -2255,7 +2257,6 @@ void setup() { | |
| while (1); | ||
| } | ||
| } | ||
|
|
||
| #ifdef SPEAKER_LIGHTS | ||
| if (speakerLightsLeftNumLeds > 0) { | ||
| speakerLightsLeft = | ||
|
|
@@ -2284,7 +2285,6 @@ void setup() { | |
| static_cast<SpiTransport *>(transport)->SetColor((Color)loopbackColor); | ||
| #endif | ||
| transport->init(); | ||
|
|
||
| #ifdef DMDREADER | ||
| core_0_initialized = true; | ||
| #endif | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -113,7 +113,6 @@ bool WifiTransport::init() { | |
|
|
||
| GetDisplayDriver()->DisplayText("zedmd-wifi.local", 0, TOTAL_HEIGHT - 5, 0, 0, | ||
| 0, true); | ||
|
|
||
| startServer(); | ||
|
|
||
| if (m_type == WIFI_UDP) { | ||
|
|
@@ -253,6 +252,7 @@ void WifiTransport::startServer() { | |
|
|
||
| // Serve index.html | ||
| server->on("/", HTTP_GET, [](AsyncWebServerRequest* request) { | ||
|
|
||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. remove |
||
| request->send(LittleFS, "/index.html", String(), false); | ||
| }); | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't change the default