[riot-notifications] [RIOT-OS/RIOT] nrf52: Implement EasyDMA-based SPI peripheral implemenation (#14057)

benpicco notifications at github.com
Tue May 12 21:22:15 CEST 2020


@benpicco commented on this pull request.



> +    mutex_unlock(&locks[bus]);
+}
+
+static void _transfer(spi_t bus, const uint8_t *out_buf, uint8_t *in_buf,
+                      uint8_t transfer_len)
+{
+    uint8_t out_len = (out_buf) ? transfer_len : 0;
+    uint8_t in_len = (in_buf) ? transfer_len : 0;
+    const uint8_t *out_mbuf = out_buf;
+
+    /**
+     * Copy the out buffer in case it resides in flash, EasyDMA only works from
+     * RAM
+     */
+    if (out_len && !_in_ram(out_buf)) {
+        memcpy(_mbuf[bus], out_buf, out_len);

`out_len` may be up to 255 but `_mbus[bus]` is only 64 bytes.

-- 
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/14057#pullrequestreview-410351273
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20200512/1c5797b5/attachment.htm>


More information about the notifications mailing list