Selaa lähdekoodia

Clear LED matrix without startup test

Scott Lahteine 7 vuotta sitten
vanhempi
commit
229b26b02c

+ 4
- 0
Marlin/src/feature/Max7219_Debug_LEDs.cpp Näytä tiedosto

255
   #endif
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
 void Max7219_Set_2_Rows(const uint8_t y, uint16_t val) {
262
 void Max7219_Set_2_Rows(const uint8_t y, uint16_t val) {
259
   if (y > 6) return Max7219_Error(PSTR("Max7219_Set_2_Rows"), y, val);
263
   if (y > 6) return Max7219_Error(PSTR("Max7219_Set_2_Rows"), y, val);
260
   Max7219_Set_Row(y + 0, val & 0xFF); val >>= 8;
264
   Max7219_Set_Row(y + 0, val & 0xFF); val >>= 8;

+ 3
- 0
Marlin/src/feature/Max7219_Debug_LEDs.h Näytä tiedosto

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

+ 1
- 1
Marlin/src/gcode/feature/leds/M7219.cpp Näytä tiedosto

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

Loading…
Peruuta
Tallenna