Clear LED matrix without startup test
This commit is contained in:
parent
0ee34eb784
commit
229b26b02c
3 changed files with 8 additions and 1 deletions
|
@ -255,6 +255,10 @@ void Max7219_Clear_Column(const uint8_t _COL_) {
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Max7219_Clear() {
|
||||||
|
for (uint8_t r = 0; r < 8; r++) _Max7219_Set_Reg(r, 0);
|
||||||
|
}
|
||||||
|
|
||||||
void Max7219_Set_2_Rows(const uint8_t y, uint16_t val) {
|
void Max7219_Set_2_Rows(const uint8_t y, uint16_t val) {
|
||||||
if (y > 6) return Max7219_Error(PSTR("Max7219_Set_2_Rows"), y, val);
|
if (y > 6) return Max7219_Error(PSTR("Max7219_Set_2_Rows"), y, val);
|
||||||
Max7219_Set_Row(y + 0, val & 0xFF); val >>= 8;
|
Max7219_Set_Row(y + 0, val & 0xFF); val >>= 8;
|
||||||
|
|
|
@ -77,6 +77,9 @@ void Max7219_Clear_Column(const uint8_t col);
|
||||||
void Max7219_Set_Row(const uint8_t row, const uint8_t val);
|
void Max7219_Set_Row(const uint8_t row, const uint8_t val);
|
||||||
void Max7219_Clear_Row(const uint8_t row);
|
void Max7219_Clear_Row(const uint8_t row);
|
||||||
|
|
||||||
|
// Quickly clear the whole matrix
|
||||||
|
void Max7219_Clear();
|
||||||
|
|
||||||
// Apply custom code to update the matrix
|
// Apply custom code to update the matrix
|
||||||
void Max7219_idle_tasks();
|
void Max7219_idle_tasks();
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,7 @@
|
||||||
*/
|
*/
|
||||||
void GcodeSuite::M7219() {
|
void GcodeSuite::M7219() {
|
||||||
if (parser.seen('I'))
|
if (parser.seen('I'))
|
||||||
Max7219_init();
|
Max7219_Clear();
|
||||||
else if (parser.seenval('R')) {
|
else if (parser.seenval('R')) {
|
||||||
const uint8_t r = parser.value_int();
|
const uint8_t r = parser.value_int();
|
||||||
Max7219_Set_Row(r, parser.byteval('V'));
|
Max7219_Set_Row(r, parser.byteval('V'));
|
||||||
|
|
Reference in a new issue