Skip to content

Commit 3a7de82

Browse files
authored
Merge pull request wled#3777 from netmindz/HUB75-AC
Add HUB75 support
2 parents 33d79e0 + a79ae25 commit 3a7de82

File tree

14 files changed

+615
-16
lines changed

14 files changed

+615
-16
lines changed

boards/lilygo-t7-s3.json

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
{
2+
"build": {
3+
"arduino":{
4+
"ldscript": "esp32s3_out.ld",
5+
"memory_type": "qio_opi",
6+
"partitions": "default_16MB.csv"
7+
},
8+
"core": "esp32",
9+
"extra_flags": [
10+
"-DARDUINO_TTGO_T7_S3",
11+
"-DBOARD_HAS_PSRAM",
12+
"-DARDUINO_USB_MODE=1"
13+
],
14+
"f_cpu": "240000000L",
15+
"f_flash": "80000000L",
16+
"flash_mode": "qio",
17+
"hwids": [
18+
[
19+
"0X303A",
20+
"0x1001"
21+
]
22+
],
23+
"mcu": "esp32s3",
24+
"variant": "esp32s3"
25+
},
26+
"connectivity": [
27+
"wifi",
28+
"bluetooth"
29+
],
30+
"debug": {
31+
"openocd_target": "esp32s3.cfg"
32+
},
33+
"frameworks": [
34+
"arduino",
35+
"espidf"
36+
],
37+
"name": "LILYGO T3-S3",
38+
"upload": {
39+
"flash_size": "16MB",
40+
"maximum_ram_size": 327680,
41+
"maximum_size": 16777216,
42+
"require_upload_port": true,
43+
"speed": 921600
44+
},
45+
"url": "https://www.aliexpress.us/item/3256804591247074.html",
46+
"vendor": "LILYGO"
47+
}

platformio_override.sample.ini

Lines changed: 85 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ build_flags = ${common.build_flags} ${esp8266.build_flags}
180180
;
181181
; enable IR by setting remote type
182182
; -D IRTYPE=0 # 0 Remote disabled | 1 24-key RGB | 2 24-key with CT | 3 40-key blue | 4 40-key RGB | 5 21-key RGB | 6 6-key black | 7 9-key red | 8 JSON remote
183-
;
183+
;
184184
; use PSRAM on classic ESP32 rev.1 (rev.3 or above has no issues)
185185
; -DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue # needed only for classic ESP32 rev.1
186186
;
@@ -525,6 +525,7 @@ build_flags = ${common.build_flags} ${esp32.build_flags} -D WLED_DISABLE_BROWNOU
525525
-D USER_SETUP_LOADED
526526
monitor_filters = esp32_exception_decoder
527527

