aboutsummaryrefslogtreecommitdiff
path: root/testing/virtual.cpp
diff options
context:
space:
mode:
authormrfaptastic <12006953+mrfaptastic@users.noreply.github.com>2023-03-15 14:05:18 +0000
committermrfaptastic <12006953+mrfaptastic@users.noreply.github.com>2023-03-15 14:05:51 +0000
commitfe5d4148252382fed393211e2b6a163188d16312 (patch)
tree487263eecfc5ea60ca033d80d40b51cd0cc0b81e /testing/virtual.cpp
parent1d21b165df6733b5d58d8d3fd5ea38e557e527b7 (diff)
Add ZigZag options. Close #414
CHAIN_BOTTOM_RIGHT_UP_ZZ CHAIN_TOP_RIGHT_DOWN_ZZ
Diffstat (limited to 'testing/virtual.cpp')
-rw-r--r--testing/virtual.cpp28
1 files changed, 27 insertions, 1 deletions
diff --git a/testing/virtual.cpp b/testing/virtual.cpp
index f13b2ea..168acb1 100644
--- a/testing/virtual.cpp
+++ b/testing/virtual.cpp
@@ -29,7 +29,8 @@ enum PANEL_CHAIN_TYPE
CHAIN_TOP_RIGHT_DOWN,
CHAIN_BOTTOM_LEFT_UP,
CHAIN_BOTTOM_RIGHT_UP,
- CHAIN_TOP_RIGHT_DOWN_ZZ /// ZigZag chaining. Might need a big ass cable to do this, all panels right way up.
+ CHAIN_TOP_RIGHT_DOWN_ZZ, /// ZigZag chaining. Might need a big ass cable to do this, all panels right way up.
+ CHAIN_BOTTOM_RIGHT_UP_ZZ
};
@@ -262,6 +263,18 @@ inline VirtualCoords VirtualMatrixPanelTest::getCoords_Dev(int16_t virt_x, int16
coords.y = virt_y % panelResY;
}
+
+ case CHAIN_BOTTOM_RIGHT_UP_ZZ:
+ {
+ // Right side up. Starting from top left all the way down.
+ // Connected in a Zig Zag manner = some long ass cables being used potentially
+
+ //Serial.printf("Condition 2, row %d ", row);
+ coords.x = (row*virtualResX)+virt_x;
+ coords.y = virt_y % panelResY;
+
+ }
+
@@ -425,6 +438,19 @@ main(int argc, char* argv[])
result = test.getCoords_Dev(16,64*2-1);
expected.x = 80; expected.y = 63;
std::printf("Expected physical (%d, %d) got (%d, %d).\n", expected.x, expected.y, result.x, result.y);
+
+
+
+ // CHAIN_BOTTOM_RIGHT_UP_ZZ test 4
+ result = test.getCoords_Dev(0,0);
+ expected.x = 0; expected.y = 0;
+ std::printf("Expected physical (%d, %d) got (%d, %d).\n", expected.x, expected.y, result.x, result.y);
+
+ // CHAIN_BOTTOM_RIGHT_UP_ZZ test 4
+ result = test.getCoords_Dev(63,64);
+ expected.x = 64*2-1; expected.y = 0;
+ std::printf("Expected physical (%d, %d) got (%d, %d).\n", expected.x, expected.y, result.x, result.y);
+
std::cout << "\n\n";