Reducing stack mem footprint

This commit is contained in:
Gunnar Skjold
2022-02-10 10:35:57 +01:00
parent e2fb5e2673
commit 29524c2123
13 changed files with 59 additions and 66 deletions

View File

@@ -352,7 +352,7 @@ IEC6205675::IEC6205675(const char* d, uint8_t useMeterType, uint8_t distribution
if(l2current == 0.0 && l1current > 0.0 && l3current > 0.0) {
l2current = (((activeImportPower - activeExportPower) * sqrt(3)) - (l1voltage * l1current) - (l3voltage * l3current)) / l2voltage;
if(activeExportPower == 0.0) {
l2current = max((double) 0.0, l2current);
l2current = max((float) 0.0, l2current);
}
}
} else if(twoPhase && l1current > 0.0 && l2current > 0.0 && l3current > 0.0) {
@@ -394,6 +394,7 @@ CosemData* IEC6205675::getCosemDataAt(uint8_t index, const char* ptr) {
pos += 2;
}
i++;
if(pos-ptr > 900) break;
} while(item->base.type != HDLC_FLAG);
return NULL;
}
@@ -437,6 +438,7 @@ CosemData* IEC6205675::findObis(uint8_t* obis, int matchlength, const char* ptr)
default:
pos += 2;
}
if(pos-ptr > 900) break;
} while(item->base.type != HDLC_FLAG);
return NULL;
}