BurstSPI support for improved performance

Fork of RA8875 by David Smart

Revision:
150:db4c4a5438fc
Parent:
149:c62c4b2d6a15
--- a/RA8875.cpp	Sun Aug 06 17:05:54 2017 +0000
+++ b/RA8875.cpp	Sat Sep 09 09:09:57 2017 +0000
@@ -1315,7 +1315,10 @@
     SetGraphicsCursor(x, y);
     _StartGraphicsStream();
     _select(true);
-    _spiwrite(0x00);         // Cmd: write data
+    
+    _setWriteSpeed(true);
+    
+    spi.write(0x00);         // Cmd: write data
     while (h--) {
         uint8_t pixels = w;
         uint8_t bitmask = 0x01;
@@ -1325,10 +1328,10 @@
             //INFO("byte, mask: %02X, %02X", byte, bitmask);
             color_t c = (byte & bitmask) ? _foreground : _background;
                 if (screenbpp == 16) {
-                    _spiwrite(c >> 8);
-                    _spiwrite(c & 0xFF);
+                    spi.fastWrite(c >> 8);
+                    spi.fastWrite(c & 0xFF);
                 } else {
-                    _spiwrite(_cvt16to8(c));
+                    spi.fastWrite(_cvt16to8(c));
                 }
             bitmask <<= 1;
             if (pixels > 1 && bitmask == 0) {
@@ -1339,6 +1342,7 @@
         }
         boolStream++;
     }
+    spi.clearRX();
     _select(false);
     _EndGraphicsStream();
     window(restore);
@@ -1864,9 +1868,9 @@
 {
     unsigned char b;
 
-    if (brightness >= 1.0)
+    if (brightness >= 1.0f)
         b = 255;
-    else if (brightness <= 0.0)
+    else if (brightness <= 0.0f)
         b = 0;
     else
         b = (unsigned char)(brightness * 255);