Hi all. I'm interested in doing some experiments with DMA SPI on the T3.2. I'm using Arduino 1.85 / Teensyduino 1.40. Looking in SPI.h and SPI.cpp, I see that there is a method that does the job. Its prototype is:
However, due to conditional compilation, it's not available because the macro 'SPI_HAS_TRANSFER_ASYNC' is not defined. Looking in SPI.h, I see:
I do have "EventResponder.h" included in my code, and I think "__has_include" is true, but the required sections are still not being compiled. If I change the above conditional to:
then the sections compile and my DMA-based SPI experiment seems to work as expected.
I'd appreciate any insight in to this.
Thanks.
Code:
bool transfer(const void *txBuffer, void *rxBuffer, size_t count, EventResponderRef event_responder);
Code:
#if defined(__has_include) && __has_include("EventResponder.h")
// SPI_HAS_TRANSFER_ASYNC - Defined to say that the SPI supports an ASYNC version
// of the SPI_HAS_TRANSFER_BUF
#define SPI_HAS_TRANSFER_ASYNC 1
#include <DMAChannel.h>
#include <EventResponder.h>
#endif
Code:
#if 1
// SPI_HAS_TRANSFER_ASYNC - Defined to say that the SPI supports an ASYNC version
// of the SPI_HAS_TRANSFER_BUF
#define SPI_HAS_TRANSFER_ASYNC 1
#include <DMAChannel.h>
#include <EventResponder.h>
#endif
I'd appreciate any insight in to this.
Thanks.