@@ -356,25 +356,25 @@ void system_show_malloc(void)
356
356
void * IRAM_ATTR pvPortMalloc (size_t size, const char * file, int line)
357
357
{
358
358
HeapSelectDram ephemeral;
359
- return heap_pvPortMalloc (size, file, line);;
359
+ return heap_pvPortMalloc (size, file, line);;
360
360
}
361
361
362
362
void * IRAM_ATTR pvPortCalloc (size_t count, size_t size, const char * file, int line)
363
363
{
364
364
HeapSelectDram ephemeral;
365
- return heap_pvPortCalloc (count, size, file, line);
365
+ return heap_pvPortCalloc (count, size, file, line);
366
366
}
367
367
368
368
void * IRAM_ATTR pvPortRealloc (void *ptr, size_t size, const char * file, int line)
369
369
{
370
370
HeapSelectDram ephemeral;
371
- return heap_pvPortRealloc (ptr, size, file, line);
371
+ return heap_pvPortRealloc (ptr, size, file, line);
372
372
}
373
373
374
374
void * IRAM_ATTR pvPortZalloc (size_t size, const char * file, int line)
375
375
{
376
376
HeapSelectDram ephemeral;
377
- return heap_pvPortZalloc (size, file, line);
377
+ return heap_pvPortZalloc (size, file, line);
378
378
}
379
379
380
380
void IRAM_ATTR vPortFree (void *ptr, const char * file, int line)
@@ -384,7 +384,44 @@ void IRAM_ATTR vPortFree(void *ptr, const char* file, int line)
384
384
// correct context. umm_malloc free internally determines the correct heap.
385
385
HeapSelectDram ephemeral;
386
386
#endif
387
- return heap_vPortFree (ptr, file, line);
387
+ return heap_vPortFree (ptr, file, line);
388
+ }
389
+
390
+ // //////////////////////////////////////////////////////////////////////////////
391
+ /*
392
+ New for NON-OS SDK 3.0.0 and up
393
+ Needed for WPA2 Enterprise support. This was not present in SDK pre 3.0
394
+
395
+ The NON-OS SDK 3.0.x has breaking changes to pvPortMalloc. They added one more
396
+ argument for selecting a heap. To avoid breaking the build, I renamed their
397
+ broken version pvEsprMalloc. To be used, the LIBS need to be edited.
398
+
399
+ They also added pvPortZallocIram and pvPortCallocIram, which are not a
400
+ problem.
401
+
402
+ WPA2 Enterprise connect crashing is fixed at v3.0.2 and up.
403
+ */
404
+ void * IRAM_ATTR pvEsprMalloc (size_t size, const char * file, int line, bool iram)
405
+ {
406
+ if (iram) {
407
+ HeapSelectIram ephemeral;
408
+ return heap_pvPortMalloc (size, file, line);;
409
+ } else {
410
+ HeapSelectDram ephemeral;
411
+ return heap_pvPortMalloc (size, file, line);;
412
+ }
413
+ }
414
+
415
+ void * IRAM_ATTR pvPortCallocIram (size_t count, size_t size, const char * file, int line)
416
+ {
417
+ HeapSelectIram ephemeral;
418
+ return heap_pvPortCalloc (count, size, file, line);
419
+ }
420
+
421
+ void * IRAM_ATTR pvPortZallocIram (size_t size, const char * file, int line)
422
+ {
423
+ HeapSelectIram ephemeral;
424
+ return heap_pvPortZalloc (size, file, line);
388
425
}
389
426
390
427
};
0 commit comments