Skip to content

Commit 92176b0

Browse files
authored
Rename variable matrix to ledMatrixAnimationHandler (#12)
1 parent b349c5d commit 92176b0

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

src/utility/LEDFeedback.cpp

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#ifdef BOARD_HAS_LED_MATRIX
1919
#include "Arduino_LED_Matrix.h"
2020

21-
ArduinoLEDMatrix matrix;
21+
ArduinoLEDMatrix ledMatrixAnimationHandler;
2222
const uint32_t bluetooth[3] = {
2323

2424
0x401600d,
@@ -158,7 +158,7 @@ void LEDFeedbackClass::begin() {
158158
#endif
159159

160160
#ifdef BOARD_HAS_LED_MATRIX
161-
matrix.begin();
161+
ledMatrixAnimationHandler.begin();
162162
#endif
163163

164164
}
@@ -179,7 +179,7 @@ void LEDFeedbackClass::setMode(LEDFeedbackMode mode) {
179179
{
180180
_ledChangeInterval = 0;
181181
#ifdef BOARD_HAS_LED_MATRIX
182-
matrix.clear();
182+
ledMatrixAnimationHandler.clear();
183183
#endif
184184
}
185185
break;
@@ -192,11 +192,11 @@ void LEDFeedbackClass::setMode(LEDFeedbackMode mode) {
192192
#endif
193193
#ifdef BOARD_HAS_LED_MATRIX
194194
_framePtr = nullptr;
195-
matrix.loadSequence(snake);
196-
matrix.play(true);
195+
ledMatrixAnimationHandler.loadSequence(snake);
196+
ledMatrixAnimationHandler.play(true);
197197
/* For fixing the issue that the first
198198
* frame of the first run is not shown */
199-
matrix.loadSequence(snake);
199+
ledMatrixAnimationHandler.loadSequence(snake);
200200
#endif
201201
_ledChangeInterval = HEARTBEAT_INTERVAL;
202202
_count = 0;
@@ -211,7 +211,7 @@ void LEDFeedbackClass::setMode(LEDFeedbackMode mode) {
211211
_ledPin = GREEN_LED;
212212
#endif
213213
#ifdef BOARD_HAS_LED_MATRIX
214-
matrix.loadFrame(bluetooth);
214+
ledMatrixAnimationHandler.loadFrame(bluetooth);
215215
_framePtr = (uint32_t*)bluetooth;
216216
#endif
217217
_ledChangeInterval = ALWAYS_ON_INTERVAL;
@@ -225,8 +225,8 @@ void LEDFeedbackClass::setMode(LEDFeedbackMode mode) {
225225
_ledPin = GREEN_LED;
226226
#ifdef BOARD_HAS_LED_MATRIX
227227
_framePtr = nullptr;
228-
matrix.loadSequence(LEDMATRIX_ANIMATION_WIFI_SEARCH);
229-
matrix.play(true);
228+
ledMatrixAnimationHandler.loadSequence(LEDMATRIX_ANIMATION_WIFI_SEARCH);
229+
ledMatrixAnimationHandler.play(true);
230230
#endif
231231
_ledChangeInterval = ALWAYS_ON_INTERVAL;
232232

@@ -239,8 +239,8 @@ void LEDFeedbackClass::setMode(LEDFeedbackMode mode) {
239239
#endif
240240
#ifdef BOARD_HAS_LED_MATRIX
241241
_framePtr = nullptr;
242-
matrix.loadSequence(cloud);
243-
matrix.play(true);
242+
ledMatrixAnimationHandler.loadSequence(cloud);
243+
ledMatrixAnimationHandler.play(true);
244244
#endif
245245
_ledPin = GREEN_LED;
246246
_ledChangeInterval = SLOWBLINK_INTERVAL;
@@ -258,7 +258,7 @@ void LEDFeedbackClass::setMode(LEDFeedbackMode mode) {
258258
#endif
259259
#ifdef BOARD_HAS_LED_MATRIX
260260
_framePtr = (uint32_t*)LEDMATRIX_EMOJI_SAD;
261-
matrix.loadFrame(LEDMATRIX_EMOJI_SAD);
261+
ledMatrixAnimationHandler.loadFrame(LEDMATRIX_EMOJI_SAD);
262262
#endif
263263
}
264264
break;
@@ -327,7 +327,7 @@ void LEDFeedbackClass::turnOFF() {
327327
#endif
328328
#ifdef BOARD_HAS_LED_MATRIX
329329
if(_framePtr != nullptr){
330-
matrix.clear();
330+
ledMatrixAnimationHandler.clear();
331331
}
332332

333333
#endif
@@ -342,7 +342,7 @@ void LEDFeedbackClass::turnON() {
342342
#endif
343343
#ifdef BOARD_HAS_LED_MATRIX
344344
if(_framePtr != nullptr){
345-
matrix.loadFrame(_framePtr);
345+
ledMatrixAnimationHandler.loadFrame(_framePtr);
346346
}
347347
#endif
348348
_ledState = true;

0 commit comments

Comments
 (0)