From db4f8119006ac2898e2bc85e601e9be00a85b45f Mon Sep 17 00:00:00 2001 From: Michael Gernoth Date: Thu, 20 Jun 2013 22:34:08 +0200 Subject: [PATCH] sanity check at the right place --- culfw/culfw-asksin-fix.diff | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/culfw/culfw-asksin-fix.diff b/culfw/culfw-asksin-fix.diff index 07a587f..795ff41 100644 --- a/culfw/culfw-asksin-fix.diff +++ b/culfw/culfw-asksin-fix.diff @@ -81,7 +81,7 @@ Index: clib/rf_asksin.c void rf_asksin_task(void) { -@@ -77,15 +90,27 @@ +@@ -77,18 +90,30 @@ uint8_t dec[MAX_ASKSIN_MSG]; uint8_t rssi; uint8_t l; @@ -103,13 +103,17 @@ Index: clib/rf_asksin.c + enc[0] = cc1100_readReg( CC1100_RXFIFO ) & 0x7f; // read len + if (enc[0]>=MAX_ASKSIN_MSG) + enc[0] = MAX_ASKSIN_MSG-1; +- ++ + while ((enc[0] + 2) < (rxfifo_cnt - 1)) { // Wait for more data + my_delay_ms(1); + rxfifo_cnt = (read_cc1100_rxbytes() & 0x7f) + 1; + } + - if (enc[0]>=MAX_ASKSIN_MSG) - enc[0] = MAX_ASKSIN_MSG-1; + CC1100_ASSERT; + cc1100_sendbyte( CC1100_READ_BURST | CC1100_RXFIFO ); @@ -97,13 +122,12 @@ } -- 2.39.5