i2ctest: Make example exit properly
authorMichel Pollet <buserror@gmail.com>
Sat, 25 Feb 2012 10:05:59 +0000 (10:05 +0000)
committerMichel Pollet <buserror@gmail.com>
Sat, 25 Feb 2012 10:18:13 +0000 (10:18 +0000)
Demo was trying to exit, but the harness wasn't

Signed-off-by: Michel Pollet <buserror@gmail.com>
examples/board_i2ctest/i2ctest.c

index 9d43932..7cb80d3 100644 (file)
@@ -81,6 +81,9 @@ int main(int argc, char *argv[])
 
        printf( "Demo launching:\n");
 
-       while (1)
-               avr_run(avr);
+       while (1) {
+               int state = avr_run(avr);
+               if ( state == cpu_Done || state == cpu_Crashed)
+                       break;
+       }
 }