Skip to content

Rename variable matrix to ledMatrixAnimationHandler #12

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 27, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions src/utility/LEDFeedback.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#ifdef BOARD_HAS_LED_MATRIX
#include "Arduino_LED_Matrix.h"

ArduinoLEDMatrix matrix;
ArduinoLEDMatrix ledMatrixAnimationHandler;
const uint32_t bluetooth[3] = {

0x401600d,
Expand Down Expand Up @@ -158,7 +158,7 @@ void LEDFeedbackClass::begin() {
#endif

#ifdef BOARD_HAS_LED_MATRIX
matrix.begin();
ledMatrixAnimationHandler.begin();
#endif

}
Expand All @@ -179,7 +179,7 @@ void LEDFeedbackClass::setMode(LEDFeedbackMode mode) {
{
_ledChangeInterval = 0;
#ifdef BOARD_HAS_LED_MATRIX
matrix.clear();
ledMatrixAnimationHandler.clear();
#endif
}
break;
Expand All @@ -192,11 +192,11 @@ void LEDFeedbackClass::setMode(LEDFeedbackMode mode) {
#endif
#ifdef BOARD_HAS_LED_MATRIX
_framePtr = nullptr;
matrix.loadSequence(snake);
matrix.play(true);
ledMatrixAnimationHandler.loadSequence(snake);
ledMatrixAnimationHandler.play(true);
/* For fixing the issue that the first
* frame of the first run is not shown */
matrix.loadSequence(snake);
ledMatrixAnimationHandler.loadSequence(snake);
#endif
_ledChangeInterval = HEARTBEAT_INTERVAL;
_count = 0;
Expand All @@ -211,7 +211,7 @@ void LEDFeedbackClass::setMode(LEDFeedbackMode mode) {
_ledPin = GREEN_LED;
#endif
#ifdef BOARD_HAS_LED_MATRIX
matrix.loadFrame(bluetooth);
ledMatrixAnimationHandler.loadFrame(bluetooth);
_framePtr = (uint32_t*)bluetooth;
#endif
_ledChangeInterval = ALWAYS_ON_INTERVAL;
Expand All @@ -225,8 +225,8 @@ void LEDFeedbackClass::setMode(LEDFeedbackMode mode) {
_ledPin = GREEN_LED;
#ifdef BOARD_HAS_LED_MATRIX
_framePtr = nullptr;
matrix.loadSequence(LEDMATRIX_ANIMATION_WIFI_SEARCH);
matrix.play(true);
ledMatrixAnimationHandler.loadSequence(LEDMATRIX_ANIMATION_WIFI_SEARCH);
ledMatrixAnimationHandler.play(true);
#endif
_ledChangeInterval = ALWAYS_ON_INTERVAL;

Expand All @@ -239,8 +239,8 @@ void LEDFeedbackClass::setMode(LEDFeedbackMode mode) {
#endif
#ifdef BOARD_HAS_LED_MATRIX
_framePtr = nullptr;
matrix.loadSequence(cloud);
matrix.play(true);
ledMatrixAnimationHandler.loadSequence(cloud);
ledMatrixAnimationHandler.play(true);
#endif
_ledPin = GREEN_LED;
_ledChangeInterval = SLOWBLINK_INTERVAL;
Expand All @@ -258,7 +258,7 @@ void LEDFeedbackClass::setMode(LEDFeedbackMode mode) {
#endif
#ifdef BOARD_HAS_LED_MATRIX
_framePtr = (uint32_t*)LEDMATRIX_EMOJI_SAD;
matrix.loadFrame(LEDMATRIX_EMOJI_SAD);
ledMatrixAnimationHandler.loadFrame(LEDMATRIX_EMOJI_SAD);
#endif
}
break;
Expand Down Expand Up @@ -327,7 +327,7 @@ void LEDFeedbackClass::turnOFF() {
#endif
#ifdef BOARD_HAS_LED_MATRIX
if(_framePtr != nullptr){
matrix.clear();
ledMatrixAnimationHandler.clear();
}

#endif
Expand All @@ -342,7 +342,7 @@ void LEDFeedbackClass::turnON() {
#endif
#ifdef BOARD_HAS_LED_MATRIX
if(_framePtr != nullptr){
matrix.loadFrame(_framePtr);
ledMatrixAnimationHandler.loadFrame(_framePtr);
}
#endif
_ledState = true;
Expand Down
Loading