Update ESP32-VirtualMatrixPanel-I2S-DMA.h

This commit is contained in:
mrfaptastic 2023-03-13 09:31:04 +00:00
parent 326c9a0de7
commit 112cf6ea47

View file

@ -158,10 +158,9 @@ private:
*/ */
inline VirtualCoords VirtualMatrixPanel::getCoords(int16_t &virt_x, int16_t &virt_y) inline VirtualCoords VirtualMatrixPanel::getCoords(int16_t &virt_x, int16_t &virt_y)
{ {
coords.x = coords.y = -1; // By defalt use an invalid co-ordinates that will be rejected by updateMatrixDMABuffer
if (virt_x < 0 || virt_x >= virtualResX || virt_y < 0 || virt_y >= virtualResY) if (virt_x < 0 || virt_x >= virtualResX || virt_y < 0 || virt_y >= virtualResY)
{ // Co-ordinates go from 0 to X-1 remember! otherwise they are out of range! { // Co-ordinates go from 0 to X-1 remember! otherwise they are out of range!
coords.x = coords.y = -1; // By defalt use an invalid co-ordinates that will be rejected by updateMatrixDMABuffer
return coords; return coords;
} }
@ -279,6 +278,7 @@ inline VirtualCoords VirtualMatrixPanel::getCoords(int16_t &virt_x, int16_t &vir
default: default:
coords.x = coords.y = -1; // By defalt use an invalid co-ordinates that will be rejected by updateMatrixDMABuffer
return coords; return coords;
break; break;