diff options
author | 2019-05-29 14:33:16 +0300 | |
---|---|---|
committer | 2019-05-29 14:33:16 +0300 | |
commit | 227a0e12ee262dbabdd8d988fec194273cf90029 (patch) | |
tree | 1e63cd26ac494cc453db5ebc0a120e0b48a562d7 /src/device/screen.cpp | |
parent | a23ca7681b3dad7b63fd7b38e05fdfc2e0d75b33 (diff) | |
download | usurpation-227a0e12ee262dbabdd8d988fec194273cf90029.tar.gz usurpation-227a0e12ee262dbabdd8d988fec194273cf90029.tar.bz2 usurpation-227a0e12ee262dbabdd8d988fec194273cf90029.zip |
Tweaked function declarations and build files to make it build.
Signed-off-by: Ramūnas Mažeikis <ramunasnezinomas@gmail.com>
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 +} |