Guillermo Stedile / RA8875

Dependencies:   GPS

Dependents:   SNOCC_V1 SNOCC_V2

Fork of RA8875 by SNOCC

Files at this revision

API Documentation at this revision

Comitter:
WiredHome
Date:
Thu Jul 24 00:41:37 2014 +0000
Parent:
58:26658a56112a
Child:
60:2dfd574f63bd
Commit message:
Nearly insignificant changes to the test code.

Changed in this revision

GraphicsDisplay.cpp Show annotated file Show diff for this revision Revisions of this file
RA8875.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/GraphicsDisplay.cpp	Sat Jul 05 15:59:55 2014 +0000
+++ b/GraphicsDisplay.cpp	Thu Jul 24 00:41:37 2014 +0000
@@ -455,13 +455,15 @@
     uint8_t * lineBuffer = NULL;
     uint16_t BPP_t;
     uint32_t PixelWidth, PixelHeight;
-    //uint32_t start_data;
     unsigned int    i, offset;
     int padd,j;
+    #ifdef DEBUG
+    uint32_t start_data;
+    #endif
 
     // Now, Read the bitmap info header
     fread(&BMP_Info, 1, sizeof(BMP_Info), Image);
-    //HexDump("BMP_Info", (uint8_t *)&BMP_Info, sizeof(BMP_Info));
+    HexDump("BMP_Info", (uint8_t *)&BMP_Info, sizeof(BMP_Info));
     BPP_t = BMP_Info.biBitCount;
     INFO("biBitCount %04X", BPP_t);
     if (BPP_t != 4 && BPP_t != 8 && BPP_t != 16 && BPP_t != 24) { // Support 4, 8, 16, 24-bits per pixel
@@ -487,11 +489,11 @@
             return(not_enough_ram);
         }
         fread(colorPalette, 1, paletteSize, Image);
-        //HexDump("Color Palette", (uint8_t *)colorPalette, paletteSize);
+        HexDump("Color Palette", (uint8_t *)colorPalette, paletteSize);
     }
 
     int lineBufSize = ((BPP_t * PixelWidth + 7)/8);
-    //INFO("BPP_t %d, PixelWidth %d, lineBufSize %d", BPP_t, PixelWidth, lineBufSize);
+    INFO("BPP_t %d, PixelWidth %d, lineBufSize %d", BPP_t, PixelWidth, lineBufSize);
     lineBuffer = (uint8_t *)malloc(lineBufSize);
     if (lineBuffer == NULL) {
         free(colorPalette);
@@ -528,13 +530,13 @@
     _StartGraphicsStream();
     
     //start_data = BMP_Header.bfOffBits;
-    //HexDump("Raw Data", (uint8_t *)&start_data, 32);
-    //INFO("(%d,%d) (%d,%d), [%d,%d]", x,y, PixelWidth,PixelHeight, lineBufSize, padd);
+    HexDump("Raw Data", (uint8_t *)&start_data, 32);
+    INFO("(%d,%d) (%d,%d), [%d,%d]", x,y, PixelWidth,PixelHeight, lineBufSize, padd);
     for (j = PixelHeight - 1; j >= 0; j--) {                //Lines bottom up
         offset = fileOffset + j * (lineBufSize + padd);     // start of line
         fseek(Image, offset, SEEK_SET);
         fread(lineBuffer, 1, lineBufSize, Image);           // read a line - slow !
-        //INFO("offset: %6X", offset);
+        INFO("offset: %6X", offset);
         for (i = 0; i < PixelWidth; i++) {                  // copy pixel data to TFT
             if (BPP_t == 4) {
                 uint8_t dPix = lineBuffer[i/2];
@@ -589,7 +591,7 @@
 
     fread(&BMP_Header, 1, sizeof(BMP_Header), Image);      // get the BMP Header
     INFO("bfType %04X", BMP_Header.bfType);
-    //HexDump("BMP_Header", (uint8_t *)&BMP_Header, sizeof(BMP_Header));
+    HexDump("BMP_Header", (uint8_t *)&BMP_Header, sizeof(BMP_Header));
     if (BMP_Header.bfType != BF_TYPE) {
         fclose(Image);
         return(not_bmp_format);
--- a/RA8875.cpp	Sat Jul 05 15:59:55 2014 +0000
+++ b/RA8875.cpp	Thu Jul 24 00:41:37 2014 +0000
@@ -1486,13 +1486,19 @@
     display.foreground(Blue);
     display.window(0,0, display.width(), display.height());
     display.cls();
-    display.puts(0,0, "Web Color Test\r\n");
-    display.SetTextFontSize(1,2);
+    display.SetTextFontSize(1,1);
+    display.puts(200,0, "Web Color Test");
+    display.SetTextCursor(0,0);
+    display.puts("  ");
+    for (int i=0; i<16; i++)
+        display.printf("%X", i&0xF);
+    display.puts("\r\n0 ");
     for (int i=0; i<sizeof(WebColors)/sizeof(WebColors[0]); i++) {
         display.background(WebColors[i]);
         display.puts(" ");
-        if (i % 36 == 35)
-            display.puts("\r\n");
+        if (i % 16 == 15 && i < 255) {
+            display.printf("\r\n%X ", ((i+1)/16));
+        }
     }
     display.SetTextFontSize(1,1);
 }
@@ -1784,6 +1790,8 @@
     wait(3);
 
     int r = display.RenderBitmapFile(0,0, "/local/TestPat.bmp");
+    if (!SuppressSlowStuff)
+        pc.printf("  returned %d\r\n", r);
 }