Sonder Design Team / Mbed 2 deprecated BlackBoard_Firmware_Fast_read_not_test

Dependencies:   Memory25L16_fast USBDevice mbed

Fork of BlackBoard_Firmware_MVP by Sonder Design Team

Revision:
13:f7445faded6a
Parent:
12:fbb1dd0586e1
--- a/BB_Basic.cpp	Sat Jul 07 11:45:17 2018 +0000
+++ b/BB_Basic.cpp	Wed Jul 18 03:29:16 2018 +0000
@@ -331,12 +331,12 @@
     pc.printf("\ntestKey function simulate keyboard event, starts in 1 sec(s)\n");
     wait_ms(1000);
     pc.printf("\ntestKey function start! typing...\n");
-    sendKeyXinda(0,80,80,80,80,80,80); // Input Chinese: Francisco is Sonder's mascot
-    wait_ms(10);
+    sendKeyXinda(2,80,80,80,80,80,80); // Open Google Chrome or txt in local
+    wait_ms(1000);
     sendKeyXinda(1,80,80,80,80,80,80); // Ctrl+V according to the Ctrl Center setting
-    wait_ms(10);
-    sendKeyXinda(2,80,80,80,80,80,80); // Open Google Chrome in local
-    wait_ms(10);
+    wait_ms(1000);
+    sendKeyXinda(0,80,80,80,80,80,80); // Input Chinese: Francisco is Sonder's mascot
+    wait_ms(1000);
     sendKeyXinda(0,1,80,80,80,80,80);  // Chinese lyric, <Above the Moon> or korean, depends on the layout(cmd.exe or Google chrome)
     pc.printf("\ntestKey function end!\n");
 }
@@ -426,7 +426,8 @@
     char memoryBuffer [bufferSize];     //Create a memory buffer, to be sent to flash
     int bufferIndex = 0;                //points to the next available possition in memory
     int startAddress = Address;
-    int imageSize = 310200;              //The number of bytes to write,  86272 for 9.8"
+    //int imageSize = 310200;              //The number of bytes to write,  86272 for 9.8"
+    int imageSize = 271600;                 // This image size is for testing the RAIL system
     while (Address<startAddress+imageSize) {
         //waitForData(USBDataBuffer);         //Waits untill data is recieved on usb, puts it in USBDataBuffer
         while(bufferIndex<bufferSize) {
@@ -1141,6 +1142,7 @@
 
     pc.baud(115200);
     int USBDataBuffer[64];
+    short memoryBuffer[256]; //the XT test image size here is problem, the image size too large so the board is out fo memory
     SPI mem_spi = setupSPI();        //Creates an SPI object to comunicate with the external memory
     populateNameList();       //Reads the names  of layouts stored in external memory into RAM
 
@@ -1185,6 +1187,22 @@
                 case 0xF0:
                     testKey();  // If received command is a request of keypress debugging. Xinda Debug version of keyCheck
                     break;
+                case 0xF1:
+                    pc.printf("\nReading\n");
+                    readData(memoryBuffer, USBDataBuffer[2], USBDataBuffer[3],0);//Xinda Fast read test, read(spi, destination[], address, length)
+                    for(int count = 0; count < 64; count++){
+                        int temp[] = {0x31,memoryBuffer[count+1],memoryBuffer[count+2],memoryBuffer[count+3],memoryBuffer[count+4],0,0,0};
+                        sendUSB(temp);
+                    }
+                    break;
+                /*case 0xF2:
+                    for(int i = 0 ; i <200; i++) {
+                        if(i%520==0){
+                            pc.printf("\n");
+                            }
+                        pc.printf(" %i", memoryBuffer[i]);//Send dummy byte to read out value ate Address
+                        }
+                    break;*/
                 default:
                     pc.printf("\nfail! [%x %x %x %x %x %x %x %x]",USBDataBuffer[0],USBDataBuffer[1],USBDataBuffer[2],USBDataBuffer[3],USBDataBuffer[4],USBDataBuffer[5],USBDataBuffer[6],USBDataBuffer[7]);
             }