Update ESP32-VirtualMatrixPanel-I2S-DMA.h

#354 @rigorka contribution
This commit is contained in:
mrfaptastic 2023-04-16 19:13:40 +01:00 committed by GitHub
parent 8098af9b66
commit ab24a61aba
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -49,7 +49,8 @@ enum PANEL_SCAN_RATE
NORMAL_TWO_SCAN,
NORMAL_ONE_SIXTEEN, // treated as the same
FOUR_SCAN_32PX_HIGH,
FOUR_SCAN_16PX_HIGH
FOUR_SCAN_16PX_HIGH,
FOUR_SCAN_64PX_HIGH
};
// Chaining approach... From the perspective of the DISPLAY / LED side of the chain of panels.
@ -354,12 +355,19 @@ inline VirtualCoords VirtualMatrixPanel::getCoords(int16_t virt_x, int16_t virt_
break;
} // end switch
/* START: Pixel remapping AGAIN to convert TWO parallel scanline output that the
* the underlying hardware library is designed for (because
* there's only 2 x RGB pins... and convert this to 1/4 or something
*/
if (panel_scan_rate == FOUR_SCAN_32PX_HIGH)
*/
if (panel_scan_rate == FOUR_SCAN_64PX_HIGH)
{
// https://github.com/mrfaptastic/ESP32-HUB75-MatrixPanel-DMA/issues/345#issuecomment-1510401192
if ((virt_y & 8) != ((virt_y & 16) >> 1)) { virt_y = (virt_y & 0b11000) ^ 0b11000 + (virt_y & 0b11100111); }
}
else if (panel_scan_rate == FOUR_SCAN_32PX_HIGH)
{
/* Convert Real World 'VirtualMatrixPanel' co-ordinates (i.e. Real World pixel you're looking at
on the panel or chain of panels, per the chaining configuration) to a 1/8 panels