summaryrefslogtreecommitdiffstats
path: root/src/device/screen.h
diff options
context:
space:
mode:
authorGravatar Ramūnas Mažeikis <ramunasnezinomas@gmail.com> 2019-05-27 15:20:01 +0300
committerGravatar Ramūnas Mažeikis <ramunasnezinomas@gmail.com> 2019-05-27 15:20:01 +0300
commit755680ca7246b232c45e3b519e9d8a95ea97375f (patch)
treed44ccdd06cfa25b5faaed1c926b21acddaed2f3c /src/device/screen.h
parentfb71bc50ff0f1c9f72641723995bb906eb0edfc4 (diff)
downloadusurpation-755680ca7246b232c45e3b519e9d8a95ea97375f.tar.gz
usurpation-755680ca7246b232c45e3b519e9d8a95ea97375f.tar.bz2
usurpation-755680ca7246b232c45e3b519e9d8a95ea97375f.zip
Device: partial implementation of line scrolling logic.
Signed-off-by: Ramūnas Mažeikis <ramunasnezinomas@gmail.com>
Diffstat (limited to 'src/device/screen.h')
-rwxr-xr-xsrc/device/screen.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/device/screen.h b/src/device/screen.h
new file mode 100755
index 0000000..ec30cd5
--- /dev/null
+++ b/src/device/screen.h
@@ -0,0 +1,22 @@
+#ifndef DEVICE_SCREEN_H
+#define DEVICE_SCREEN_H
+
+#include <time.h>
+
+/**
+ * Struct that keeps track of the lines on the screen.
+ */
+struct display_status {
+ time_t delta; /* Seconds/Line */
+ time_t last_scroll_time; /* Last second the line was scrolled */
+ char *message; /* Entire message to be shown */
+ char *first_line; /* First line on display */
+ char *second_line; /* Second line on display */
+ size_t message_len; /* Length of the message */
+ size_t line_cursor; /* Index of the first line being displayed. */
+};
+
+void display_update_scroll(struct display_status *status);
+void display_status_init(struct display_status *status, char *msg);
+
+#endif /* DEVICE_SCREEN_H */ \ No newline at end of file