mirror of
https://github.com/jomjol/AI-on-the-edge-device.git
synced 2025-12-09 21:17:06 +03:00
* enable PSRAM logging * add extra functions for psram shared memroy handling * CImageBasis objects still should used dynamic memory (eg. rawImage), haw ever tmpImage must be placed inside the shared memory * Place all STBI allocs inside the shared memory * The models are placed in the shared PSRAM reagion and must be allocated through the dedicated functions * . * renaming * fix cast warning * add flag to switch STBI PSRAM usage * improve PSRAM shared handling * reserve shared PSRAM as early as possible * init logging eralier so we can use it in PSRAM shared alloc * move Wifi_LWIP, BSS_SEG and MQTT Outbox into PSRAM to ffree internal memory * Check if model fits into reserved shared memory * Update code/components/jomjol_tfliteclass/CTfLiteClass.cpp * Update code/components/jomjol_helper/psram.cpp * Update code/components/jomjol_helper/psram.cpp * Update code/components/jomjol_flowcontroll/ClassFlowControll.cpp * Update code/components/jomjol_helper/psram.cpp * Update code/components/jomjol_helper/psram.cpp * Update code/components/jomjol_helper/psram.cpp * Update code/components/jomjol_image_proc/CImageBasis.cpp * Update code/components/jomjol_helper/psram.cpp * Update code/components/jomjol_helper/psram.cpp * Update code/components/jomjol_helper/psram.cpp * Update code/components/jomjol_helper/psram.cpp * Update code/components/jomjol_helper/psram.cpp * Update code/components/jomjol_helper/psram.cpp * Update code/components/jomjol_helper/psram.cpp * . * . * . * . * Korrektur Merge Conflict in main.cpp --------- Co-authored-by: CaCO3 <caco@ruinelli.ch> Co-authored-by: jomjol <30766535+jomjol@users.noreply.github.com>
35 lines
1.0 KiB
C++
35 lines
1.0 KiB
C++
#pragma once
|
|
#ifndef PSRAM_h
|
|
#define PSRAM_h
|
|
|
|
#include "esp_heap_caps.h"
|
|
|
|
|
|
bool reserve_psram_shared_region(void);
|
|
|
|
|
|
/* Memory used in Take Image Step */
|
|
void psram_init_shared_memory_for_take_image_step(void);
|
|
void *psram_reserve_shared_stbi_memory(size_t size);
|
|
void *psram_reallocate_shared_stbi_memory(void *ptr, size_t newsize);
|
|
void psram_free_shared_stbi_memory(void *p);
|
|
|
|
|
|
/* Memory used in Aligning Step */
|
|
void *psram_reserve_shared_tmp_image_memory(void);
|
|
void psram_free_shared_temp_image_memory(void);
|
|
|
|
/* Memory used in Digitalization Steps */
|
|
void *psram_get_shared_tensor_arena_memory(void);
|
|
void *psram_get_shared_model_memory(void);
|
|
void psram_free_shared_tensor_arena_and_model_memory(void);
|
|
|
|
/* General */
|
|
void *malloc_psram_heap(std::string name, size_t size, uint32_t caps);
|
|
void *realloc_psram_heap(std::string name, void *ptr, size_t size, uint32_t caps);
|
|
void *calloc_psram_heap(std::string name, size_t n, size_t size, uint32_t caps);
|
|
|
|
void free_psram_heap(std::string name, void *ptr);
|
|
|
|
#endif // PSRAM_h
|