diff options
Diffstat (limited to 'src/device/screen.cpp')
-rw-r--r-- | src/device/screen.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/device/screen.cpp b/src/device/screen.cpp index 8504ef2..076640f 100644 --- a/src/device/screen.cpp +++ b/src/device/screen.cpp @@ -9,8 +9,7 @@ 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'}; +static char empty_string[] = ""; void display_status_init(OLEDDisplay *screen, struct display_status *status, char *msg) { @@ -58,7 +57,7 @@ int display_update_scroll(struct display_status *status) update_lines(status); draw_lines(status->screen, status); } - if (status->first_line == NOTHING && status->second_line == NOTHING) { + if (!(*status->first_line) && !(*(status->second_line))) { return END_OF_MESSAGE; } else { return 0; @@ -77,8 +76,8 @@ void update_lines(struct display_status *status) { status->first_line = (status->line_cursor * SCREEN_MAX_CHARS < status->message_len) ? status->message + status->line_cursor * SCREEN_MAX_CHARS - : NOTHING; + : empty_string; status->second_line = (status->line_cursor * SCREEN_MAX_CHARS < status->message_len) ? status->message + (status->line_cursor + 1) * SCREEN_MAX_CHARS - : NOTHING; + : empty_string; } |