drivers: sensor: dht: Fix fetch fail when config hw cycles=32768
When config hw cycles=32768 max_wait_cycles maybe small than 60us. The fix change the condition,make sure the wait time exceeds 80us. Fixed #9816 Signed-off-by: Frank Li <lgl88911@163.com>
This commit is contained in:
parent
d713033d5c
commit
70efac6e90
1 changed files with 1 additions and 1 deletions
|
@ -39,7 +39,7 @@ static s8_t dht_measure_signal_duration(struct dht_data *drv_data,
|
||||||
gpio_pin_read(drv_data->gpio, CONFIG_DHT_GPIO_PIN_NUM, &val);
|
gpio_pin_read(drv_data->gpio, CONFIG_DHT_GPIO_PIN_NUM, &val);
|
||||||
elapsed_cycles = k_cycle_get_32() - start_cycles;
|
elapsed_cycles = k_cycle_get_32() - start_cycles;
|
||||||
|
|
||||||
if (elapsed_cycles >= max_wait_cycles) {
|
if (elapsed_cycles > max_wait_cycles) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
} while (val == signal_val);
|
} while (val == signal_val);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue