summaryrefslogtreecommitdiffstats
path: root/src/device/screen.h
diff options
context:
space:
mode:
authorGravatar Ramūnas Mažeikis <ramunasnezinomas@gmail.com> 2019-05-28 20:00:23 +0300
committerGravatar Ramūnas Mažeikis <ramunasnezinomas@gmail.com> 2019-05-28 20:00:23 +0300
commitf267021479ab1f020c7956378d5bf23405ee3e65 (patch)
tree9242c595e351d55621877a2e906367d5c4db41b2 /src/device/screen.h
parentbf8b16d036e60eec56a42cbfcf012390c143e699 (diff)
downloadusurpation-f267021479ab1f020c7956378d5bf23405ee3e65.tar.gz
usurpation-f267021479ab1f020c7956378d5bf23405ee3e65.tar.bz2
usurpation-f267021479ab1f020c7956378d5bf23405ee3e65.zip
Screen: adjustments, bug fixes and abstraction.
Line drawing code no longer assumes a particular screen as long as it's interface includes OLEDDisplay. Signed-off-by: Ramūnas Mažeikis <ramunasnezinomas@gmail.com>
Diffstat (limited to 'src/device/screen.h')
-rw-r--r--src/device/screen.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/device/screen.h b/src/device/screen.h
index 54734e5..5d0e3b3 100644
--- a/src/device/screen.h
+++ b/src/device/screen.h
@@ -7,7 +7,7 @@
#define DEVICE_SCREEN_H
#include <time.h>
-#include <SSD1306Brzo.h>
+#include <OLEDDisplay.h>
#include <Wire.h>
#define SCREEN_WIDTH (128)
@@ -19,7 +19,7 @@
* Struct that keeps track of the lines on the screen.
*/
struct display_status {
- SSD1306Brzo *screen; /* Screen to draw on. */
+ OLEDDisplay *screen; /* Screen to draw on. */
time_t delta; /* Seconds/Line */
time_t last_scroll_time; /* Last second the line was scrolled */
char *message; /* Entire message to be shown */
@@ -32,8 +32,9 @@ struct display_status {
/**
* Displays scrolling text on the screen.
*/
-void display_update_scroll(struct display_status *status);
+int display_update_scroll(struct display_status *status);
+#define END_OF_MESSAGE (1 << 0)
/**
* Initialises display_status structure so it can be used for
* display_update_scroll.
@@ -44,6 +45,6 @@ void display_update_scroll(struct display_status *status);
*
* msg - message to scroll on the screen
*/
-void display_status_init(SSD1306Brzo *screen, struct display_status *status, char *msg);
+void display_status_init(OLEDDisplay *screen, struct display_status *status, char *msg);
#endif /* DEVICE_SCREEN_H */ \ No newline at end of file