Stack overflow issue for Monitor task fix
This commit is contained in:
parent
fc23e9797e
commit
6d245aa1ac
@ -91,7 +91,7 @@ void setup()
|
|||||||
Serial.println("Initiating tasks...");
|
Serial.println("Initiating tasks...");
|
||||||
char *name = (char*) malloc(32);
|
char *name = (char*) malloc(32);
|
||||||
sprintf(name, "(%s)", "Monitor");
|
sprintf(name, "(%s)", "Monitor");
|
||||||
BaseType_t res1 = xTaskCreatePinnedToCore(runMonitor, "Monitor", 5000, (void*)name, 4, NULL,1);
|
BaseType_t res1 = xTaskCreatePinnedToCore(runMonitor, "Monitor", 10000, (void*)name, 4, NULL,1);
|
||||||
|
|
||||||
/******** CREATE STRATUM TASK *****/
|
/******** CREATE STRATUM TASK *****/
|
||||||
sprintf(name, "(%s)", "Stratum");
|
sprintf(name, "(%s)", "Stratum");
|
||||||
|
@ -405,6 +405,11 @@ void runMonitor(void *name)
|
|||||||
mMiner.newJob ? "true" : "false", mMiner.inRun ? "true" : "false",
|
mMiner.newJob ? "true" : "false", mMiner.inRun ? "true" : "false",
|
||||||
client.connected() ? "true" : "false", isMinerSuscribed ? "true" : "false", WiFi.status() == WL_CONNECTED ? "true" : "false");
|
client.connected() ? "true" : "false", isMinerSuscribed ? "true" : "false", WiFi.status() == WL_CONNECTED ? "true" : "false");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef DEBUG_MEMORY
|
||||||
|
Serial.printf("### [Total Heap / Free heap]: %d / %d \n", ESP.getHeapSize(), ESP.getFreeHeap());
|
||||||
|
Serial.printf("### Max stack usage: %d\n", uxTaskGetStackHighWaterMark(NULL));
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
animateCurrentScreen(frame);
|
animateCurrentScreen(frame);
|
||||||
doLedStuff(frame);
|
doLedStuff(frame);
|
||||||
|
@ -55,7 +55,7 @@ void updateGlobalData(void){
|
|||||||
http.begin(getGlobalHash);
|
http.begin(getGlobalHash);
|
||||||
int httpCode = http.GET();
|
int httpCode = http.GET();
|
||||||
|
|
||||||
if (httpCode > 0) {
|
if (httpCode == HTTP_CODE_OK) {
|
||||||
String payload = http.getString();
|
String payload = http.getString();
|
||||||
|
|
||||||
DynamicJsonDocument doc(1024);
|
DynamicJsonDocument doc(1024);
|
||||||
@ -75,33 +75,12 @@ void updateGlobalData(void){
|
|||||||
}
|
}
|
||||||
http.end();
|
http.end();
|
||||||
|
|
||||||
|
|
||||||
//OLD code gets remaining blocks to next difficulty ajustment
|
|
||||||
/*//Make second API call to get remaining Blocks
|
|
||||||
http.begin(getDifficulty);
|
|
||||||
httpCode = http.GET();
|
|
||||||
|
|
||||||
if (httpCode > 0) {
|
|
||||||
String payload = http.getString();
|
|
||||||
|
|
||||||
DynamicJsonDocument doc(1024);
|
|
||||||
deserializeJson(doc, payload);
|
|
||||||
String temp = "";
|
|
||||||
if (doc.containsKey("progressPercent")) gData.progressPercent = doc["progressPercent"].as<float>();
|
|
||||||
if (doc.containsKey("remainingBlocks")) gData.remainingBlocks = doc["remainingBlocks"].as<int>();
|
|
||||||
|
|
||||||
doc.clear();
|
|
||||||
|
|
||||||
mGlobalUpdate = millis();
|
|
||||||
}
|
|
||||||
|
|
||||||
http.end();*/
|
|
||||||
|
|
||||||
//Make third API call to get fees
|
//Make third API call to get fees
|
||||||
http.begin(getFees);
|
http.begin(getFees);
|
||||||
httpCode = http.GET();
|
httpCode = http.GET();
|
||||||
|
|
||||||
if (httpCode > 0) {
|
if (httpCode == HTTP_CODE_OK) {
|
||||||
String payload = http.getString();
|
String payload = http.getString();
|
||||||
|
|
||||||
DynamicJsonDocument doc(1024);
|
DynamicJsonDocument doc(1024);
|
||||||
@ -131,7 +110,7 @@ String getBlockHeight(void){
|
|||||||
http.begin(getHeightAPI);
|
http.begin(getHeightAPI);
|
||||||
int httpCode = http.GET();
|
int httpCode = http.GET();
|
||||||
|
|
||||||
if (httpCode > 0) {
|
if (httpCode == HTTP_CODE_OK) {
|
||||||
String payload = http.getString();
|
String payload = http.getString();
|
||||||
payload.trim();
|
payload.trim();
|
||||||
|
|
||||||
@ -159,7 +138,7 @@ String getBTCprice(void){
|
|||||||
http.begin(getBTCAPI);
|
http.begin(getBTCAPI);
|
||||||
int httpCode = http.GET();
|
int httpCode = http.GET();
|
||||||
|
|
||||||
if (httpCode > 0) {
|
if (httpCode == HTTP_CODE_OK) {
|
||||||
String payload = http.getString();
|
String payload = http.getString();
|
||||||
|
|
||||||
DynamicJsonDocument doc(1024);
|
DynamicJsonDocument doc(1024);
|
||||||
|
Loading…
Reference in New Issue
Block a user