| 159 | } |
| 160 | |
| 161 | void DisplayManager_::printText(int16_t x, int16_t y, const char *text, bool centered, byte textCase) |
| 162 | { |
| 163 | |
| 164 | if (centered) |
| 165 | { |
| 166 | uint16_t textWidth = getTextWidth(text, textCase); |
| 167 | int16_t textX = ((32 - textWidth) / 2); |
| 168 | setCursor(textX, y); |
| 169 | } |
| 170 | else |
| 171 | { |
| 172 | setCursor(x, y); |
| 173 | } |
| 174 | |
| 175 | if ((UPPERCASE_LETTERS && textCase == 0) || textCase == 1) |
| 176 | { |
| 177 | size_t length = strlen(text); |
| 178 | char upperText[length + 1]; // +1 for the null terminator |
| 179 | |
| 180 | for (size_t i = 0; i < length; ++i) |
| 181 | { |
| 182 | upperText[i] = toupper(text[i]); |
| 183 | } |
| 184 | |
| 185 | upperText[length] = '\0'; // Null terminator |
| 186 | matrixPrint(upperText); |
| 187 | } |
| 188 | else |
| 189 | { |
| 190 | matrixPrint(text); |
| 191 | } |
| 192 | } |
| 193 | |
| 194 | void DisplayManager_::HSVtext(int16_t x, int16_t y, const char *text, bool clear, byte textCase) |
| 195 | { |
no test coverage detected