diff --git a/.github/workflows/Compile Examples.yml b/.github/workflows/Compile Examples.yml index c8d80b9..b06b32b 100644 --- a/.github/workflows/Compile Examples.yml +++ b/.github/workflows/Compile Examples.yml @@ -36,7 +36,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Compile examples uses: arduino/compile-sketches@main diff --git a/.github/workflows/check-arduino.yml b/.github/workflows/check-arduino.yml index 3e0d26c..adb330f 100644 --- a/.github/workflows/check-arduino.yml +++ b/.github/workflows/check-arduino.yml @@ -16,7 +16,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Arduino Lint uses: arduino/arduino-lint-action@v1 diff --git a/.github/workflows/spell-check.yml b/.github/workflows/spell-check.yml index 3f6b03f..ef7d894 100644 --- a/.github/workflows/spell-check.yml +++ b/.github/workflows/spell-check.yml @@ -16,7 +16,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Spell check uses: codespell-project/actions-codespell@master diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml index 94938f3..9cde1ac 100644 --- a/.github/workflows/sync-labels.yml +++ b/.github/workflows/sync-labels.yml @@ -27,7 +27,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Download JSON schema for labels configuration file id: download-schema @@ -105,7 +105,7 @@ jobs: echo "::set-output name=flag::--dry-run" - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Download configuration files artifact uses: actions/download-artifact@v3 diff --git a/src/AirQualityClass.cpp b/src/AirQualityClass.cpp index 359f350..8d1c73b 100644 --- a/src/AirQualityClass.cpp +++ b/src/AirQualityClass.cpp @@ -92,6 +92,7 @@ void AirQualityClass::end() float AirQualityClass::readVOC() { + float reading = 0.0; if (_revision == BOARD_REVISION_2) { unsigned int time_Start = millis(); while(millis() - time_Start < BME68X_TIMEOUT) { @@ -101,13 +102,14 @@ float AirQualityClass::readVOC() checkIaqSensorStatus(); } } - float reading = iaqSensor->breathVocEquivalent; - return reading; + reading = iaqSensor->breathVocEquivalent; } + return reading; } float AirQualityClass::readGasResistor() { + float reading = 0.0; if (_revision == BOARD_REVISION_2) { unsigned int time_Start = millis(); while(millis() - time_Start < BME68X_TIMEOUT) { @@ -117,13 +119,14 @@ float AirQualityClass::readGasResistor() checkIaqSensorStatus(); } } - float reading = iaqSensor->gasResistance; - return reading; + reading = iaqSensor->gasResistance; } + return reading; } float AirQualityClass::readIAQ() { + float reading = 0.0; if (_revision == BOARD_REVISION_2) { unsigned int time_Start = millis(); while(millis() - time_Start < BME68X_TIMEOUT) { @@ -133,13 +136,14 @@ float AirQualityClass::readIAQ() checkIaqSensorStatus(); } } - float reading = iaqSensor->iaq; - return reading; + reading = iaqSensor->iaq; } + return reading; } float AirQualityClass::readIAQAccuracy() { + float reading = 0.0; if (_revision == BOARD_REVISION_2) { unsigned int time_Start = millis(); while(millis() - time_Start < BME68X_TIMEOUT) { @@ -149,13 +153,14 @@ float AirQualityClass::readIAQAccuracy() checkIaqSensorStatus(); } } - float reading = iaqSensor->iaqAccuracy; - return reading; + reading = iaqSensor->iaqAccuracy; } + return reading; } float AirQualityClass::readStaticIAQ() { + float reading = 0.0; if (_revision == BOARD_REVISION_2) { unsigned int time_Start = millis(); while(millis() - time_Start < BME68X_TIMEOUT) { @@ -165,14 +170,15 @@ float AirQualityClass::readStaticIAQ() checkIaqSensorStatus(); } } - float reading = iaqSensor->staticIaq; - return reading; + reading = iaqSensor->staticIaq; } + return reading; } float AirQualityClass::readCO2() { + float reading = 0.0; if (_revision == BOARD_REVISION_2) { unsigned int time_Start = millis(); while(millis() - time_Start < BME68X_TIMEOUT) { @@ -182,8 +188,8 @@ float AirQualityClass::readCO2() checkIaqSensorStatus(); } } - float reading = iaqSensor->co2Equivalent; - return reading; + reading = iaqSensor->co2Equivalent; } + return reading; }