merge upstream/master: logging pragma, screenshot retrieval, nbsp fix

Merge 3 upstream commits into mod/master:
- feat: Allow screenshot retrieval from device (#820)
- feat: Add central logging pragma (#843)
- fix: Account for nbsp character as non-breaking space (#757)

Conflict resolution:
- src/main.cpp: kept mod's HalPowerManager + upstream's Logging/screenshot
- SleepActivity.cpp: kept mod's letterbox fill rework, applied LOG_* pattern

Additional changes for logging compatibility:
- Converted remaining Serial.printf calls in mod files to LOG_* macros
  (HalPowerManager, BookSettings, BookmarkStore, GfxRenderer)
- Added ENABLE_SERIAL_LOG and LOG_LEVEL=2 to [env:mod] build flags

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
cottongin
2026-02-13 16:27:58 -05:00
58 changed files with 1188 additions and 768 deletions

View File

@@ -1,7 +1,7 @@
#include "BookSettings.h"
#include <HalStorage.h>
#include <HardwareSerial.h>
#include <Logging.h>
#include <Serialization.h>
namespace {
@@ -37,15 +37,15 @@ BookSettings BookSettings::load(const std::string& cachePath) {
} while (false);
f.close();
Serial.printf("[%lu] [BST] Loaded book settings from %s (letterboxFill=%d)\n", millis(), filePath(cachePath).c_str(),
settings.letterboxFillOverride);
LOG_DBG("BST", "Loaded book settings from %s (letterboxFill=%d)", filePath(cachePath).c_str(),
settings.letterboxFillOverride);
return settings;
}
bool BookSettings::save(const std::string& cachePath, const BookSettings& settings) {
FsFile f;
if (!Storage.openFileForWrite("BST", filePath(cachePath), f)) {
Serial.printf("[%lu] [BST] Could not save book settings!\n", millis());
LOG_ERR("BST", "Could not save book settings!");
return false;
}
@@ -55,6 +55,6 @@ bool BookSettings::save(const std::string& cachePath, const BookSettings& settin
// New fields added here
f.close();
Serial.printf("[%lu] [BST] Saved book settings to %s\n", millis(), filePath(cachePath).c_str());
LOG_DBG("BST", "Saved book settings to %s", filePath(cachePath).c_str());
return true;
}