@@ -532,8 +532,8 @@ static duk_ret_t el_ledcWrite(duk_context *ctx)
532532
533533static duk_ret_t info (duk_context * ctx )
534534{
535- size_t internal = heap_caps_get_free_size (MALLOC_CAP_INTERNAL );
536- size_t external = heap_caps_get_free_size (MALLOC_CAP_SPIRAM );
535+ size_t internal = heap_caps_get_free_size (MALLOC_CAP_8BIT | MALLOC_CAP_INTERNAL );
536+ size_t external = heap_caps_get_free_size (MALLOC_CAP_8BIT | MALLOC_CAP_SPIRAM );
537537
538538 jslog (INFO , "INTERNAL MEMORY HEAP INFO FREE: %d" , internal );
539539 jslog (INFO , "EXTERNAL MEMORY HEAP INFO FREE: %d" , external );
@@ -631,7 +631,7 @@ IRAM_ATTR void *duk_spiram_malloc(void *udata, size_t size)
631631{
632632 if (spiramAvailable )
633633 {
634- return heap_caps_malloc (size , MALLOC_CAP_SPIRAM );
634+ return heap_caps_malloc (size , MALLOC_CAP_8BIT | MALLOC_CAP_SPIRAM );
635635 }
636636 else
637637 {
@@ -647,7 +647,7 @@ IRAM_ATTR void *duk_spiram_realloc(void *udata, void *ptr, size_t size)
647647{
648648 if (spiramAvailable )
649649 {
650- return heap_caps_realloc (ptr , size , MALLOC_CAP_SPIRAM );
650+ return heap_caps_realloc (ptr , size , MALLOC_CAP_8BIT | MALLOC_CAP_SPIRAM );
651651 }
652652 else
653653 {
@@ -677,7 +677,7 @@ IRAM_ATTR void spiram_free(void *ptr)
677677
678678bool spiramAvail ()
679679{
680- void * ptr = heap_caps_malloc (1 , MALLOC_CAP_SPIRAM );
680+ void * ptr = heap_caps_malloc (1 , MALLOC_CAP_8BIT | MALLOC_CAP_SPIRAM );
681681 if (ptr != NULL )
682682 {
683683 heap_caps_free (ptr );
0 commit comments