From 643c057af9988d29773c4768aee6ed56597aa47e Mon Sep 17 00:00:00 2001 From: oclyke Date: Tue, 26 May 2020 09:18:52 -0600 Subject: [PATCH] remove unnecessary I2C buffer clears --- src/SparkFun_SHTC3.cpp | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/SparkFun_SHTC3.cpp b/src/SparkFun_SHTC3.cpp index 9030aca..b49bebb 100644 --- a/src/SparkFun_SHTC3.cpp +++ b/src/SparkFun_SHTC3.cpp @@ -169,11 +169,6 @@ SHTC3_Status_TypeDef SHTC3::checkID() return abortUpdate(retval, __FILE__, __LINE__); } - while (_wire->available()) // Clear out the I2C buffer, jic - { - _wire->read(); - } - retval = wake(); if (retval != SHTC3_Status_Nominal) { @@ -316,10 +311,6 @@ SHTC3_Status_TypeDef SHTC3::update() case SHTC3_CMD_CSE_RHF_LPM: case SHTC3_CMD_CSE_TF_NPM: case SHTC3_CMD_CSE_TF_LPM: // Address+read will yield an ACK and then clock stretching will occur - while (_wire->available()) // Clear out the I2C buffer so that we know our data is next - { - _wire->read(); - } numBytesRx = _wire->requestFrom(SHTC3_ADDR_7BIT, numBytesRequest); break;