File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -552,10 +552,19 @@ bool SDI12Sensors::addSingleMeasurementResult(void) {
552
552
while ((millis () - timerStart) < (1000 * (wait))) {
553
553
// sensor can interrupt us to let us know it is done early
554
554
if (_SDI12Internal.available ()) {
555
+ #ifdef MS_SDI12SENSORS_DEBUG_DEEP
556
+ // if we're debugging print out early response
555
557
MS_DEEP_DBG (F (" <<<" ),
556
558
_SDI12Internal.readStringUntil (' \n ' ));
557
559
_SDI12Internal.clearBuffer ();
558
560
break ;
561
+ #else
562
+ // if we're not debugging, just read the response to make
563
+ // sure it's removed from the buffer
564
+ _SDI12Internal.readStringUntil (' \n ' );
565
+ _SDI12Internal.clearBuffer ();
566
+ break ;
567
+ #endif
559
568
}
560
569
}
561
570
// Wait for anything else and clear it out
You can’t perform that action at this time.
0 commit comments