mirror of https://github.com/arendst/Tasmota.git
fix for wrong stupid logic
This commit is contained in:
parent
0930f4679c
commit
6b8fc2d550
|
@ -53,7 +53,7 @@ uint8_t Sr04TModeDetect(void)
|
||||||
if (sonar_serial->begin(9600)) {
|
if (sonar_serial->begin(9600)) {
|
||||||
DEBUG_SENSOR_LOG(PSTR("SR4: Detect mode"));
|
DEBUG_SENSOR_LOG(PSTR("SR4: Detect mode"));
|
||||||
|
|
||||||
if (! PinUsed(GPIO_SR04_TRIG)) {
|
if (PinUsed(GPIO_SR04_TRIG)) {
|
||||||
sr04_type = (Sr04TMiddleValue(Sr04TMode3Distance(), Sr04TMode3Distance(), Sr04TMode3Distance()) != NO_ECHO) ? 3 : 1;
|
sr04_type = (Sr04TMiddleValue(Sr04TMode3Distance(), Sr04TMode3Distance(), Sr04TMode3Distance()) != NO_ECHO) ? 3 : 1;
|
||||||
} else {
|
} else {
|
||||||
sr04_type = 2;
|
sr04_type = 2;
|
||||||
|
|
Loading…
Reference in New Issue