Advertisement
Guest User

SmartMatrix tearing alternative

a guest
Jan 24th, 2021
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 1.03 KB | None | 0 0
  1. diff --git a/src/MatrixTeensy4Hub75Calc_Impl.h b/src/MatrixTeensy4Hub75Calc_Impl.h
  2. index a5afc66..46ca838 100644
  3. --- a/src/MatrixTeensy4Hub75Calc_Impl.h
  4. +++ b/src/MatrixTeensy4Hub75Calc_Impl.h
  5. @@ -168,7 +168,13 @@ FASTRUN void SmartMatrixHub75Calc<refreshDepth, matrixWidth, matrixHeight, panel
  6.          SmartMatrixHub75Calc<refreshDepth, matrixWidth, matrixHeight, panelType, optionFlags>::loadMatrixBuffers(currentRow);
  7.          SmartMatrixRefreshT4<refreshDepth, matrixWidth, matrixHeight, panelType, optionFlags>::writeRowBuffer(currentRow);
  8.  
  9. -        if (++currentRow >= MATRIX_SCAN_MOD) currentRow = 0;
  10. +        static unsigned int rowCounter = 0;
  11. +        if (rowCounter & 1) {
  12. +            currentRow = MATRIX_SCAN_MOD - 1 - (rowCounter / 2);
  13. +        } else {
  14. +            currentRow = rowCounter / 2;
  15. +        }
  16. +        if (++rowCounter >= MATRIX_SCAN_MOD) rowCounter = 0;
  17.  
  18.          if (dmaBufferUnderrun) {
  19.              // if refreshrate is too high, lower - minimum set to avoid overflowing timer at low refresh rates
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement