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.
This commit is contained in:
Roxy-3D 2018-06-19 14:39:40 -05:00 committed by Scott Lahteine
parent 7cdaf69ab7
commit 3ca4f09680
2 changed files with 2 additions and 2 deletions

View File

@ -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

View File

@ -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'));