[riot-notifications] [RIOT-OS/RIOT] cpu/efm32: fix i2c transfers (#15764)

benpicco notifications at github.com
Wed Jan 13 23:29:45 CET 2021


@benpicco commented on this pull request.



> @@ -54,28 +56,21 @@ static mutex_t i2c_lock[I2C_NUMOF];
  */
 static int _transfer(i2c_t dev, I2C_TransferSeq_TypeDef *transfer)
 {
-    bool busy = true;
-    uint32_t timeout = I2C_TIMEOUT;
+    uint32_t counter = EFM32_I2C_TIMEOUT;

Wouldn't we only have to wait for the first successful state transition, then we can block on a mutex until the transfer is done - that would make for a very small timeout that is also independent of transfer length. 

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/15764#discussion_r556911302
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210113/c3c6580d/attachment.htm>


More information about the notifications mailing list