From 3ca4f0968098de8d6d1051203204b99dd92e3f93 Mon Sep 17 00:00:00 2001 From: Roxy-3D Date: Tue, 19 Jun 2018 14:39:40 -0500 Subject: [PATCH] Tiny improvement to M7219 The registers within the Max7219 can get corrupted a number of ways. This allows the Max7219 to be reset and fully initialized. And... it also allows the user to see the initialization pattern. --- Marlin/Configuration_adv.h | 2 +- Marlin/Marlin_main.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index e237abd8d..49277eb7b 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -1649,7 +1649,7 @@ //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix #define MAX7219_INIT_TEST // Do a test pattern at initialization (Set to 2 for spiral) - #define MAX7219_ROTATE 0 // Rotate the display counter-clockwise (multiple of +/- 90°) + #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) /** * Sample debug features diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 833600f81..01430c707 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -10878,7 +10878,7 @@ inline void gcode_M502() { */ inline void gcode_M7219() { if (parser.seen('I')) - for (uint8_t r = 0; r < 8; r++) Max7219_Set_Row(r, 0); + Max7219_init(); else if (parser.seenval('R')) { const uint8_t r = parser.value_int(); Max7219_Set_Row(r, parser.byteval('V'));