diff --git a/ARM/Nordic/nRF52/EHAL/src/i2c_nrf52.cpp b/ARM/Nordic/nRF52/EHAL/src/i2c_nrf52.cpp index 0b51878a..9ba1d28c 100755 --- a/ARM/Nordic/nRF52/EHAL/src/i2c_nrf52.cpp +++ b/ARM/Nordic/nRF52/EHAL/src/i2c_nrf52.cpp @@ -261,6 +261,12 @@ int nRF52I2CTxData(SERINTRFDEV *pDev, uint8_t *pData, int DataLen) if (nRF52I2CWaitTxComplete(dev, 100000) == false) break; + int rtry = 1000; + + do { + l = dev->pReg->TXD.AMOUNT; + } while (l <= 0 && rtry-- > 0); + DataLen -= l; pData += l; cnt += l;