diff options
Diffstat (limited to 'src/device/screen.cpp')
-rw-r--r-- | src/device/screen.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/device/screen.cpp b/src/device/screen.cpp index c923b99..2857161 100644 --- a/src/device/screen.cpp +++ b/src/device/screen.cpp @@ -5,16 +5,17 @@ #include <Wire.h> #include "screen.h" -void draw_lines(struct display_status *status); +void draw_lines(OLEDDisplay *screen, struct display_status *status); void update_lines(struct display_status *status); void init_msg(char *msg, size_t size); /* Effectively const. For type safety reasons. */ static char NOTHING[] = {'\0'}; -void display_status_init(struct display_status *status, char *msg) +void display_status_init(OLEDDisplay *screen, struct display_status *status, char *msg) { status->delta = 2; /* Currently default */ + status->screen = screen; init_msg(msg, strlen(msg)); status->message = msg; status->line_cursor = 0; @@ -55,7 +56,7 @@ int display_update_scroll(struct display_status *status) status->last_scroll_time += status->delta; status->line_cursor++; update_lines(status); - draw_lines(status); + draw_lines(status->screen, status); } if (status->first_line == NOTHING && status->second_line == NOTHING) { return END_OF_MESSAGE; @@ -79,4 +80,4 @@ void update_lines(struct display_status *status) status->second_line = (status->line_cursor * SCREEN_MAX_CHARS < status->message_len) ? status->message + (status->line_cursor + 1) * SCREEN_MAX_CHARS : NOTHING; -}
\ No newline at end of file +} |