Skip to content

Commit dea0339

Browse files
committed
add MHZ19X_error_t::none to indicate that measurement values have not yet been retrieved
1 parent 631f20b commit dea0339

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

examples/demo/I2C/MHZ19XI2C-SLV/src/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ uint16_t latestCO2ppm = 0;
1717
volatile uint8_t getCO2ConcentrationIntervalInSeconds = 5;
1818

1919
// MHZ19XI2C_register_t::error_code
20-
MHZ19X_error_t getCO2ConcentrationResult = MHZ19X_error_t::success;
20+
auto getCO2ConcentrationResult = MHZ19X_error_t::none;
2121

2222
// If errors on measurement reading occur consecutively beyond the following count,
2323
// a software reset using watchdog will be triggered as there could be

src/MHZ19X_error_t.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
#define MHZ19X_error_t_hpp
66

77
enum class MHZ19X_error_t {
8+
// Represents a value that is neither success nor failure.
9+
none = -1,
810
success = 0,
911
uart_write_failure,
1012
uart_read_timeout,

0 commit comments

Comments
 (0)