[riot-notifications] [RIOT-OS/RIOT] sys/arduino: Added SPI interface (#12118)

Kees Bakker notifications at github.com
Sat Sep 7 22:14:23 CEST 2019


keestux commented on this pull request.



> +                             settings.mode, settings.clock);
+    /* No support for exceptions (at least on AVR), resort to assert() */
+    assert(retval == SPI_OK);
+}
+
+void SPIClass::endTransaction()
+{
+    spi_release(spi_dev);
+}
+
+void SPIClass::transfer(void *buf, size_t count)
+{
+    spi_transfer_bytes(spi_dev, SPI_CS_UNDEF, false, buf, buf, count);
+}
+
+#if defined(SPI_NUMOF) && (SPI_NUMOF >= 1)

Using `SPI_NUMOF` in a preproc expression gives a compilation error for me because it is defined as:
```
#define SPI_NUMOF           ARRAY_SIZE(spi_config)
```
and `ARRAY_SIZE` is defined in`kernel_defines` as
```
#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0]))
```
If I remember well you can't use `sizeof` in preproc expressions.

-- 
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/12118#pullrequestreview-285186357
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190907/e90c079f/attachment-0001.htm>


More information about the notifications mailing list