Treehouse Mbed Team / Mbed 2 deprecated Nucleo_jtag_controller

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
nolenbrown
Date:
Tue Jul 10 15:11:04 2018 +0000
Parent:
14:f15157e3cbef
Commit message:
Ready for final testing.

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Mon Jul 09 23:21:02 2018 +0000
+++ b/main.cpp	Tue Jul 10 15:11:04 2018 +0000
@@ -75,7 +75,7 @@
 
 
 void goto_STATE_TEST_LOGIC_RESET(void);
-void printTestResult(int, string);
+void printTestResultLED1(int, string);
 
 
 string stateNames[STATE_UPDATE_IR + 1];
@@ -817,8 +817,10 @@
     for (int j = BOUNDARY_SCAN_LENGTH; j < readVector.size(); j++) {
         if (readVector[j] != writeVector[j - BOUNDARY_SCAN_LENGTH]) {
             didTestPass = false;
-            printf("\n\rFailed!  Boundary scan data %0d != %0d", readVector[j], writeVector[j - BOUNDARY_SCAN_LENGTH]);
-            fflush(stdout);
+            if (verbose) {
+                printf("\n\rFailed!  Boundary scan data %0d != %0d", readVector[j], writeVector[j - BOUNDARY_SCAN_LENGTH]);
+                fflush(stdout);
+            }
         }
     }
     
@@ -880,8 +882,10 @@
     for (int j = SCAN_CHAIN_LENGTH; j < readVector.size(); j++) {
         if (readVector[j] != writeVector[j - SCAN_CHAIN_LENGTH]) {
             didTestPass = false;
-            printf("\n\rFailed!  Internal scan data %0d != %0d", readVector[j], writeVector[j - SCAN_CHAIN_LENGTH]);
-            fflush(stdout);
+            if (verbose) {
+                printf("\n\rFailed!  Internal scan data %0d != %0d", readVector[j], writeVector[j - SCAN_CHAIN_LENGTH]);
+                fflush(stdout);
+            }
         }
     }
     
@@ -934,7 +938,11 @@
 
     uint32_t val;
 
+
     toggleLED1(OFF);
+    wait_ms(500);
+    toggleLED1(ON);
+    wait_ms(250);
 
     goto_STATE_RUN_TEST_IDLE();
     resultSAMPLE_PRELOAD = runTestSAMPLE_PRELOAD();
@@ -948,22 +956,22 @@
     goto_STATE_RUN_TEST_IDLE();
     resultBYPASS = runTestBYPASS();
 
-    printTestResult(resultSAMPLE_PRELOAD, "Test SAMPLE_PRELOAD");
-    printTestResult(resultIDCODE,         "Test IDCODE");
-    printTestResult(resultINTSCAN,        "Test INTSCAN");
-    printTestResult(resultBYPASS,         "Test BYPASS");
+    printTestResultLED1(resultSAMPLE_PRELOAD, "Test SAMPLE_PRELOAD");
+    printTestResultLED1(resultIDCODE,         "Test IDCODE");
+    printTestResultLED1(resultINTSCAN,        "Test INTSCAN");
+    printTestResultLED1(resultBYPASS,         "Test BYPASS");
 
     if ((resultEXTEST) && (resultSAMPLE_PRELOAD) && (resultIDCODE) && (resultINTSCAN) && (resultBYPASS)) {
-        printTestResult(PASS, "Overall test result.");
+        printTestResultLED1(PASS, "Overall test result.");
     } else {
-        printTestResult(FAIL, "Overall test result.");
+        printTestResultLED1(FAIL, "Overall test result.");
     }
 }
     
 //------------------------------------------------------------------------------
-//  printTestResult
+//  printTestResultLED1
 //------------------------------------------------------------------------------
-void printTestResult(int result, string description) {
+void printTestResultLED1(int result, string description) {
     if (result) {
         pc.printf("\n\rPASSED!   %s", description);
         toggleLED1(ON);
@@ -974,7 +982,6 @@
         toggleLED1(OFF);
     }
     fflush(stdout);
-    toggleLED1(ON);
 }