From: Michel Pollet Date: Sat, 25 Feb 2012 10:05:59 +0000 (+0000) Subject: i2ctest: Make example exit properly X-Git-Url: http://git.rot13.org/?a=commitdiff_plain;h=765045861130679e864f4ae650788da9aa1a06ee;p=simavr i2ctest: Make example exit properly Demo was trying to exit, but the harness wasn't Signed-off-by: Michel Pollet --- diff --git a/examples/board_i2ctest/i2ctest.c b/examples/board_i2ctest/i2ctest.c index 9d43932..7cb80d3 100644 --- a/examples/board_i2ctest/i2ctest.c +++ b/examples/board_i2ctest/i2ctest.c @@ -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; + } }