File tree Expand file tree Collapse file tree 2 files changed +22
-6
lines changed
Expand file tree Collapse file tree 2 files changed +22
-6
lines changed Original file line number Diff line number Diff line change @@ -46,17 +46,27 @@ typedef uint16_t quirc_pixel_t;
4646#error "QUIRC_MAX_REGIONS > 65534 is not supported"
4747#endif
4848
49+ #ifdef __xtensa__
4950#include <esp_heap_caps.h>
50- static inline void * ps_malloc (const size_t size )
51- {
51+ static inline void * ps_malloc (const size_t size ) {
5252 return heap_caps_malloc_prefer (size , MALLOC_CAP_DEFAULT | MALLOC_CAP_SPIRAM , MALLOC_CAP_DEFAULT );
53- //return malloc(size);
5453}
55- static inline void * d_malloc ( const size_t size )
56- {
54+ /*
55+ static inline void* d_malloc(const size_t size) {
5756 return heap_caps_malloc(size, MALLOC_CAP_DEFAULT | MALLOC_CAP_INTERNAL);
58- //return malloc(size);
5957}
58+ */
59+ #else // __xtensa__
60+ static inline void * ps_malloc (const size_t size ) {
61+ return malloc (size );
62+ }
63+ /*
64+ static inline void* d_malloc(const size_t size) {
65+ return malloc(size);
66+ }
67+ */
68+ #endif // __xtensa__
69+
6070
6171
6272#ifdef QUIRC_FLOAT_TYPE
Original file line number Diff line number Diff line change 66#include "py/runtime.h"
77#include "py/mperrno.h"
88
9+ #ifdef __xtensa__
910#include "freertos/FreeRTOS.h" // For uxTaskGetStackHighWaterMark
1011#include "freertos/task.h" // For task-related functions
12+ #else
13+ size_t uxTaskGetStackHighWaterMark (void * unused ) {
14+ return 99999999 ;
15+ }
16+ #endif // __xtensa__
1117
1218#include "../quirc/lib/quirc.h"
1319
You can’t perform that action at this time.
0 commit comments