[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:
Michael Turner
2026-04-22 10:20:02 -07:00
committed by GitHub
parent dcd103cec0
commit fcbc4d64fe
2 changed files with 6 additions and 2 deletions

View File

@@ -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) {

View File

@@ -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;