Private
Public Access
2
0

examples: make main loops finite to ensure proper cleanup

Signed-off-by: Alex Tereschenko <alext.mkrs@gmail.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
Alex Tereschenko
2017-06-05 18:22:29 +02:00
committed by Brendan Le Foll
parent 32340f6819
commit c36e4add5a
15 changed files with 112 additions and 28 deletions

View File

@@ -1,5 +1,6 @@
/*
* Author: Brendan Le Foll
* Contributors: Alex Tereschenko <alext.mkrs@gmail.com>
* Copyright (c) 2015 Intel Corporation.
*
* Permission is hereby granted, free of charge, to any person obtaining
@@ -44,7 +45,8 @@ main()
x->isr(mraa::EDGE_BOTH, &interrupt, NULL);
for (;;) {
int i = 100;
for (; i > 0; --i) {
if (counter != oldcounter) {
fprintf(stdout, "timeout counter == %d\n", counter);
oldcounter = counter;
@@ -54,5 +56,5 @@ main()
}
delete x;
return EXIT_SUCCESS;
return MRAA_SUCCESS;
}