]> git.zerfleddert.de Git - fhem-stuff/commitdiff
sanity check at the right place
authorMichael Gernoth <michael@gernoth.net>
Thu, 20 Jun 2013 20:34:08 +0000 (22:34 +0200)
committerMichael Gernoth <michael@gernoth.net>
Thu, 20 Jun 2013 20:34:08 +0000 (22:34 +0200)
culfw/culfw-asksin-fix.diff

index 07a587f31afb0887c98906c901a196c1c0908822..795ff4107d6f6ac13c7e4ae7afe868d45aab6d8c 100644 (file)
@@ -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 @@
      }
Impressum, Datenschutz