From 2c28faa6245f78a53c2bf148dffb37ab873749b7 Mon Sep 17 00:00:00 2001 From: Marti Bolivar Date: Tue, 30 Aug 2011 15:15:55 -0400 Subject: fsmc-stress-test.cpp: Halt on error, print "all's well" message less often. --- examples/fsmc-stress-test.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/examples/fsmc-stress-test.cpp b/examples/fsmc-stress-test.cpp index 66d325f..ee40236 100644 --- a/examples/fsmc-stress-test.cpp +++ b/examples/fsmc-stress-test.cpp @@ -113,11 +113,17 @@ void loop() { count++; bool result = test(); ok = ok && result; - if (ok && (millis() - last > 300)) { - snprintf(snprintf_buf, sizeof snprintf_buf, - "everything ok so far, timestamp %d ms", millis()); - SerialUSB.println(snprintf_buf); - last = millis(); + if (!ok) { + SerialUSB.println("Halting due to error."); + throb(); + } else { + uint32 now = millis(); + if (now - last > 500) { + snprintf(snprintf_buf, sizeof snprintf_buf, + "everything ok so far, timestamp %d ms", now); + SerialUSB.println(snprintf_buf); + last = now; + } } } } -- cgit v1.2.3