fix quirc_decode on unix builds

This commit is contained in:
Thomas Farstrike
2025-05-13 15:53:09 +02:00
parent 462ebbb88d
commit e6ec079a41
2 changed files with 22 additions and 6 deletions
+16 -6
View File
@@ -46,17 +46,27 @@ typedef uint16_t quirc_pixel_t;
#error "QUIRC_MAX_REGIONS > 65534 is not supported"
#endif
#ifdef __xtensa__
#include <esp_heap_caps.h>
static inline void* ps_malloc(const size_t size)
{
static inline void* ps_malloc(const size_t size) {
return heap_caps_malloc_prefer(size, MALLOC_CAP_DEFAULT | MALLOC_CAP_SPIRAM, MALLOC_CAP_DEFAULT);
//return malloc(size);
}
static inline void* d_malloc(const size_t size)
{
/*
static inline void* d_malloc(const size_t size) {
return heap_caps_malloc(size, MALLOC_CAP_DEFAULT | MALLOC_CAP_INTERNAL);
//return malloc(size);
}
*/
#else // __xtensa__
static inline void* ps_malloc(const size_t size) {
return malloc(size);
}
/*
static inline void* d_malloc(const size_t size) {
return malloc(size);
}
*/
#endif // __xtensa__
#ifdef QUIRC_FLOAT_TYPE
+6
View File
@@ -6,8 +6,14 @@
#include "py/runtime.h"
#include "py/mperrno.h"
#ifdef __xtensa__
#include "freertos/FreeRTOS.h" // For uxTaskGetStackHighWaterMark
#include "freertos/task.h" // For task-related functions
#else
size_t uxTaskGetStackHighWaterMark(void * unused) {
return 99999999;
}
#endif // __xtensa__
#include "../quirc/lib/quirc.h"