mirror of
https://github.com/letscontrolit/ESPEasy.git
synced 2026-10-26 22:10:45 +00:00
[P056] Fix ReadAverage() output params passed by value, always returning 0
Regression from #5369: P056_data_struct::ReadAverage() took float pm25/pm10 by value, so the averaged values never reached the caller and the task values stayed 0. Pass them by reference like CjkSDS011::ReadAverage().
This commit is contained in:
1 parent
7f5f5d4f35
commit
31ba12eeae
2 files changed
+3
-3
No files matched your search
@@ -49,7 +49,7 @@ float P056_data_struct::GetPM10_() {
|
||||
}
|
||||
}
|
||||
|
||||
bool P056_data_struct::ReadAverage(float pm25, float pm10) {
|
||||
bool P056_data_struct::ReadAverage(float& pm25, float& pm10) {
|
||||
if (isInitialized()) {
|
||||
return this->SDS->ReadAverage(pm25, pm10);
|
||||
} else {
|
||||
|
||||
@@ -17,8 +17,8 @@ struct P056_data_struct : public PluginTaskData_base {
|
||||
bool available();
|
||||
float GetPM2_5();
|
||||
float GetPM10_();
|
||||
bool ReadAverage(float pm25,
|
||||
float pm10);
|
||||
bool ReadAverage(float& pm25,
|
||||
float& pm10);
|
||||
void SetWorkingPeriod(int minutes);
|
||||
|
||||
private:
|
||||
|
||||
Reference in new issue
Block a user