aboutsummaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorMarti Bolivar <mbolivar@leaflabs.com>2011-08-30 15:15:55 -0400
committerMarti Bolivar <mbolivar@leaflabs.com>2011-08-30 15:16:58 -0400
commit2c28faa6245f78a53c2bf148dffb37ab873749b7 (patch)
tree6cb49855e872ea39bf592b45321cc16217faf0d7 /examples
parentba561073a7b17840c16866b3e019cc28a281bcd1 (diff)
downloadlibrambutan-2c28faa6245f78a53c2bf148dffb37ab873749b7.tar.gz
librambutan-2c28faa6245f78a53c2bf148dffb37ab873749b7.zip
fsmc-stress-test.cpp: Halt on error, print "all's well" message less often.
Diffstat (limited to 'examples')
-rw-r--r--examples/fsmc-stress-test.cpp16
1 files 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;
+ }
}
}
}