summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2016-01-20 13:20:49 +0100
committerDaniel Friesel <derf@finalrewind.org>2016-01-20 13:20:49 +0100
commitf0261ac07dada88c46bc6bb74a55324425cfba9c (patch)
tree629ed8192fc2d87624bfc80a00b87f73cf4ddbf5
parentb0285847fc295b0034aa7e7d3b90d6b70ba37b8e (diff)
reset display after receiving data
-rw-r--r--src/display.cc8
-rw-r--r--src/display.h1
-rw-r--r--src/system.cc1
3 files changed, 10 insertions, 0 deletions
diff --git a/src/display.cc b/src/display.cc
index 4b4c22d..0a64c18 100644
--- a/src/display.cc
+++ b/src/display.cc
@@ -86,6 +86,14 @@ void Display::multiplex()
}
}
+void Display::reset()
+{
+ for (int i = 0; i < 8; i++)
+ disp_buf[i] = 0xff;
+ str_pos = 0;
+ char_pos = -1;
+}
+
/*
* Draws a single display column. This function should be called at least once
* per millisecond.
diff --git a/src/display.h b/src/display.h
index 655ffa1..3eab2a8 100644
--- a/src/display.h
+++ b/src/display.h
@@ -15,6 +15,7 @@ class Display {
void enable(void);
void disable(void);
void multiplex(void);
+ void reset(void);
char string[128];
};
diff --git a/src/system.cc b/src/system.cc
index 340615d..6c44a30 100644
--- a/src/system.cc
+++ b/src/system.cc
@@ -75,6 +75,7 @@ void System::loop()
i = 0;
} else if (modem_char == 0) {
i = 0;
+ display.reset();
}
}
}