move some vectors to psram, fix syslog start/stop

This commit is contained in:
MichaelDvP
2025-12-04 19:57:01 +01:00
parent dd0ab8f962
commit 1d03056784
28 changed files with 3172 additions and 70 deletions

View File

@@ -16,6 +16,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "../core/telegram.h"
#ifndef EMSESP_STANDALONE
#include <esp32-psram.h>
#endif
#ifndef WebCustomEntityService_h
#define WebCustomEntityService_h
@@ -45,7 +48,11 @@ class CustomEntityItem {
class WebCustomEntity {
public:
#ifndef EMSESP_STANDALONE
std::list<CustomEntityItem, AllocatorPSRAM<CustomEntityItem>> customEntityItems;
#else
std::list<CustomEntityItem> customEntityItems;
#endif
static void read(WebCustomEntity & webEntity, JsonObject root);
static StateUpdateResult update(JsonObject root, WebCustomEntity & webEntity);
@@ -82,8 +89,11 @@ class WebCustomEntityService : public StatefulService<WebCustomEntity> {
void getEntities(AsyncWebServerRequest * request);
#ifndef EMSESP_STANDALONE
std::list<CustomEntityItem, AllocatorPSRAM<CustomEntityItem>> * customEntityItems_; // pointer to the list of entity items
#else
std::list<CustomEntityItem> * customEntityItems_; // pointer to the list of entity items
#endif
bool ha_registered_ = false;
};

View File

@@ -18,6 +18,9 @@
#ifndef WebCustomizationService_h
#define WebCustomizationService_h
#ifndef EMSESP_STANDALONE
#include <esp32-psram.h>
#endif
#define EMSESP_CUSTOMIZATION_FILE "/config/emsespCustomization.json"
@@ -70,11 +73,17 @@ class EntityCustomization {
class WebCustomization {
public:
#ifndef EMSESP_STANDALONE
std::list<SensorCustomization, AllocatorPSRAM<SensorCustomization>> sensorCustomizations; // for sensor names and offsets
std::list<AnalogCustomization, AllocatorPSRAM<AnalogCustomization>> analogCustomizations; // for analog sensors
std::list<EntityCustomization, AllocatorPSRAM<EntityCustomization>> entityCustomizations; // for a list of entities that have a special mask set
#else
std::list<SensorCustomization> sensorCustomizations; // for sensor names and offsets
std::list<AnalogCustomization> analogCustomizations; // for analog sensors
std::list<EntityCustomization> entityCustomizations; // for a list of entities that have a special mask set
static void read(WebCustomization & customizations, JsonObject root);
static StateUpdateResult update(JsonObject root, WebCustomization & customizations);
#endif
static void read(WebCustomization & customizations, JsonObject root);
static StateUpdateResult update(JsonObject root, WebCustomization & customizations);
private:
static bool _start;

View File

@@ -21,6 +21,9 @@
#define EMSESP_EVENT_SOURCE_LOG_PATH "/es/log"
#define EMSESP_LOG_SETTINGS_PATH "/rest/logSettings"
#ifndef EMSESP_STANDALONE
#include <esp32-psram.h>
#endif
using ::uuid::console::Shell;
@@ -65,12 +68,16 @@ class WebLogService : public uuid::log::Handler {
char * messagetime(char * out, const uint64_t t, const size_t bufsize);
size_t maximum_log_messages_ = MAX_LOG_MESSAGES; // Maximum number of log messages to buffer before they are output
size_t limit_log_messages_ = 1; // dynamic limit
unsigned long log_message_id_ = 0; // The next identifier to use for queued log messages
unsigned long log_message_id_tail_ = 0; // last event shown on the screen after fetch
std::deque<QueuedLogMessage> log_messages_; // Queued log messages, in the order they were received
bool compact_ = true;
#ifndef EMSESP_STANDALONE
std::deque<QueuedLogMessage, AllocatorPSRAM<QueuedLogMessage>> log_messages_; // Queued log messages, in the order they were received
#else
std::deque<QueuedLogMessage> log_messages_; // Queued log messages, in the order they were received
#endif
size_t maximum_log_messages_ = MAX_LOG_MESSAGES; // Maximum number of log messages to buffer before they are output
size_t limit_log_messages_ = 1; // dynamic limit
unsigned long log_message_id_ = 0; // The next identifier to use for queued log messages
unsigned long log_message_id_tail_ = 0; // last event shown on the screen after fetch
bool compact_ = true;
};
} // namespace emsesp

View File

@@ -16,6 +16,10 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef EMSESP_STANDALONE
#include <esp32-psram.h>
#endif
#ifndef WebSchedulerService_h
#define WebSchedulerService_h
@@ -63,8 +67,11 @@ class ScheduleItem {
class WebScheduler {
public:
#ifndef EMSESP_STANDALONE
std::list<ScheduleItem, AllocatorPSRAM<ScheduleItem>> scheduleItems;
#else
std::list<ScheduleItem> scheduleItems;
#endif
static void read(WebScheduler & webScheduler, JsonObject root);
static StateUpdateResult update(JsonObject root, WebScheduler & webScheduler);
};
@@ -104,10 +111,15 @@ class WebSchedulerService : public StatefulService<WebScheduler> {
HttpEndpoint<WebScheduler> _httpEndpoint;
FSPersistence<WebScheduler> _fsPersistence;
bool ha_registered_ = false;
std::list<ScheduleItem> * scheduleItems_; // pointer to the list of schedule events
bool ha_registered_ = false;
std::deque<ScheduleItem *> cmd_changed_;
#ifndef EMSESP_STANDALONE
std::list<ScheduleItem, AllocatorPSRAM<ScheduleItem>> * scheduleItems_; // pointer to the list of schedule events
std::list<ScheduleItem *, AllocatorPSRAM<ScheduleItem *>> cmd_changed_; // pointer to commands in list that are triggert by change
#else
std::list<ScheduleItem> * scheduleItems_; // pointer to the list of schedule events
std::list<ScheduleItem *> cmd_changed_; // pointer to commands in list that are triggert by change
#endif
};
} // namespace emsesp