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

Koen Zandberg notifications at github.com
Wed May 13 10:17:57 CEST 2020


@bergzand 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);

Thanks for spotting this, must originate from the time when I still used `UINT8_MAX` for the `_mbus` sizes. Fixed it in the latest push

-- 
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#discussion_r424256180
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20200513/f5ab3a12/attachment.htm>


More information about the notifications mailing list