feat(platform): migrate LCD assets to PNG and expand flash partitions
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "esp_heap_caps.h"
|
||||
#include "soc/soc_caps.h"
|
||||
|
||||
void *lodepng_malloc(size_t size)
|
||||
{
|
||||
#if SOC_SPIRAM_SUPPORTED
|
||||
void *ptr = heap_caps_malloc(size, MALLOC_CAP_SPIRAM | MALLOC_CAP_8BIT);
|
||||
if (ptr != NULL) {
|
||||
return ptr;
|
||||
}
|
||||
#endif
|
||||
return malloc(size);
|
||||
}
|
||||
|
||||
void *lodepng_realloc(void *ptr, size_t new_size)
|
||||
{
|
||||
#if SOC_SPIRAM_SUPPORTED
|
||||
void *new_ptr = heap_caps_realloc(ptr, new_size, MALLOC_CAP_SPIRAM | MALLOC_CAP_8BIT);
|
||||
if (new_ptr != NULL) {
|
||||
return new_ptr;
|
||||
}
|
||||
#endif
|
||||
return realloc(ptr, new_size);
|
||||
}
|
||||
|
||||
void lodepng_free(void *ptr)
|
||||
{
|
||||
free(ptr);
|
||||
}
|
||||
Reference in New Issue
Block a user