Liangzhen Lai / Mbed 2 deprecated DDRO_software

Dependencies:   mbed

Revision:
7:b98d752b7b95
Parent:
4:fc56fa8aa794
diff -r a27c0fd4f210 -r b98d752b7b95 JTAG.cpp
--- a/JTAG.cpp	Tue Oct 02 01:16:03 2012 +0000
+++ b/JTAG.cpp	Tue Oct 02 23:53:32 2012 +0000
@@ -306,54 +306,37 @@
 
 bool JTAG::JTAG_test(void)
 {
+
+    //for FFT test
     unsigned int address = 0x44000008;
     unsigned int value = 0x00000001;
     JTAG_RESET = 0;
     wait_us(100);
     JTAG_RESET = 1;
     wait_us(100);
+
+    //readID();
     DAP_enable();
+
     loadProgram();
 
+    address = 0x44000008;
     value = 0x00000001;
-    address = 0x44000004;
-    for(int i=0; i<10000; i++) {
-        writeMemory(address, value);
-        wait_us(1);
-    }
-    /*
-        //for FFT test
-        unsigned int address = 0x44000008;
-        unsigned int value = 0x00000001;
-        JTAG_RESET = 0;
-        wait_us(100);
-        JTAG_RESET = 1;
-        wait_us(100);
-
-        //readID();
-        DAP_enable();
-
-        loadProgram();
+    writeMemory(address, value);
 
-        address = 0x44000008;
-        value = 0x00000001;
-        writeMemory(address, value);
-
-        address = 0x44000004;
-        writeMemory(address, value);
-        wait(2);
-        bool if_match = true;
-        for(int i=0; i<256; i++) {
-            address = 0x60000100;
-            address += i*0x4;
-            value = readMemory(address);
-            if (expected_result[i]!=value) {
-                if_match = false;
-            }
+    address = 0x44000004;
+    writeMemory(address, value);
+    wait(0.5);
+    bool if_match = true;
+    for(int i=0; i<256; i++) {
+        address = 0x60000100;
+        address += i*0x4;
+        value = readMemory(address);
+        if (expected_result[i]!=value) {
+            if_match = false;
         }
-        //if (if_match) { pc_jtag.printf("FFT match\n"); }
-        return if_match;
-    */
+    }
+    return if_match;
 }
 
 void JTAG::loadProgram()