get and getFloat function specific for latest value

Update functions comments
This commit is contained in:
samuelbles07
2024-10-20 20:04:07 +07:00
parent 84884d0c15
commit 43ca0a2c2e
2 changed files with 17 additions and 28 deletions
+2 -11
View File
@@ -198,7 +198,7 @@ bool Measurements::update(MeasurementType type, float val, int ch) {
return true;
}
int Measurements::get(MeasurementType type, bool average, int ch) {
int Measurements::get(MeasurementType type, int ch) {
// Sanity check to validate channel, assert if invalid
validateChannel(ch);
@@ -252,15 +252,10 @@ int Measurements::get(MeasurementType type, bool average, int ch) {
return 0;
}
if (average) {
// TODO: This now is average value, need to update this
return temporary->update.avg;
}
return temporary->listValues.back();
}
float Measurements::getFloat(MeasurementType type, bool average, int ch) {
float Measurements::getFloat(MeasurementType type, int ch) {
// Sanity check to validate channel, assert if invalid
validateChannel(ch);
@@ -292,10 +287,6 @@ float Measurements::getFloat(MeasurementType type, bool average, int ch) {
return 0;
}
if (average) {
return temporary->update.avg;
}
return temporary->listValues.back();
}