application: show cable shot name on LCD

This commit is contained in:
King Kévin 2020-01-05 16:31:00 +01:00
parent 6935a5d89d
commit ca741e5e68
1 changed files with 8 additions and 1 deletions

View File

@ -1539,7 +1539,14 @@ void main(void)
oled_text_clear(); // clear additional dispaly
if (cable_current->cable_best < LENGTH(usb_cables) && cable_current->cable_best < LENGTH(cable_current->unconnected_nb) && cable_current->cable_best < LENGTH(cable_current->unspecified_nb)) {
const struct usb_cable_t* usb_cable = &usb_cables[cable_current->cable_best];
lcd_hd44780_write_line(false, usb_cable->name, strlen(usb_cable->name));
if (usb_cable->shortname) {
lcd_hd44780_write_line(false, usb_cable->shortname, strlen(usb_cable->shortname));
} else if (usb_cable->name) {
lcd_hd44780_write_line(false, usb_cable->name, strlen(usb_cable->name));
} else {
const char* line = "unnamed cable";
lcd_hd44780_write_line(false, line, strlen(line));
}
char line[17] = {' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '\0'}; // line to display
if (cable_current->load) {
snprintf(line, LENGTH(line), "with load");