Build fail fix

This commit is contained in:
HarukiToreda
2025-10-06 12:29:43 -04:00
parent b549786bbb
commit 67c0000f87
8 changed files with 38 additions and 9 deletions

View File

@@ -1,9 +1,10 @@
#include "MessageStore.h"
#include "configuration.h"
#if HAS_SCREEN
#include "FSCommon.h"
#include "MessageStore.h"
#include "NodeDB.h"
#include "SPILock.h"
#include "SafeFile.h"
#include "configuration.h"
#include "gps/RTC.h"
#include "graphics/draw/MessageRenderer.h"
@@ -132,6 +133,7 @@ void MessageStore::addFromString(uint32_t sender, uint8_t channelIndex, const st
addLiveMessage(sm);
}
#if ENABLE_MESSAGE_PERSISTENCE
// Save RAM queue to flash (called on shutdown)
void MessageStore::saveToFlash()
{
@@ -250,6 +252,11 @@ void MessageStore::loadFromFlash()
logMemoryUsage("loadFromFlash");
#endif
}
#else
// Persistence disabled (saves flash space)
void MessageStore::saveToFlash() {}
void MessageStore::loadFromFlash() {}
#endif
// Clear all messages (RAM + persisted queue)
void MessageStore::clearAllMessages()
@@ -392,3 +399,4 @@ void MessageStore::upgradeBootRelativeTimestamps()
// Global definition
MessageStore messageStore("default");
#endif

View File

@@ -1,4 +1,17 @@
#pragma once
#if HAS_SCREEN
// Disable debug logging entirely on release builds
#if !defined(DEBUG)
#define LOG_DEBUG(...)
#endif
// Disable message persistence to flash if youre short on space
#ifndef ENABLE_MESSAGE_PERSISTENCE
#define ENABLE_MESSAGE_PERSISTENCE 1
#endif
#include "mesh/generated/meshtastic/mesh.pb.h"
#include <cstdint>
#include <deque>
@@ -101,3 +114,5 @@ class MessageStore
// Global instance (defined in MessageStore.cpp)
extern MessageStore messageStore;
#endif

View File

@@ -758,9 +758,9 @@ void Power::shutdown()
playShutdownMelody();
#endif
nodeDB->saveToDisk();
// === Save live messages before powering off ===
#if HAS_SCREEN
messageStore.saveToFlash();
#endif
#if defined(ARCH_NRF52) || defined(ARCH_ESP32) || defined(ARCH_RP2040)
#ifdef PIN_LED1
ledOff(PIN_LED1);

View File

@@ -1,5 +1,6 @@
#pragma once
#include "MessageStore.h" // for StoredMessage
#if HAS_SCREEN
#include "OLEDDisplay.h"
#include "OLEDDisplayUi.h"
#include "graphics/emotes.h"
@@ -60,3 +61,4 @@ void handleNewMessage(const StoredMessage &sm, const meshtastic_MeshPacket &pack
} // namespace MessageRenderer
} // namespace graphics
#endif

View File

@@ -1,6 +1,6 @@
#include "configuration.h"
#if HAS_SCREEN
#if HAS_SCREEN
#include "DisplayFormatters.h"
#include "NodeDB.h"
#include "NotificationRenderer.h"

View File

@@ -1,12 +1,14 @@
#include "SystemCommandsModule.h"
#include "meshUtils.h"
#if HAS_SCREEN
#include "MessageStore.h"
#include "graphics/Screen.h"
#include "graphics/SharedUIDisplay.h"
#endif
#include "GPS.h"
#include "MeshService.h"
#include "MessageStore.h"
#include "Module.h"
#include "NodeDB.h"
#include "main.h"
@@ -78,7 +80,9 @@ int SystemCommandsModule::handleInputEvent(const InputEvent *event)
case INPUT_BROKER_MSG_REBOOT:
IF_SCREEN(screen->showSimpleBanner("Rebooting...", 0));
nodeDB->saveToDisk();
#if HAS_SCREEN
messageStore.saveToFlash();
#endif
rebootAtMsec = millis() + DEFAULT_REBOOT_SECONDS * 1000;
// runState = CANNED_MESSAGE_RUN_STATE_INACTIVE;
return true;

View File

@@ -7,7 +7,6 @@
#include "configuration.h"
#include "graphics/Screen.h"
#include "graphics/draw/MessageRenderer.h"
TextMessageModule *textMessageModule;
ProcessMessage TextMessageModule::handleReceived(const meshtastic_MeshPacket &mp)
@@ -20,10 +19,10 @@ ProcessMessage TextMessageModule::handleReceived(const meshtastic_MeshPacket &mp
// We only store/display messages destined for us.
devicestate.rx_text_message = mp;
devicestate.has_rx_text_message = true;
#if HAS_SCREEN
// Store in the central message history
const StoredMessage &sm = messageStore.addFromPacket(mp);
#if HAS_SCREEN
// Pass message to renderer (banner + thread switching + scroll reset)
graphics::MessageRenderer::handleNewMessage(sm, mp);
#endif

View File

@@ -47,6 +47,7 @@ build_flags = ${heltec_mesh_solar_base.build_flags}
-DEINK_LIMIT_RATE_RESPONSIVE_SEC=1 ; Minimum interval between RESPONSIVE updates
-DEINK_BACKGROUND_USES_FAST ; (Optional) Use FAST refresh for both BACKGROUND and RESPONSIVE, until a limit is reached.
-DEINK_HASQUIRK_GHOSTING ; Display model is identified as "prone to ghosting"
-DENABLE_MESSAGE_PERSISTENCE=0 ; isable flash persistence for space-limited build
lib_deps =
${heltec_mesh_solar_base.lib_deps}
https://github.com/meshtastic/GxEPD2/archive/a05c11c02862624266b61599b0d6ba93e33c6f24.zip