mirror of
https://github.com/esphome/esphome.git
synced 2024-11-26 08:55:22 +01:00
Onewire (#6967)
* retry scan * setup pin and log retries * fix retries * remove retries --------- Co-authored-by: Samuel Sieb <samuel@sieb.net>
This commit is contained in:
parent
96d63de292
commit
0d3cf5cb78
1 changed files with 4 additions and 0 deletions
|
@ -9,6 +9,10 @@ static const char *const TAG = "gpio.one_wire";
|
||||||
|
|
||||||
void GPIOOneWireBus::setup() {
|
void GPIOOneWireBus::setup() {
|
||||||
ESP_LOGCONFIG(TAG, "Setting up 1-wire bus...");
|
ESP_LOGCONFIG(TAG, "Setting up 1-wire bus...");
|
||||||
|
this->t_pin_->setup();
|
||||||
|
// clear bus with 480µs high, otherwise initial reset in search might fail
|
||||||
|
this->t_pin_->pin_mode(gpio::FLAG_INPUT | gpio::FLAG_PULLUP);
|
||||||
|
delayMicroseconds(480);
|
||||||
this->search();
|
this->search();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue