From f267021479ab1f020c7956378d5bf23405ee3e65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ram=C5=ABnas=20Ma=C5=BEeikis?= Date: Tue, 28 May 2019 20:00:23 +0300 Subject: Screen: adjustments, bug fixes and abstraction. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Line drawing code no longer assumes a particular screen as long as it's interface includes OLEDDisplay. Signed-off-by: Ramūnas Mažeikis --- src/device/screen.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/device/screen.h') 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 -#include +#include #include #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 -- cgit v1.2.3