Commit 8d115c0 1 parent 766477f commit 8d115c0 Copy full SHA for 8d115c0
File tree 1 file changed +6
-3
lines changed
1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -195,7 +195,7 @@ class CSE7766Sensor : public BaseEmonSensor {
195
195
}
196
196
197
197
if ((_data[0 ] & 0xFC ) > 0xF0 ) {
198
- _error = SENSOR_ERROR_OTHER ;
198
+ _error = SENSOR_ERROR_VALUE ;
199
199
#if SENSOR_DEBUG
200
200
if (0xF1 == (_data[0 ] & 0xF1 )) DEBUG_MSG_P (PSTR (" [SENSOR] CSE7766: Abnormal coefficient storage area\n " ));
201
201
if (0xF2 == (_data[0 ] & 0xF2 )) DEBUG_MSG_P (PSTR (" [SENSOR] CSE7766: Power cycle exceeded range\n " ));
@@ -288,9 +288,12 @@ class CSE7766Sensor : public BaseEmonSensor {
288
288
289
289
uint8_t byte = _serial->read ();
290
290
291
- // first byte must be 0x55 or 0xF?
291
+ // first byte is one one of
292
+ // - 0xAA - NOT calibrated
293
+ // - 0x55 - calibrated
294
+ // - 0xF? - abnormal state
292
295
if (0 == _data_index) {
293
- if ((0x55 != byte) && (byte < 0xF0 )) {
296
+ if ((0xAA != byte) && ( 0x55 != byte) && (byte < 0xF0 )) {
294
297
continue ;
295
298
}
296
299
You can’t perform that action at this time.
0 commit comments