application: check is oled setup is successful

This commit is contained in:
King Kévin 2020-02-27 19:41:55 +01:00
parent c4f011c8b8
commit 68f9577452
1 changed files with 6 additions and 4 deletions

View File

@ -1709,11 +1709,13 @@ void main(void)
lcd_hd44780_write_line(false, lcd_default_line1, strlen(lcd_default_line1));
lcd_hd44780_write_line(true, lcd_default_line2, strlen(lcd_default_line2));
} else {
printf("could not start LCD\n");
puts("could not start LCD\n");
}
// setup OLED display
oled_text_setup();
if (!oled_text_setup()) {
puts("could not start OLED\n");
}
oled_text_clear();
oled_text_update();
@ -1740,13 +1742,13 @@ void main(void)
struct cable_t* cable_current = calloc(1, sizeof(struct cable_t)); // to store the currently detected cable
if (NULL == cable_current) {
printf("EOMEM\n");
puts("EOMEM\n");
while (true);
}
cable_clear(cable_current); // initialize rest of cable structure
struct cable_t* cable_next = calloc(1, sizeof(struct cable_t)); // to store the next detected cable
if (NULL == cable_next) {
printf("EOMEM\n");
puts("EOMEM\n");
while (true);
}
cable_clear(cable_next); // initialize rest of cable structure