add debuginfo for json memory allocation
This commit is contained in:
@@ -27,11 +27,24 @@
|
||||
|
||||
// arduinoJson allocator for external PSRAM
|
||||
// see: https://arduinojson.org/v6/how-to/use-external-ram-on-esp32/
|
||||
struct SpiRamAllocator {
|
||||
void* allocate( size_t size ) { return ps_calloc( size, 1 ); }
|
||||
void deallocate( void* pointer ) { free( pointer ); }
|
||||
struct UpdateSpiRamAllocator {
|
||||
void* allocate( size_t size ) {
|
||||
void *psram = ps_calloc( size, 1 );
|
||||
if ( psram ) {
|
||||
log_i("allocate %dbytes(%p) json psram", size, psram );
|
||||
return( psram );
|
||||
}
|
||||
else {
|
||||
log_e("allocate %dbytes(%p) json psram failed", size, psram );
|
||||
while(1);
|
||||
}
|
||||
}
|
||||
void deallocate( void* pointer ) {
|
||||
log_i("deallocate (%p) json psram", pointer );
|
||||
free( pointer );
|
||||
}
|
||||
};
|
||||
using SpiRamJsonDocument = BasicJsonDocument<SpiRamAllocator>;
|
||||
using SpiRamJsonDocument = BasicJsonDocument<UpdateSpiRamAllocator>;
|
||||
|
||||
uint64_t update_check_new_version( void ) {
|
||||
char url[512]="";
|
||||
|
||||
Reference in New Issue
Block a user