Update ESP32-VirtualMatrixPanel-I2S-DMA.h

This commit is contained in:
mrfaptastic 2021-04-05 13:25:46 +01:00
parent a8e7683b36
commit a8237687cf

View file

@ -112,6 +112,13 @@ inline VirtualCoords VirtualMatrixPanel::getCoords(int16_t x, int16_t y) {
return coords; return coords;
} }
// We want to rotate?
if (_rotate){
uint16_t temp_x=x;
x=y;
y=virtualResY-1-temp_x;
}
uint8_t row = (y / panelResY) + 1; //a non indexed 0 row number uint8_t row = (y / panelResY) + 1; //a non indexed 0 row number
if( ( _s_chain_party && !_chain_top_down && (row % 2 == 0) ) // serpentine vertically stacked chain starting from bottom row (i.e. ESP closest to ground), upwards if( ( _s_chain_party && !_chain_top_down && (row % 2 == 0) ) // serpentine vertically stacked chain starting from bottom row (i.e. ESP closest to ground), upwards
|| ||
@ -142,13 +149,6 @@ inline VirtualCoords VirtualMatrixPanel::getCoords(int16_t x, int16_t y) {
//coords.y = (this->display->getCfg().mx_height-1) - coords.y; //coords.y = (this->display->getCfg().mx_height-1) - coords.y;
} }
// Finally, we now want to rotate as well?
if (_rotate){
uint16_t temp_x=coords.x;
coords.x=coords.y;
coords.y=virtualResY-1-temp_x;
}
//Serial.print("Mapping to x: "); Serial.print(coords.x, DEC); Serial.print(", y: "); Serial.println(coords.y, DEC); //Serial.print("Mapping to x: "); Serial.print(coords.x, DEC); Serial.print(", y: "); Serial.println(coords.y, DEC);