528+
528529
# ------------------------------------------------------------------------------
529530
# Usermod examples
530531
# ------------------------------------------------------------------------------
@@ -535,3 +536,86 @@ extends = env:esp32dev
535536
build_flags = ${env:esp32dev.build_flags} -D USERMOD_RF433
536537
lib_deps = ${env:esp32dev.lib_deps}
537538
sui77/rc-switch @ 2.6.4
539+
540+
# ------------------------------------------------------------------------------
541+
# Hub75 examples
542+
# ------------------------------------------------------------------------------
543+
544+
[env:esp32dev_hub75]
545+
board = esp32dev
546+
upload_speed = 921600
547+
platform = ${esp32_idf_V4.platform}
548+
platform_packages =
549+
build_unflags = ${common.build_unflags}
550+
build_flags = ${common.build_flags}
551+
-D WLED_RELEASE_NAME=\"ESP32_hub75\"
552+
-D WLED_ENABLE_HUB75MATRIX -D NO_GFX -D NO_CIE1931
553+
; -D ESP32_FORUM_PINOUT ;; enable for SmartMatrix default pins
554+
; -D WLED_DEBUG
555+
lib_deps = ${esp32_idf_V4.lib_deps}
556+
https://github.com/mrfaptastic/ESP32-HUB75-MatrixPanel-DMA.git#3.0.11
557+
558+
monitor_filters = esp32_exception_decoder
559+
board_build.partitions = ${esp32.default_partitions}
560+
board_build.flash_mode = dio
561+
562+
[env:esp32dev_hub75_forum_pinout]
563+
extends = env:esp32dev_hub75
564+
build_flags = ${common.build_flags}
565+
-D WLED_RELEASE_NAME=\"ESP32_hub75_forum_pinout\"
566+
-D WLED_ENABLE_HUB75MATRIX -D NO_GFX -D NO_CIE1931
567+
-D ESP32_FORUM_PINOUT ;; enable for SmartMatrix default pins
568+
; -D WLED_DEBUG
569+
570+
571+
[env:adafruit_matrixportal_esp32s3]
572+
; ESP32-S3 processor, 8 MB flash, 2 MB of PSRAM, dedicated driver pins for HUB75
573+
board = adafruit_matrixportal_esp32s3
574+
platform = ${esp32s3.platform}
575+
platform_packages =
576+
upload_speed = 921600
577+
build_unflags = ${common.build_unflags}
578+
build_flags = ${common.build_flags} ${esp32s3.build_flags} -D WLED_RELEASE_NAME=\"ESP32-S3_4M_qspi\"
579+
-DARDUINO_USB_CDC_ON_BOOT=1 -DARDUINO_USB_MODE=1 ;; for boards with USB-OTG connector only (USBCDC or "TinyUSB")
580+
-DBOARD_HAS_PSRAM
581+
-DLOLIN_WIFI_FIX ; seems to work much better with this
582+
-D WLED_WATCHDOG_TIMEOUT=0
583+
${esp32.AR_build_flags}
584+
-D WLED_ENABLE_HUB75MATRIX -D NO_GFX -D NO_CIE1931
585+
-D S3_LCD_DIV_NUM=20 ;; Attempt to fix wifi performance issue when panel active with S3 chips
586+
-D ARDUINO_ADAFRUIT_MATRIXPORTAL_ESP32S3
587+
588+
lib_deps = ${esp32s3.lib_deps}
589+
${esp32.AR_lib_deps}
590+
https://github.com/mrfaptastic/ESP32-HUB75-MatrixPanel-DMA.git#aa28e2a ;; S3_LCD_DIV_NUM fix
591+
592+
board_build.partitions = ${esp32.default_partitions}
593+
board_build.f_flash = 80000000L
594+
board_build.flash_mode = qio
595+
monitor_filters = esp32_exception_decoder
596+
597+
[env:esp32S3_PSRAM_HUB75]
598+
;; MOONHUB HUB75 adapter board
599+
board = lilygo-t7-s3
600+
platform = ${esp32s3.platform}
601+
platform_packages =
602+
upload_speed = 921600
603+
build_unflags = ${common.build_unflags}
604+
build_flags = ${common.build_flags} ${esp32s3.build_flags} -D WLED_RELEASE_NAME=\"esp32S3_16MB_PSRAM_HUB75\"
605+
-DARDUINO_USB_CDC_ON_BOOT=1 -DARDUINO_USB_MODE=1 ;; for boards with USB-OTG connector only (USBCDC or "TinyUSB")
606+
-DBOARD_HAS_PSRAM
607+
-DLOLIN_WIFI_FIX ; seems to work much better with this
608+
-D WLED_WATCHDOG_TIMEOUT=0
609+
${esp32.AR_build_flags}
610+
-D WLED_ENABLE_HUB75MATRIX -D NO_GFX -D NO_CIE1931
611+
-D S3_LCD_DIV_NUM=20 ;; Attempt to fix wifi performance issue when panel active with S3 chips
612+
-D MOONHUB_S3_PINOUT ;; HUB75 pinout
613+
614+
lib_deps = ${esp32s3.lib_deps}
615+
${esp32.AR_lib_deps}
616+
https://github.com/mrfaptastic/ESP32-HUB75-MatrixPanel-DMA.git#aa28e2a ;; S3_LCD_DIV_NUM fix
617+
618+
board_build.partitions = ${esp32.default_partitions}
619+
board_build.f_flash = 80000000L
620+
board_build.flash_mode = qio
621+
monitor_filters = esp32_exception_decoder

usermods/rgb-rotary-encoder/rgb-rotary-encoder.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,11 @@ class RgbRotaryEncoderUsermod : public Usermod
5454

5555
void initLedBus()
5656
{
57-
byte _pins[5] = {(byte)ledIo, 255, 255, 255, 255};
57+
// Initialize all pins to the sentinel value first…
58+
byte _pins[OUTPUT_MAX_PINS];
59+
std::fill(std::begin(_pins), std::end(_pins), 255);
60+
// …then set only the LED pin
61+
_pins[0] = static_cast<byte>(ledIo);
5862
BusConfig busCfg = BusConfig(TYPE_WS2812_RGB, _pins, 0, numLeds, COL_ORDER_GRB, false, 0);
5963

6064
ledBus = new BusDigital(busCfg, WLED_MAX_BUSSES - 1);

0 commit comments

Comments
 (0)