Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions partitions_6MB.csv
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,
22 changes: 20 additions & 2 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@
; https://docs.platformio.org/page/projectconf.html

[platformio]
default_envs = S3-N16R8_128x32
default_envs = MatrixPortalS3_128x32
Copy link
Member

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


[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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is that really required?
We build on github and it doesn't cache, so stable will always pull the latest stable.

board = esp32dev
board_build.partitions = partitions.csv
board_build.filesystem = littlefs
Expand Down Expand Up @@ -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
3 changes: 1 addition & 2 deletions src/displays/Esp32LedMatrix.cpp
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>
Copy link
Member

Choose a reason for hiding this comment

The 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};
Expand All @@ -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);
Expand All @@ -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();
}
Expand Down
17 changes: 16 additions & 1 deletion src/displays/Esp32LedMatrix.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef ESP32LEDMATRIX_H
#define ESP32LEDMATRIX_H

#ifdef ARDUINO_ESP32_S3_N16R8
#if defined(ARDUINO_ESP32_S3_N16R8)
#define R1_PIN 4
#define G1_PIN 5
#define B1_PIN 6
Expand All @@ -16,6 +16,21 @@
#define LAT_PIN 40
#define OE_PIN 2
#define CLK_PIN 41
#elif defined(ARDUINO_ADAFRUIT_MATRIXPORTAL_ESP32S3)
#define R1_PIN 42
#define G1_PIN 41
#define B1_PIN 40
#define R2_PIN 38
#define G2_PIN 39
#define B2_PIN 37
#define A_PIN 45
#define B_PIN 36
#define C_PIN 48
#define D_PIN 35
#define E_PIN 21
#define LAT_PIN 47
#define OE_PIN 14
#define CLK_PIN 2
#else
// Pinout derived from ESP32-HUB75-MatrixPanel-I2S-DMA.h
#define R1_PIN 25
Expand Down
26 changes: 13 additions & 13 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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
Expand All @@ -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.
Expand Down Expand Up @@ -1861,7 +1864,7 @@ void setup() {
#endif

bool fileSystemOK;
if ((fileSystemOK = LittleFS.begin())) {
if ((fileSystemOK = LittleFS.begin(true))) {
LoadSettingsMenu();
LoadTransport();

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -2229,6 +2230,7 @@ void setup() {
#endif

pinMode(FORWARD_BUTTON_PIN, INPUT_PULLUP);

Copy link
Member

Choose a reason for hiding this comment

The 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);
Expand All @@ -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);

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove

#else
buffers[i] = (uint8_t *)malloc(BUFFER_SIZE);
#endif
Expand All @@ -2255,7 +2257,6 @@ void setup() {
while (1);
}
}

#ifdef SPEAKER_LIGHTS
if (speakerLightsLeftNumLeds > 0) {
speakerLightsLeft =
Expand Down Expand Up @@ -2284,7 +2285,6 @@ void setup() {
static_cast<SpiTransport *>(transport)->SetColor((Color)loopbackColor);
#endif
transport->init();

#ifdef DMDREADER
core_0_initialized = true;
#endif
Expand Down
6 changes: 5 additions & 1 deletion src/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@
#endif

#if defined(ARDUINO_ESP32_S3_N16R8) || defined(DISPLAY_RM67162_AMOLED) || \
defined(PICO_BUILD)
defined(PICO_BUILD) || defined(DISPLAY_RM67162_AMOLED) || \
defined(ARDUINO_ADAFRUIT_MATRIXPORTAL_ESP32S3)
// USB CDC
#define SERIAL_BAUD 115200
#define USB_PACKAGE_SIZE 512
Expand All @@ -71,6 +72,9 @@
#elif defined(DISPLAY_RM67162_AMOLED)
#define UP_BUTTON_PIN 0
#define FORWARD_BUTTON_PIN 21
#elif defined(ARDUINO_ADAFRUIT_MATRIXPORTAL_ESP32S3)
#define UP_BUTTON_PIN 6
#define FORWARD_BUTTON_PIN 7
#else
#define UP_BUTTON_PIN 21
#define FORWARD_BUTTON_PIN 33
Expand Down
2 changes: 1 addition & 1 deletion src/transports/wifi_transport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -253,6 +252,7 @@ void WifiTransport::startServer() {

// Serve index.html
server->on("/", HTTP_GET, [](AsyncWebServerRequest* request) {

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove

request->send(LittleFS, "/index.html", String(), false);
});

Expand Down
Loading