File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -1171,6 +1171,19 @@ void Adafruit_SPITFT::dmaWait(void) {
11711171#endif
11721172}
11731173
1174+ /* !
1175+ @brief Check if DMA transfer is active. Always returts false if DMA
1176+ is not enabled.
1177+ @return true if DMA is enabled and transmitting data, false otherwise.
1178+ */
1179+ bool Adafruit_SPITFT::dmaBusy (void ) const {
1180+ #if defined(USE_SPI_DMA) && (defined(__SAMD51__) || defined(ARDUINO_SAMD_ZERO))
1181+ return dma_busy;
1182+ #else
1183+ return false ;
1184+ #endif
1185+ }
1186+
11741187/* !
11751188 @brief Issue a series of pixels, all the same color. Not self-
11761189 contained; should follow startWrite() and setAddrWindow() calls.
Original file line number Diff line number Diff line change @@ -234,6 +234,7 @@ class Adafruit_SPITFT : public Adafruit_GFX {
234234 void dmaWait (void );
235235 // Used by writePixels() in some situations, but might have rare need in
236236 // user code, so it's public...
237+ bool dmaBusy (void ) const ; // true if DMA is used and busy, false otherwise
237238 void swapBytes (uint16_t *src, uint32_t len, uint16_t *dest = NULL );
238239
239240 // These functions are similar to the 'write' functions above, but with
You can’t perform that action at this time.
0 commit comments