summaryrefslogtreecommitdiff
path: root/components/screen
diff options
context:
space:
mode:
Diffstat (limited to 'components/screen')
-rw-r--r--components/screen/screen.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/components/screen/screen.c b/components/screen/screen.c
index c6de3c7..45f89f7 100644
--- a/components/screen/screen.c
+++ b/components/screen/screen.c
@@ -179,7 +179,10 @@ void test_screen(struct Screen* screen)
void display(struct Screen* screen, char digits[4])
{
for (uint8_t i = 0; i < 4; ++i) {
- screen->nixies[i].digit = digits[i] - '0';
- set_digit(screen->mcp, &(screen->nixies[i])); // Call set_digit function
+ uint8_t digit = digits[i] - '0';
+ if (screen->nixies[i].digit != digit){
+ screen->nixies[i].digit = digit;
+ set_digit(screen->mcp, &(screen->nixies[i])); // Call set_digit function
+ }
}
} \ No newline at end of file