1
0
forked from me/IronOS

Show power source type on detailed screen in soldering mode (#1708) (#1709)

* Show power source type on detailed screen in soldering mode (#1708)

* Update according to code review
This commit is contained in:
Ivan Zorin
2023-06-18 14:38:26 +03:00
committed by GitHub
parent 4d7e4f41e3
commit a1b9e40f67
7 changed files with 55 additions and 43 deletions

View File

@@ -404,14 +404,14 @@ void OLED::setInverseDisplay(bool inverse) {
I2C_CLASS::I2C_RegisterWrite(DEVICEADDR_OLED, 0x80, normalInverseCmd);
}
// print a string to the current cursor location
void OLED::print(const char *const str, FontStyle fontStyle) {
// print a string to the current cursor location, len chars MAX
void OLED::print(const char *const str, FontStyle fontStyle, uint8_t len) {
const uint8_t *next = reinterpret_cast<const uint8_t *>(str);
if (next[0] == 0x01) {
fontStyle = FontStyle::LARGE;
next++;
}
while (next[0]) {
while (next[0] && len--) {
uint16_t index;
if (next[0] <= 0xF0) {
index = next[0];