From 765045861130679e864f4ae650788da9aa1a06ee Mon Sep 17 00:00:00 2001 From: Michel Pollet Date: Sat, 25 Feb 2012 10:05:59 +0000 Subject: [PATCH] i2ctest: Make example exit properly Demo was trying to exit, but the harness wasn't Signed-off-by: Michel Pollet --- examples/board_i2ctest/i2ctest.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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; + } } -- 2.20.1