feat(platform): migrate LCD assets to PNG and expand flash partitions
This commit is contained in:
+20
@@ -0,0 +1,20 @@
|
||||
Copyright (c) 2005-2018 Lode Vandevenne
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must not
|
||||
claim that you wrote the original software. If you use this software
|
||||
in a product, an acknowledgment in the product documentation would be
|
||||
appreciated but is not required.
|
||||
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
|
||||
3. This notice may not be removed or altered from any source
|
||||
distribution.
|
||||
+7244
File diff suppressed because it is too large
Load Diff
+2188
File diff suppressed because it is too large
Load Diff
@@ -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);
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
#include <stddef.h>
|
||||
|
||||
#include "lodepng.h"
|
||||
|
||||
extern "C" unsigned lodepng_esp_decode32(unsigned char **out,
|
||||
unsigned *w,
|
||||
unsigned *h,
|
||||
const unsigned char *in,
|
||||
size_t insize)
|
||||
{
|
||||
return lodepng_decode32(out, w, h, in, insize);
|
||||
}
|
||||
|
||||
extern "C" const char *lodepng_esp_error_text(unsigned code)
|
||||
{
|
||||
return lodepng_error_text(code);
|
||||
}
|
||||
Reference in New Issue
Block a user