* Show power source type on detailed screen in soldering mode (#1708) * Update according to code review
This commit is contained in:
@@ -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];
|
||||
|
||||
@@ -105,7 +105,7 @@ public:
|
||||
static void setBrightness(uint8_t contrast);
|
||||
static void setInverseDisplay(bool inverted);
|
||||
static int16_t getCursorX() { return cursor_x; }
|
||||
static void print(const char *string, FontStyle fontStyle); // Draw a string to the current location, with selected font
|
||||
static void print(const char *string, FontStyle fontStyle, uint8_t length = 255); // Draw a string to the current location, with selected font; optionally - with MAX length only
|
||||
static void printWholeScreen(const char *string);
|
||||
// Set the cursor location by pixels
|
||||
static void setCursor(int16_t x, int16_t y) {
|
||||
|
||||
Reference in New Issue
Block a user