File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -335,14 +335,16 @@ int pthread_once(pthread_once_t *once_control, void (*init_routine)(void))
335335 return EINVAL ;
336336 }
337337
338- // Check if once_control belongs to internal DRAM for uxPortCompare to succeed
339- if (!esp_ptr_internal (once_control )) {
340- ESP_LOGE (TAG , "%s: once_control should belong to internal DRAM region!" , __FUNCTION__ );
341- return EINVAL ;
342- }
343-
344338 uint32_t res = 1 ;
345- uxPortCompareSet ((uint32_t * ) & once_control -> init_executed , 0 , & res );
339+ #if defined(CONFIG_SPIRAM_SUPPORT )
340+ if (esp_ptr_external_ram (once_control )) {
341+ uxPortCompareSetExtram ((uint32_t * ) & once_control -> init_executed , 0 , & res );
342+ } else {
343+ #endif
344+ uxPortCompareSet ((uint32_t * ) & once_control -> init_executed , 0 , & res );
345+ #if defined(CONFIG_SPIRAM_SUPPORT )
346+ }
347+ #endif
346348 // Check if compare and set was successful
347349 if (res == 0 ) {
348350 ESP_LOGV (TAG , "%s: call init_routine %p" , __FUNCTION__ , once_control );
You can’t perform that action at this time.
0 commit comments