Skip to content

Commit 7465948

Browse files
committed
Fix: St7789 Message Height
1 parent cc48585 commit 7465948

File tree

3 files changed

+5
-29
lines changed

3 files changed

+5
-29
lines changed

src/Wippersnapper.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2918,7 +2918,7 @@ ws_status_t Wippersnapper::run() {
29182918
WS.feedWDT();
29192919

29202920
// Process display controller events, if initialized
2921-
WS._displayController->update(getRSSI(), networkStatus() == WS_CONNECTED);
2921+
WS._displayController->update(getRSSI(), WS._mqtt->connected());
29222922
WS.feedWDT();
29232923

29242924
return WS_NET_CONNECTED; // TODO: Make this funcn void!

src/Wippersnapper_demo.ino.cpp

Lines changed: 0 additions & 26 deletions
This file was deleted.

src/components/display/drivers/dispDrvSt7789.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ class dispDrvSt7789 : public dispDrvBase {
199199
// Clear and draw the new cloud icon, based on MQTT connection status
200200
_display->fillRect(cloudX, iconY, _status_bar_icon_sz, _status_bar_icon_sz,
201201
ST77XX_WHITE);
202-
if (mqtt_status == 21) {
202+
if (mqtt_status) {
203203
_display->drawBitmap(cloudX, iconY, epd_bmp_cloud_online,
204204
_status_bar_icon_sz, _status_bar_icon_sz, ST77XX_BLACK);
205205
} else {
@@ -243,13 +243,15 @@ class dispDrvSt7789 : public dispDrvBase {
243243
_display->fillRect(0, _status_bar_height, _width,
244244
_height - _status_bar_height, ST77XX_BLACK);
245245
int16_t y_idx = _status_bar_height;
246-
_display->setCursor(0, y_idx);
247246

248247
// Calculate the line height based on the text size (NOTE: base height is
249248
// 8px)
250249
int16_t line_height = 8 * _text_sz;
251250
uint16_t c_idx = 0;
252251
size_t msg_size = strlen(message);
252+
// Begin with a small offset from status bar
253+
y_idx += 5;
254+
_display->setCursor(0, y_idx);
253255
for (size_t i = 0; i < msg_size && c_idx < msg_size; i++) {
254256
if (y_idx + line_height > _height)
255257
break;

0 commit comments

Comments
 (0)