Browse Source

fullscreen message: use \n to force the next word on the next line

Useful for printing short URLs since those contain punctuation characters, which get treated at the end of a word under usual circumstances
Alex Voinea 2 years ago
parent
commit
500131d51d
1 changed files with 5 additions and 0 deletions
  1. 5 0
      Firmware/ultralcd.cpp

+ 5 - 0
Firmware/ultralcd.cpp

@@ -2994,6 +2994,11 @@ static const char* lcd_display_message_fullscreen_nonBlocking_P(const char *msg)
             char c = char(pgm_read_byte(msg));
             char c = char(pgm_read_byte(msg));
             if (c == '~')
             if (c == '~')
                 c = ' ';
                 c = ' ';
+            else if (c == '\n') {
+                // Abort early if '\n' is encontered.
+                // This character is used to force the following words to be printed on the next line.
+                break;
+            }
             lcd_print(c);
             lcd_print(c);
         }
         }
     }
     }