summaryrefslogtreecommitdiffstats
path: root/src/device
diff options
context:
space:
mode:
Diffstat (limited to 'src/device')
-rw-r--r--src/device/meson.build8
-rw-r--r--src/device/screen.cpp9
2 files changed, 11 insertions, 6 deletions
diff --git a/src/device/meson.build b/src/device/meson.build
index d2e3c6e..8e4aa90 100644
--- a/src/device/meson.build
+++ b/src/device/meson.build
@@ -17,10 +17,14 @@ if get_option('fwbuild')
cat = find_program('cat')
cp = find_program('cp')
- fw_filenames = ['main.ino',
+ fw_filenames = [
+ 'main.ino',
'DejaVu_Sans_Mono_13.h',
'device_network.cpp',
- 'device_network.h']
+ 'device_network.h',
+ 'screen.cpp',
+ 'screen.h'
+ ]
fw_true_sources += files(fw_filenames)
fw_filenames += oledlibnames
fw_true_sources += oledlib
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
+}