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:
@@ -1,5 +1,6 @@
|
||||
#include "HalPowerManager.h"
|
||||
|
||||
#include <Logging.h>
|
||||
#include <esp_sleep.h>
|
||||
|
||||
#include "HalGPIO.h"
|
||||
@@ -14,16 +15,16 @@ void HalPowerManager::setPowerSaving(bool enabled) {
|
||||
return; // invalid state
|
||||
}
|
||||
if (enabled && !isLowPower) {
|
||||
Serial.printf("[%lu] [PWR] Going to low-power mode\n", millis());
|
||||
LOG_DBG("PWR", "Going to low-power mode");
|
||||
if (!setCpuFrequencyMhz(LOW_POWER_FREQ)) {
|
||||
Serial.printf("[%lu] [PWR] Failed to set low-power CPU frequency\n", millis());
|
||||
LOG_ERR("PWR", "Failed to set low-power CPU frequency");
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (!enabled && isLowPower) {
|
||||
Serial.printf("[%lu] [PWR] Restoring normal CPU frequency\n", millis());
|
||||
LOG_DBG("PWR", "Restoring normal CPU frequency");
|
||||
if (!setCpuFrequencyMhz(normalFreq)) {
|
||||
Serial.printf("[%lu] [PWR] Failed to restore normal CPU frequency\n", millis());
|
||||
LOG_ERR("PWR", "Failed to restore normal CPU frequency");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user