From ad08af59f0fcbfda9daf8527c6bd951319328513 Mon Sep 17 00:00:00 2001 From: fros4943 Date: Thu, 5 Oct 2006 07:46:53 +0000 Subject: [PATCH] bug fix: busy-waiting before checking data length --- platform/cooja/dev/radio-arch.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/platform/cooja/dev/radio-arch.c b/platform/cooja/dev/radio-arch.c index 1e45b05e0..723665b34 100644 --- a/platform/cooja/dev/radio-arch.c +++ b/platform/cooja/dev/radio-arch.c @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: radio-arch.c,v 1.2 2006/10/02 15:06:12 fros4943 Exp $ + * $Id: radio-arch.c,v 1.3 2006/10/05 07:46:53 fros4943 Exp $ */ #include "dev/radio-arch.h" @@ -68,14 +68,14 @@ doInterfaceActionsBeforeTick(void) return; } - // If no incoming radio data, do nothing - if (simInSize == 0) { + // Busy-wait while receiving (in main file) + if (simReceiving) { + busyWaitNext = 1; return; } - // Busy-wait while receiving (in main file) - while (simReceiving) { - busyWaitNext = 1; + // If no incoming radio data, do nothing + if (simInSize == 0) { return; }