You've already forked MicroPythonOS
mirror of
https://github.com/m5stack/MicroPythonOS.git
synced 2026-05-20 11:51:27 -07:00
fix quirc_decode on unix builds
This commit is contained in:
@@ -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,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"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user