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

Bas Stottelaar notifications at github.com
Thu Jan 14 00:08:28 CET 2021


@basilfx commented on this pull request.



>  
-        if (i2c_progress[dev] == i2cTransferInProgress && timeout--) {
-            cortexm_sleep_until_event();
-        }
-        else {
-            busy = false;
-        }
+    while (i2c_progress[dev] == i2cTransferInProgress && counter--) {}

A mutex with `xtimer_mutex_lock_timeout` seems to work well. Overhead in size (for STK3200, Cortex M0+) for `examples/default` with `i2c_scan`:

* `xtimer_mutex_lock_timeout` + `pm_block`: 30496 bytes
* `xtimer_mutex_lock_timeout`: 30480 bytes
* this PR: 28816 bytes
* this PR + dummy `xtimer_mutex_lock_timeout`: 30504 bytes
* old code: 28752

`pm_block` is necessary to ensure idle thread doesn't save too much energy ;-)

-- 
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_r556937277
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210113/7abc06de/attachment-0001.htm>


More information about the notifications mailing list