♻️ Apply F() to more LCD code (#24228)

This commit is contained in:
Scott Lahteine
2022-05-22 19:56:46 -05:00
committed by GitHub
parent e88fabafc8
commit a5e1d4c50a
44 changed files with 631 additions and 618 deletions

View File

@@ -43,13 +43,13 @@ uint8_t read_byte(uint8_t *byte) { return *byte; }
/**
* Add a string, applying substitutions for the following characters:
*
* $ displays the clipped C-string given by the itemString argument
* $ displays the clipped C-string given by the inStr argument
* = displays '0'....'10' for indexes 0 - 10
* ~ displays '1'....'11' for indexes 0 - 10
* * displays 'E1'...'E11' for indexes 0 - 10 (By default. Uses LCD_FIRST_TOOL)
* @ displays an axis name such as XYZUVW, or E for an extruder
*/
void DWIN_String::add(uint8_t *string, const int8_t index, uint8_t *itemString/*=nullptr*/) {
void DWIN_String::add(uint8_t *string, const int8_t index, uint8_t *inStr/*=nullptr*/) {
wchar_t wchar;
while (*string) {
@@ -67,8 +67,8 @@ void DWIN_String::add(uint8_t *string, const int8_t index, uint8_t *itemString/*
else
add(index == -2 ? GET_TEXT(MSG_CHAMBER) : GET_TEXT(MSG_BED));
}
else if (ch == '$' && itemString)
add(itemString);
else if (ch == '$' && inStr)
add(inStr);
else if (ch == '@')
add_character(AXIS_CHAR(index));
else