MCPcopy Create free account
hub / github.com/Blueforcer/awtrix3 / setMatrixLayout

Method setMatrixLayout

src/DisplayManager.cpp:1674–1696  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1672}
1673
1674void DisplayManager_::setMatrixLayout(int layout)
1675{
1676 delete matrix; // Free memory from the current matrix object
1677 if (DEBUG_MODE)
1678 DEBUG_PRINTF("Set matrix layout to %i", layout);
1679 switch (layout)
1680 {
1681 case 0:
1682 matrix = new FastLED_NeoMatrix(leds, 32, 8, NEO_MATRIX_TOP + NEO_MATRIX_LEFT + NEO_MATRIX_ROWS + NEO_MATRIX_ZIGZAG);
1683 break;
1684 case 1:
1685 matrix = new FastLED_NeoMatrix(leds, 8, 8, 4, 1, NEO_MATRIX_TOP + NEO_MATRIX_LEFT + NEO_MATRIX_ROWS + NEO_MATRIX_PROGRESSIVE);
1686 break;
1687 case 2:
1688 matrix = new FastLED_NeoMatrix(leds, 32, 8, NEO_MATRIX_TOP + NEO_MATRIX_LEFT + NEO_MATRIX_COLUMNS + NEO_MATRIX_ZIGZAG);
1689 break;
1690 default:
1691 break;
1692 }
1693
1694 delete ui; // Free memory from the current ui object
1695 ui = new MatrixDisplayUi(matrix); // Create a new ui object with the new matrix
1696}
1697
1698String DisplayManager_::getAppsAsJson()
1699{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected