Skip to content

Commit

Permalink
Merge branch 'master' into lvgl-driver
Browse files Browse the repository at this point in the history
  • Loading branch information
mverch67 authored Jan 27, 2025
2 parents 85a4ca9 + f0564ae commit b1003d5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions source/graphics/TFT/TFTView_320x240.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5348,6 +5348,7 @@ void TFTView_320x240::notifyRestoreMessages(int32_t percentage)
lv_label_set_text(objects.msg_popup_label, buf);
lv_obj_clear_flag(objects.msg_popup_panel, LV_OBJ_FLAG_HIDDEN);
lv_group_focus_obj(objects.msg_popup_button);
lv_task_handler();
} else {
lv_obj_add_flag(objects.msg_popup_panel, LV_OBJ_FLAG_HIDDEN);
ILOG_DEBUG("notifyRestoreMessages finished");
Expand Down
10 changes: 7 additions & 3 deletions source/graphics/common/ViewController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -586,23 +586,27 @@ void ViewController::beginRestoreTextMessages(void)
{
configCompleted = true;
restoreTimer = millis();
ILOG_DEBUG("loading persistent messages...");
ILOG_INFO("loading persistent messages...");
}

/**
* incrementally recover messages from persistent log (could take a while!)
*/
void ViewController::restoreTextMessages(void)
{
static uint32_t msgCounter = 0;
LogMessageEnv msg;
if (log.readNext(msg)) {
view->restoreMessage(msg);
msgCounter++;
} else {
ILOG_DEBUG("restoring log messages completed in %dms.", millis() - restoreTimer);
ILOG_INFO("restoring %d messages completed in %dms.", msgCounter, millis() - restoreTimer);
msgCounter = 0;
messagesRestored = true;
view->notifyMessagesRestored();
}
}

/**
* write a flag into message log that chat has been deleted
* The call removeTextMessages(0,0,0) removes all logs.
Expand Down Expand Up @@ -878,7 +882,7 @@ bool ViewController::packetReceived(const meshtastic_MeshPacket &p)
ILOG_DEBUG("loading all logs at once");
int32_t percentage = log.current() * 100 / log.count();
bool showPercentage = false;
if (log.count() > 2 && percentage < 50) { // TODO: was 10
if (log.count() > 3 && percentage < 80) {
showPercentage = true;
view->notifyRestoreMessages(percentage);
}
Expand Down

0 comments on commit b1003d5

Please sign in to comment.