Merge pull request #386 from homeodor/master

Add bool dmaBusy()
This commit is contained in:
Paint Your Dragon 2022-04-27 10:22:32 -07:00 committed by GitHub
commit 7bb0d18fd2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 0 deletions

View File

@ -1171,6 +1171,19 @@ void Adafruit_SPITFT::dmaWait(void) {
#endif
}
/*!
@brief Check if DMA transfer is active. Always returts false if DMA
is not enabled.
@return true if DMA is enabled and transmitting data, false otherwise.
*/
bool Adafruit_SPITFT::dmaBusy(void) const {
#if defined(USE_SPI_DMA) && (defined(__SAMD51__) || defined(ARDUINO_SAMD_ZERO))
return dma_busy;
#else
return false;
#endif
}
/*!
@brief Issue a series of pixels, all the same color. Not self-
contained; should follow startWrite() and setAddrWindow() calls.

View File

@ -234,6 +234,7 @@ public:
void dmaWait(void);
// Used by writePixels() in some situations, but might have rare need in
// user code, so it's public...
bool dmaBusy(void) const; // true if DMA is used and busy, false otherwise
void swapBytes(uint16_t *src, uint32_t len, uint16_t *dest = NULL);
// These functions are similar to the 'write' functions above, but with