HeapSelectDram for pvPortMalloc, ...#7790
Merged
earlephilhower merged 9 commits intoesp8266:masterfrom Jan 12, 2021
Merged
Conversation
Collaborator
|
lwIP can be updated to only use pvPortMalloc. They also could be changed for lwIPMalloc. Would you like me to make the change ? |
Contributor
Author
|
@d-a-v, Yes, that would be great! |
…S_INLINE_HEAP_SELECT
Collaborator
|
@mhightower83 You may try with #7793 |
Contributor
Author
|
@d-a-v Thanks! I tested with #include <ESP8266WiFi.h>
#include <DNSServer.h>
#include <ESP8266WebServer.h>
#include <umm_malloc/umm_heap_select.h>
const byte DNS_PORT = 53;
IPAddress apIP(172, 217, 28, 1);
DNSServer dnsServer;
ESP8266WebServer webServer(80);
String responseHTML = ""
"<!DOCTYPE html><html lang='en'><head>"
"<meta name='viewport' content='width=device-width'>"
"<title>CaptivePortal</title></head><body>"
"<h1>Hello World!</h1><p>This is a captive portal example."
" All requests will be redirected here.</p></body></html>";
void setup() {
HeapSelectIram x;
WiFi.persistent(false);
WiFi.mode(WIFI_OFF);
Serial.begin(115200);
delay(15);
Serial.println();
Serial.println();
WiFi.mode(WIFI_AP);
// { // This is the WiFi call that leads to HWDT
// HeapSelectIram x;
WiFi.softAPConfig(apIP, apIP, IPAddress(255, 255, 255, 0));
// }
WiFi.softAP("DNSServer CaptivePortal example");
// if DNSServer is started with "*" for domain name, it will reply with
// provided IP to all DNS request
dnsServer.start(DNS_PORT, "*", apIP);
Serial.println("DNSServer CaptivePortal example running");
// replay to all requests with same HTML
webServer.onNotFound([]() {
webServer.send(200, "text/html", responseHTML);
});
webServer.begin();
}
void loop() {
HeapSelectIram x;
dnsServer.processNextRequest();
webServer.handleClient();
} |
Collaborator
|
@d-a-v, is this good to merge? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The goal here is to guarantee that the SDK gets DRAM for the heap requests that are made during SDK API calls. To accomplish this I rely on the SDK to only use the portable heap functions: pvPortMalloc, pvPortCalloc, pvPortRealloc, and pvPortZalloc. I add a thin wrapper to these functions to switch to DRAM.
I am not sure about the lwIP library, it appears to use both malloc and the pvPort... APIs.