diff --git a/Adafruit_TFTLCD.cpp b/Adafruit_TFTLCD.cpp index 37374d9..6e634fe 100644 --- a/Adafruit_TFTLCD.cpp +++ b/Adafruit_TFTLCD.cpp @@ -875,7 +875,11 @@ void Adafruit_TFTLCD::drawPixel(int16_t x, int16_t y, uint16_t color) { // externally by BMP examples. Assumes that setWindowAddr() has // previously been set to define the bounds. Max 255 pixels at // a time (BMP examples read in small chunks due to limited RAM). +#if defined(__SAMD51__) +void Adafruit_TFTLCD::pushColors(uint16_t *data, uint16_t len, boolean first) { +#else void Adafruit_TFTLCD::pushColors(uint16_t *data, uint8_t len, boolean first) { +#endif uint16_t color; uint8_t hi, lo; CS_ACTIVE; diff --git a/Adafruit_TFTLCD.h b/Adafruit_TFTLCD.h index f582efd..8ff3888 100644 --- a/Adafruit_TFTLCD.h +++ b/Adafruit_TFTLCD.h @@ -38,7 +38,11 @@ class Adafruit_TFTLCD : public Adafruit_GFX { void setRotation(uint8_t x); // These methods are public in order for BMP examples to work: void setAddrWindow(int x1, int y1, int x2, int y2); +#if defined(__SAMD51__) + void pushColors(uint16_t *data, uint16_t len, boolean first); +#else void pushColors(uint16_t *data, uint8_t len, boolean first); +#endif void pushColorsDMA(uint32_t totalBytes, uint8_t *buffer, uint16_t bufSize, void (*callback)(uint8_t *dest, uint16_t len)); diff --git a/examples/wobble/wobble/wobble.ino b/examples/wobble/wobble/wobble.ino index 91a7330..fd0f6f5 100644 --- a/examples/wobble/wobble/wobble.ino +++ b/examples/wobble/wobble/wobble.ino @@ -9,6 +9,8 @@ #define LCD_RESET A4 // Alternately just connect to Arduino's reset pin +#define DMA_SELECT A1 // Hi/lo chooses DMA vs non-DMA effect + Adafruit_TFTLCD tft(LCD_CS, LCD_CD, LCD_WR, LCD_RD, LCD_RESET); #define DMALINES 16 @@ -23,6 +25,8 @@ void setup() Serial.begin(9600); while(!Serial); + pinMode(DMA_SELECT, INPUT_PULLUP); + // Initialize pixel buffer with alternating red and white bands, // 32 pixels wide. 0x00F8 is 16-bit red (0xF800) endian-swapped // so bytes can be copied directly to screen. @@ -62,7 +66,7 @@ void setup() int lineNum; int frame = 0; -// pushColorsDMA() callback function -- fills one scanline with +// pushColorsDMA() callback function -- fills DMALINES scanlines with // data from pixels[] array. void myCallback(uint8_t *dest, uint16_t len) { for(int i=0; i 0) {