[one_wire] Reset bus before SKIP ROM command (#14669)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
This commit is contained in:
2 files changed
+6
-2
No files matched your search
@@ -57,8 +57,11 @@ void OneWireBus::search() {
|
||||
}
|
||||
}
|
||||
|
||||
void OneWireBus::skip() {
|
||||
bool OneWireBus::skip() {
|
||||
if (!this->reset_())
|
||||
return false;
|
||||
this->write8(0xCC); // skip ROM
|
||||
return true;
|
||||
}
|
||||
|
||||
const LogString *OneWireBus::get_model_str(uint8_t model) {
|
||||
|
||||
@@ -16,7 +16,8 @@ class OneWireBus {
|
||||
virtual void write64(uint64_t val) = 0;
|
||||
|
||||
/// Write a command to the bus that addresses all devices by skipping the ROM.
|
||||
void skip();
|
||||
/// Returns true if a device presence pulse is detected.
|
||||
bool skip();
|
||||
|
||||
/// Read an 8 bit word from the bus.
|
||||
virtual uint8_t read8() = 0;
|
||||
|
||||
Reference in new issue
Block a user