Skip to content

Commit

Permalink
Firmware updater: use led matrix only on UNO R4 (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
marqdevx authored Feb 17, 2025
1 parent dee101a commit feef426
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions examples/Utilities/FirmwareUpdater/FirmwareUpdater.ino
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#if defined(ARDUINO_UNOWIFIR4)
#include "ArduinoGraphics.h"
#include "Arduino_LED_Matrix.h"
#endif

#include "Modulino.h"
#include "Wire.h"
Expand All @@ -20,11 +22,14 @@ void setup() {
}

auto result = flash(node_base_bin, node_base_bin_len);

#if defined(ARDUINO_UNOWIFIR4)
if (result) {
matrixInitAndDraw("PASS");
} else {
matrixInitAndDraw("FAIL");
}
#endif
}

void loop() {
Expand Down Expand Up @@ -53,6 +58,7 @@ class SerialVerbose {
bool _verbose;
};

#if defined(ARDUINO_UNOWIFIR4)
ArduinoLEDMatrix matrix;

void matrixInitAndDraw(char* text) {
Expand All @@ -67,6 +73,7 @@ void matrixInitAndDraw(char* text) {

matrix.endDraw();
}
#endif

bool flash(const uint8_t* binary, size_t lenght, bool verbose) {

Expand Down

0 comments on commit feef426

Please sign in to comment.