WifWaf / MH-Z19

For Arduino Boards (&ESP32). Additional Examples/Commands., Hardware/Software Serial
GNU Lesser General Public License v3.0
195 stars 39 forks source link

Simplification proposal #40

Closed etodorovich closed 1 year ago

etodorovich commented 3 years ago

In MHZ19.cpp, sections such as:

        #if defined (ESP32) && (MHZ19_ERRORS)
        ESP_LOGE(TAG_MHZ19, "message...");
        #elif MHZ19_ERRORS
        Serial.println("!ERROR: message...");
        #endif 

Could be simplified:

        #if MHZ19_ERRORS
        Serial.println("!ERROR: message...");
        #endif 

Thank you!

WifWaf commented 3 years ago

ESP logging uses ANSI escape codes which can be useful for serial monitor/terminal colours, though I have wondered whether it's clashing with some Serial prints (ESP log always includes CR LF, Serial.print does not)

I don't think this qualifies as an issue as such, as it does not affect performance, but feel free to submit a pull request for future versions.

If you're looking through the code, you might also want to check out the test branch PR_.2.0.0 which is more recent, including an overhaul to reduce memory usage.

Cheers!

etodorovich commented 3 years ago

Thank you very much. If it is possible to collaborate, count on me. We are using Version: 1.5.3. I will test the new versions of the library as soon as posible.

WifWaf commented 1 year ago

Closing for now as I seem to have dropped the ball on this one? Feel free to re-open.