From 64e025484a4493d99f309bea3eb886c2dba51d75 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Sun, 17 Mar 2024 22:14:07 -0400 Subject: [PATCH] Adjust means of waiting out address. --- Components/I2C/I2C.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Components/I2C/I2C.cpp b/Components/I2C/I2C.cpp index f13e214f0..ef91f944a 100644 --- a/Components/I2C/I2C.cpp +++ b/Components/I2C/I2C.cpp @@ -78,7 +78,7 @@ void Bus::set_clock_data(bool clock_pulled, bool data_pulled) { active_peripheral_ = pair->second; peripheral_response_ = 0; - peripheral_bits_ = 2; + peripheral_bits_ = 1; phase_ = Phase::AwaitingByte; printf("Waiting for byte\n"); } else { @@ -89,11 +89,11 @@ void Bus::set_clock_data(bool clock_pulled, bool data_pulled) { break; case Phase::AwaitingByte: - if(data_ && clock_) { + // Run down the clock on the acknowledge bit. + if(!peripheral_bits_) { printf("Beginning byte\n"); phase_ = Phase::CollectingByte; input_count_ = 0; - input_ = 0; } break;