Skip to content

Commit

Permalink
Clear the row only if necessary.
Browse files Browse the repository at this point in the history
  • Loading branch information
lpodkalicki committed Dec 17, 2017
1 parent c402f48 commit a570ba6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions max7219.c
Expand Up @@ -142,7 +142,9 @@ MAX7219_clear(void)
uint8_t i;

for (i = 0; i < 8; ++i) {
MAX7219_state[i] = 0;
MAX7219_send(i + 1, 0);
if (MAX7219_state[i]) {
MAX7219_state[i] = 0;
MAX7219_send(i + 1, 0);
}
}
}

0 comments on commit a570ba6

Please sign in to comment.