Forked LEDMatrix and added horizontal scrolling
Fork of LEDMatrix by
Diff: LEDMatrix.cpp
- Revision:
- 5:334fc002e200
- Parent:
- 4:40d4afefcd74
diff -r 40d4afefcd74 -r 334fc002e200 LEDMatrix.cpp
--- a/LEDMatrix.cpp Fri Jan 15 09:50:10 2016 +0000
+++ b/LEDMatrix.cpp Fri Jan 15 12:18:34 2016 +0000
@@ -53,7 +53,7 @@
for (int i = 0; i < LED_MATRIX_MAX_LINES; i++)
{
_lineScrollInc[i] = 0;
- _lineAlert[i] = false;
+ _lineHighlight[i] = false;
_lineInvert[i] = false;
}
_isBusy = false;
@@ -181,7 +181,6 @@
// Work out which display line we're in
uint8_t dispMask = mask;
- bool invertRow = false;
int rowsInLine = (height/numLines);
int dispLine = scanRowIdx / rowsInLine;
if (dispLine < numLines)
@@ -326,6 +325,9 @@
int bytesToZero = numRows * (dispBufWidth / 8);
for (int i = 0; i < bytesToZero; i++)
*ptr++ = 0x00;
+ // Stop invert
+ for (int i = 0; i < LED_MATRIX_MAX_LINES; i++)
+ _lineInvert[i] = false;
}
void LEDMatrix::setScrollRate(int rate)
@@ -367,9 +369,9 @@
_lineScrollInc[i+startLine] = scrollInc;
}
-void LEDMatrix::setAlert(int lineIdx, bool alertOn)
+void LEDMatrix::setHighlight(int lineIdx, bool highlightOn)
{
- // Store the alert status
+ // Store the highlight status
int startLine = 0;
int linesToProcess = numLines;
if (lineIdx != -1)
@@ -380,7 +382,7 @@
linesToProcess = 1;
}
for (int i = 0; i < linesToProcess; i++)
- _lineAlert[i+startLine] = alertOn;
+ _lineHighlight[i+startLine] = highlightOn;
}
void LEDMatrix::serviceEffects()
@@ -405,9 +407,7 @@
_flashCounter = 0;
_flashState = !_flashState;
for (int i = 0; i < numLines; i++)
- {
- _lineInvert[i] = _lineAlert[i] ? _flashState : false;
- }
+ _lineInvert[i] = _lineHighlight[i] ? _flashState : false;
}
}
