summaryrefslogtreecommitdiff
path: root/anzeige.c
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2018-10-26 10:42:43 +0200
committerErich Eckner <git@eckner.net>2018-10-26 10:42:43 +0200
commit3d7d5934ce19203b1b795cfea6a51599a20c9639 (patch)
tree0d41be92dbb1e866ef405a49676a59153d6fd2b8 /anzeige.c
parentcab5ead7656173c415c56587bae5cf14774ecee4 (diff)
downloadanzeige-3d7d5934ce19203b1b795cfea6a51599a20c9639.tar.xz
longer scroll-buffer; append all messages
Diffstat (limited to 'anzeige.c')
-rw-r--r--anzeige.c29
1 files changed, 23 insertions, 6 deletions
diff --git a/anzeige.c b/anzeige.c
index 33a64f9..4059e9a 100644
--- a/anzeige.c
+++ b/anzeige.c
@@ -20,8 +20,9 @@ int main(int argc, char **argv)
pthread_t thread_id;
t_display_data display_data;
int ret_val;
- #define TEXT_BUFFER_LENGTH 42
+ #define TEXT_BUFFER_LENGTH 256
unsigned char *text_buffer;
+ unsigned char *text_buffer_end;
t_scroll_buffer scroll_buffers[2];
// Set up gpi pointer for direct register access
@@ -51,12 +52,28 @@ int main(int argc, char **argv)
}
memset(text_buffer, 0, TEXT_BUFFER_LENGTH);
-/* ret_val = gadgets_retrieve_weather_warnings(text_buffer,TEXT_BUFFER_LENGTH);
- if (ret_val) {
+ text_buffer_end = text_buffer;
+
+ text_buffer_end = gadgets_retrieve_weather_warnings(text_buffer_end,text_buffer + TEXT_BUFFER_LENGTH - text_buffer_end);
+ if (text_buffer_end == NULL) {
+ fprintf(stderr, "gadgets_retrieve_weather_warnings failed\n");
free(text_buffer);
- exit(ret_val);
- }*/
- strcpy(text_buffer, "ABCDEFGHIJKLMNO");
+ return EXIT_FAILURE;
+ }
+
+ text_buffer_end = gadgets_retrieve_current_temperature(text_buffer_end,text_buffer + TEXT_BUFFER_LENGTH - text_buffer_end);
+ if (text_buffer_end == NULL) {
+ fprintf(stderr, "gadgets_retrieve_current_temperature failed\n");
+ free(text_buffer);
+ return EXIT_FAILURE;
+ }
+
+ text_buffer_end = gadgets_retrieve_weather_forecast(text_buffer_end,text_buffer + TEXT_BUFFER_LENGTH - text_buffer_end);
+ if (text_buffer_end == NULL) {
+ fprintf(stderr, "gadgets_retrieve_weather_forecast failed\n");
+ free(text_buffer);
+ return EXIT_FAILURE;
+ }
scroll_buffers[0].scroll_len = render(text_buffer, TEXT_BUFFER_LENGTH, scroll_buffers[0].buf, sizeof(scroll_buffers[0].buf), 1);