application: show cable shot name on LCD
This commit is contained in:
parent
6935a5d89d
commit
ca741e5e68
|
@ -1539,7 +1539,14 @@ void main(void)
|
||||||
oled_text_clear(); // clear additional dispaly
|
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)) {
|
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];
|
const struct usb_cable_t* usb_cable = &usb_cables[cable_current->cable_best];
|
||||||
|
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));
|
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
|
char line[17] = {' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '\0'}; // line to display
|
||||||
if (cable_current->load) {
|
if (cable_current->load) {
|
||||||
snprintf(line, LENGTH(line), "with load");
|
snprintf(line, LENGTH(line), "with load");
|
||||||
|
|
Loading…
Reference in New Issue