Explorar el Código

Fix spin lock allocation in PSRAM bug

dongyou hace 5 años
padre
commit
d95e91b344

+ 1 - 1
components/esp_wifi/esp32/esp_adapter.c

@@ -179,7 +179,7 @@ static void set_isr_wrapper(int32_t n, void *f, void *arg)
 static void * spin_lock_create_wrapper(void)
 static void * spin_lock_create_wrapper(void)
 {
 {
     portMUX_TYPE tmp = portMUX_INITIALIZER_UNLOCKED;
     portMUX_TYPE tmp = portMUX_INITIALIZER_UNLOCKED;
-    void *mux = malloc(sizeof(portMUX_TYPE));
+    void *mux = heap_caps_malloc(sizeof(portMUX_TYPE), MALLOC_CAP_8BIT|MALLOC_CAP_INTERNAL);
 
 
     if (mux) {
     if (mux) {
         memcpy(mux,&tmp,sizeof(portMUX_TYPE));
         memcpy(mux,&tmp,sizeof(portMUX_TYPE));

+ 1 - 1
components/esp_wifi/esp32s2beta/esp_adapter.c

@@ -169,7 +169,7 @@ static void set_isr_wrapper(int32_t n, void *f, void *arg)
 static void * spin_lock_create_wrapper(void)
 static void * spin_lock_create_wrapper(void)
 {
 {
     portMUX_TYPE tmp = portMUX_INITIALIZER_UNLOCKED;
     portMUX_TYPE tmp = portMUX_INITIALIZER_UNLOCKED;
-    void *mux = malloc(sizeof(portMUX_TYPE));
+    void *mux = heap_caps_malloc(sizeof(portMUX_TYPE), MALLOC_CAP_8BIT|MALLOC_CAP_INTERNAL);
 
 
     if (mux) {
     if (mux) {
         memcpy(mux,&tmp,sizeof(portMUX_TYPE));
         memcpy(mux,&tmp,sizeof(portMUX_TYPE));