Преглед изворни кода

Clear LED matrix without startup test

Scott Lahteine пре 7 година
родитељ
комит
229b26b02c

+ 4
- 0
Marlin/src/feature/Max7219_Debug_LEDs.cpp Прегледај датотеку

@@ -255,6 +255,10 @@ void Max7219_Clear_Column(const uint8_t _COL_) {
255 255
   #endif
256 256
 }
257 257
 
258
+void Max7219_Clear() {
259
+  for (uint8_t r = 0; r < 8; r++) _Max7219_Set_Reg(r, 0);
260
+}
261
+
258 262
 void Max7219_Set_2_Rows(const uint8_t y, uint16_t val) {
259 263
   if (y > 6) return Max7219_Error(PSTR("Max7219_Set_2_Rows"), y, val);
260 264
   Max7219_Set_Row(y + 0, val & 0xFF); val >>= 8;

+ 3
- 0
Marlin/src/feature/Max7219_Debug_LEDs.h Прегледај датотеку

@@ -77,6 +77,9 @@ void Max7219_Clear_Column(const uint8_t col);
77 77
 void Max7219_Set_Row(const uint8_t row, const uint8_t val);
78 78
 void Max7219_Clear_Row(const uint8_t row);
79 79
 
80
+// Quickly clear the whole matrix
81
+void Max7219_Clear();
82
+
80 83
 // Apply custom code to update the matrix
81 84
 void Max7219_idle_tasks();
82 85
 

+ 1
- 1
Marlin/src/gcode/feature/leds/M7219.cpp Прегледај датотеку

@@ -39,7 +39,7 @@
39 39
  */
40 40
 void GcodeSuite::M7219() {
41 41
   if (parser.seen('I'))
42
-    Max7219_init();
42
+    Max7219_Clear();
43 43
   else if (parser.seenval('R')) {
44 44
     const uint8_t r = parser.value_int();
45 45
     Max7219_Set_Row(r, parser.byteval('V'));

Loading…
Откажи
Сачувај