-
-
Couldn't load subscription status.
- Fork 3.8k
Hub75 fixes #4950
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
Hub75 fixes #4950
Changes from all commits
75481d3
6c718c3
c5119c8
deac504
ee5a70a
77f3426
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 |
|---|---|---|
|
|
@@ -549,8 +549,9 @@ platform_packages = | |
| build_unflags = ${common.build_unflags} | ||
| build_flags = ${common.build_flags} | ||
| -D WLED_RELEASE_NAME=\"ESP32_hub75\" | ||
| -D WLED_ENABLE_HUB75MATRIX -D NO_GFX -D NO_CIE1931 | ||
| ; -D ESP32_FORUM_PINOUT ;; enable for SmartMatrix default pins | ||
| -D WLED_ENABLE_HUB75MATRIX -D NO_GFX | ||
| -D LED_TYPES=65 -D DATA_PINS=64,64,1 | ||
| -D WLED_DEBUG_BUS | ||
| ; -D WLED_DEBUG | ||
| lib_deps = ${esp32_idf_V4.lib_deps} | ||
| https://github.com/mrfaptastic/ESP32-HUB75-MatrixPanel-DMA.git#3.0.11 | ||
|
|
@@ -563,11 +564,14 @@ board_build.flash_mode = dio | |
| extends = env:esp32dev_hub75 | ||
| build_flags = ${common.build_flags} | ||
| -D WLED_RELEASE_NAME=\"ESP32_hub75_forum_pinout\" | ||
| -D WLED_ENABLE_HUB75MATRIX -D NO_GFX -D NO_CIE1931 | ||
| -D WLED_ENABLE_HUB75MATRIX -D NO_GFX | ||
| -D ESP32_FORUM_PINOUT ;; enable for SmartMatrix default pins | ||
| -D LED_TYPES=65 -D DATA_PINS=64,64,1 | ||
| -D WLED_DEBUG_BUS | ||
| ; -D WLED_DEBUG | ||
|
|
||
|
|
||
|
|
||
| [env:adafruit_matrixportal_esp32s3] | ||
| ; ESP32-S3 processor, 8 MB flash, 2 MB of PSRAM, dedicated driver pins for HUB75 | ||
| board = adafruit_matrixportal_esp32s3 | ||
|
|
@@ -581,9 +585,12 @@ build_flags = ${common.build_flags} ${esp32s3.build_flags} -D WLED_RELEASE_NAME= | |
| -DLOLIN_WIFI_FIX ; seems to work much better with this | ||
| -D WLED_WATCHDOG_TIMEOUT=0 | ||
| ${esp32.AR_build_flags} | ||
| -D WLED_ENABLE_HUB75MATRIX -D NO_GFX -D NO_CIE1931 | ||
| -D WLED_ENABLE_HUB75MATRIX -D NO_GFX | ||
| -D S3_LCD_DIV_NUM=20 ;; Attempt to fix wifi performance issue when panel active with S3 chips | ||
| -D ARDUINO_ADAFRUIT_MATRIXPORTAL_ESP32S3 | ||
| -D LED_TYPES=65 -D DATA_PINS=64,64,1 | ||
| -D WLED_DEBUG_BUS | ||
|
|
||
|
|
||
| lib_deps = ${esp32s3.lib_deps} | ||
| ${esp32.AR_lib_deps} | ||
|
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. AR_lib_deps is deprecated. |
||
|
|
@@ -607,9 +614,11 @@ build_flags = ${common.build_flags} ${esp32s3.build_flags} -D WLED_RELEASE_NAME= | |
| -DLOLIN_WIFI_FIX ; seems to work much better with this | ||
| -D WLED_WATCHDOG_TIMEOUT=0 | ||
| ${esp32.AR_build_flags} | ||
|
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. AR_build_flags is deprecated as well |
||
| -D WLED_ENABLE_HUB75MATRIX -D NO_GFX -D NO_CIE1931 | ||
| -D WLED_ENABLE_HUB75MATRIX -D NO_GFX | ||
| -D S3_LCD_DIV_NUM=20 ;; Attempt to fix wifi performance issue when panel active with S3 chips | ||
| -D MOONHUB_S3_PINOUT ;; HUB75 pinout | ||
| -D LED_TYPES=65 -D DATA_PINS=64,64,1 | ||
| -D WLED_DEBUG_BUS | ||
|
|
||
| lib_deps = ${esp32s3.lib_deps} | ||
| ${esp32.AR_lib_deps} | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -812,14 +812,15 @@ BusHub75Matrix::BusHub75Matrix(const BusConfig &bc) : Bus(bc.type, bc.start, bc. | |
| virtualDisp = nullptr; | ||
|
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. please add aliases for the bc.pins[x] at the top, the code is very hard to follow and highly error prone with just indices. |
||
|
|
||
| if (bc.type == TYPE_HUB75MATRIX_HS) { | ||
|
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. this code needs to go belw, as it is in MM. cant create a virtual panel from a null pointer. |
||
| mxconfig.mx_width = min((u_int8_t) 64, bc.pins[0]); | ||
| mxconfig.mx_height = min((u_int8_t) 64, bc.pins[1]); | ||
| if(bc.pins[2] > 1 && bc.pins[3] > 0 && bc.pins[4]) { | ||
| virtualDisp = new VirtualMatrixPanel((*display), bc.pins[3], bc.pins[4], mxconfig.mx_width, mxconfig.mx_height, CHAIN_BOTTOM_LEFT_UP); | ||
| } | ||
| mxconfig.mx_width = min((uint8_t) 64, bc.pins[0]); | ||
| mxconfig.mx_height = min((uint8_t) 64, bc.pins[1]); | ||
| // Disable chains of panels for now, incomplete UI changes | ||
| // if(bc.pins[2] > 1 && bc.pins[3] != 0 && bc.pins[4] != 0 && bc.pins[3] != 255 && bc.pins[4] != 255) { | ||
| // virtualDisp = new VirtualMatrixPanel((*display), bc.pins[3], bc.pins[4], mxconfig.mx_width, mxconfig.mx_height, CHAIN_BOTTOM_LEFT_UP); | ||
| // } | ||
| } else if (bc.type == TYPE_HUB75MATRIX_QS) { | ||
| mxconfig.mx_width = min((u_int8_t) 64, bc.pins[0]) * 2; | ||
| mxconfig.mx_height = min((u_int8_t) 64, bc.pins[1]) / 2; | ||
| mxconfig.mx_width = min((uint8_t) 64, bc.pins[0]) * 2; | ||
| mxconfig.mx_height = min((uint8_t) 64, bc.pins[1]) / 2; | ||
| virtualDisp = new VirtualMatrixPanel((*display), 1, 1, bc.pins[0], bc.pins[1]); | ||
| virtualDisp->setRotation(0); | ||
| switch(bc.pins[1]) { | ||
|
|
@@ -849,7 +850,7 @@ BusHub75Matrix::BusHub75Matrix(const BusConfig &bc) : Bus(bc.type, bc.start, bc. | |
| } else mxconfig.setPixelColorDepthBits(8); | ||
| #endif | ||
|
|
||
| mxconfig.chain_length = max((u_int8_t) 1, min(bc.pins[2], (u_int8_t) 4)); // prevent bad data preventing boot due to low memory | ||
| mxconfig.chain_length = max((uint8_t) 1, min(bc.pins[2], (uint8_t) 4)); // prevent bad data preventing boot due to low memory | ||
|
|
||
| if(mxconfig.mx_height >= 64 && (mxconfig.chain_length > 1)) { | ||
| DEBUGBUS_PRINTLN("WARNING, only single panel can be used of 64 pixel boards due to memory"); | ||
|
|
@@ -996,7 +997,6 @@ BusHub75Matrix::BusHub75Matrix(const BusConfig &bc) : Bus(bc.type, bc.start, bc. | |
| DEBUGBUS_PRINT(F("MatrixPanel_I2S_DMA ")); | ||
| DEBUGBUS_PRINTF("%sstarted, width=%u, %u pixels.\n", _valid? "":"not ", _panelWidth, _len); | ||
|
|
||
| if (mxconfig.double_buff == true) DEBUGBUS_PRINTLN(F("MatrixPanel_I2S_DMA driver native double-buffering enabled.")); | ||
| if (_ledBuffer != nullptr) DEBUGBUS_PRINTLN(F("MatrixPanel_I2S_DMA LEDS buffer enabled.")); | ||
| if (_ledsDirty != nullptr) DEBUGBUS_PRINTLN(F("MatrixPanel_I2S_DMA LEDS dirty bit optimization enabled.")); | ||
| if ((_ledBuffer != nullptr) || (_ledsDirty != nullptr)) { | ||
|
|
@@ -1021,9 +1021,6 @@ void __attribute__((hot)) BusHub75Matrix::setPixelColor(unsigned pix, uint32_t c | |
| if ((c == IS_BLACK) && (getBitFromArray(_ledsDirty, pix) == false)) return; // ignore black if pixel is already black | ||
| setBitInArray(_ledsDirty, pix, c != IS_BLACK); // dirty = true means "color is not BLACK" | ||
|
|
||
| #ifndef NO_CIE1931 | ||
| c = unGamma24(c); // to use the driver linear brightness feature, we first need to undo WLED gamma correction | ||
|
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. @DedeHai - I'm not sure if I'm making the right change here, I've not been able to follow all the ins and outs about where Gamma correction should be applied, in WLED-MM we do use NO_CIE1931, but with the current WLED I was seeing issues with this flag, but then we don't have an 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 implemented "unGamma" but its either 8bit or 32bit. do HUB75 have built in gamma correction or why is that needed? if undoing gamma, colors will be all weird on linear panels. 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. but let me worry about that after this is in main, the whole brightness/gamma/ungamma took me a long time to fix properly. All I need to know is what the HUB75 driver does to raw colors. 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.e. does it scale the brightness or apply any gamma and if so can we disable it as that's what we need to do in WLED code. 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. By default the driver is already non linear, check the docs for the NO_CIE1931 flag |
||
| #endif | ||
| uint8_t r = R(c); | ||
| uint8_t g = G(c); | ||
| uint8_t b = B(c); | ||
|
|
@@ -1069,9 +1066,6 @@ void BusHub75Matrix::show(void) { | |
| for (int y=0; y<height; y++) for (int x=0; x<width; x++) { | ||
| if (getBitFromArray(_ledsDirty, pix) == true) { // only repaint the "dirty" pixels | ||
| uint32_t c = uint32_t(_ledBuffer[pix]) & 0x00FFFFFF; // get RGB color, removing FastLED "alpha" component | ||
| #ifndef NO_CIE1931 | ||
| c = unGamma24(c); // to use the driver linear brightness feature, we first need to undo WLED gamma correction | ||
| #endif | ||
| uint8_t r = R(c); | ||
| uint8_t g = G(c); | ||
| uint8_t b = B(c); | ||
|
|
@@ -1082,13 +1076,6 @@ void BusHub75Matrix::show(void) { | |
| } | ||
| setBitArray(_ledsDirty, _len, false); // buffer shown - reset all dirty bits | ||
| } | ||
|
|
||
| if(mxconfig.double_buff) { | ||
| display->flipDMABuffer(); // Show the back buffer, set current output buffer to the back (i.e. no longer being sent to LED panels) | ||
| // while(!previousBufferFree) delay(1); // experimental - Wait before we allow any writing to the buffer. Stop flicker. | ||
| display->clearScreen(); // Now clear the back-buffer | ||
| setBitArray(_ledsDirty, _len, false); // dislay buffer is blank - reset all dirty bits | ||
| } | ||
| } | ||
|
|
||
| void BusHub75Matrix::cleanup() { | ||
|
|
||
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.
a comment that DATA_PINS means x,y,chainlength would be nice