From: Michael Gernoth Date: Fri, 21 Jun 2013 18:31:37 +0000 (+0200) Subject: more errata 1... X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/fhem-stuff/commitdiff_plain/743191582a73e7cad46425d6c90a27f0c34dca0a more errata 1... --- diff --git a/culfw/culfw-asksin-fix.diff b/culfw/culfw-asksin-fix.diff index 38621e7..3887a57 100644 --- a/culfw/culfw-asksin-fix.diff +++ b/culfw/culfw-asksin-fix.diff @@ -101,7 +101,7 @@ Index: clib/rf_asksin.c void rf_asksin_task(void) { -@@ -77,18 +108,51 @@ +@@ -77,18 +108,57 @@ uint8_t dec[MAX_ASKSIN_MSG]; uint8_t rssi; uint8_t l; @@ -121,6 +121,12 @@ Index: clib/rf_asksin.c + break; + + rxfifo_cnt &= 0x7f; ++ ++ // We must not read the last byte from the RX fifo while RX is in progress (Errata 1) ++ while ((rxfifo_cnt == 1) && (cc1100_readReg(CC1100_PKTSTATUS) & (1 << 3))) { ++ my_delay_ms(1); ++ rxfifo_cnt = read_cc1100_rxbytes() & 0x7f; ++ } + enc[0] = cc1100_readReg( CC1100_RXFIFO ) & 0x7f; // read len + rxfifo_cnt--; @@ -158,7 +164,7 @@ Index: clib/rf_asksin.c CC1100_ASSERT; cc1100_sendbyte( CC1100_READ_BURST | CC1100_RXFIFO ); -@@ -97,14 +161,19 @@ +@@ -97,14 +167,19 @@ } rssi = cc1100_sendbyte( 0 ); @@ -183,7 +189,7 @@ Index: clib/rf_asksin.c dec[0] = enc[0]; dec[1] = (~enc[1]) ^ 0x89; -@@ -113,7 +182,6 @@ +@@ -113,7 +188,6 @@ dec[l] = enc[l] ^ dec[2]; @@ -191,7 +197,7 @@ Index: clib/rf_asksin.c if (tx_report & REP_BINTIME) { DC('a'); -@@ -131,26 +199,17 @@ +@@ -131,26 +205,17 @@ DNL(); } @@ -227,7 +233,7 @@ Index: clib/rf_asksin.c } void -@@ -173,20 +232,7 @@ +@@ -173,20 +238,7 @@ my_delay_ms(3); // 3ms: Found by trial and error } @@ -248,7 +254,7 @@ Index: clib/rf_asksin.c enc[0] = dec[0]; enc[1] = (~dec[1]) ^ 0x89; -@@ -195,6 +241,15 @@ +@@ -195,6 +247,15 @@ enc[l] = dec[l] ^ dec[2]; @@ -264,7 +270,7 @@ Index: clib/rf_asksin.c // send CC1100_ASSERT; cc1100_sendbyte(CC1100_WRITE_BURST | CC1100_TXFIFO); -@@ -205,12 +260,17 @@ +@@ -205,12 +266,17 @@ CC1100_DEASSERT;