From: Michael Gernoth Date: Thu, 20 Jun 2013 14:15:15 +0000 (+0200) Subject: no need for magic abort values in ASKSIN_CFG X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/fhem-stuff/commitdiff_plain/777ef62192dfdcd183a162d5ab71792a2444693e no need for magic abort values in ASKSIN_CFG --- diff --git a/culfw/culfw-asksin-fix.diff b/culfw/culfw-asksin-fix.diff index c2d7101..04dab92 100644 --- a/culfw/culfw-asksin-fix.diff +++ b/culfw/culfw-asksin-fix.diff @@ -11,7 +11,7 @@ Index: clib/rf_asksin.c 0x00, 0x07, 0x02, 0x2e, 0x03, 0x0d, -@@ -26,16 +26,18 @@ +@@ -26,16 +26,17 @@ 0x11, 0x93, 0x12, 0x03, 0x15, 0x34, @@ -26,22 +26,25 @@ Index: clib/rf_asksin.c + 0x29, 0x59, + 0x2c, 0x81, 0x2D, 0x35, - 0x3e, 0xc3, +- 0x3e, 0xc3, - 0xff -+ 0xff, 0xff ++ 0x3e, 0xc3 }; void -@@ -56,7 +58,7 @@ +@@ -56,18 +57,16 @@ my_delay_us(100); // load configuration - for (uint8_t i = 0; i<50; i += 2) { +- +- if (pgm_read_byte( &ASKSIN_CFG[i] )>0x40) +- break; +- + for (uint8_t i = 0; i < sizeof(ASKSIN_CFG); i += 2) { - - if (pgm_read_byte( &ASKSIN_CFG[i] )>0x40) - break; -@@ -67,7 +69,9 @@ + cc1100_writeReg( pgm_read_byte(&ASKSIN_CFG[i]), + pgm_read_byte(&ASKSIN_CFG[i+1]) ); + } ccStrobe( CC1100_SCAL ); @@ -52,7 +55,7 @@ Index: clib/rf_asksin.c } void -@@ -97,14 +101,10 @@ +@@ -97,14 +96,10 @@ } rssi = cc1100_sendbyte( 0 ); @@ -68,7 +71,7 @@ Index: clib/rf_asksin.c dec[0] = enc[0]; dec[1] = (~enc[1]) ^ 0x89; -@@ -113,7 +113,6 @@ +@@ -113,7 +108,6 @@ dec[l] = enc[l] ^ dec[2]; @@ -76,7 +79,7 @@ Index: clib/rf_asksin.c if (tx_report & REP_BINTIME) { DC('a'); -@@ -133,24 +132,14 @@ +@@ -133,24 +127,14 @@ } return; @@ -107,7 +110,7 @@ Index: clib/rf_asksin.c } void -@@ -173,20 +162,7 @@ +@@ -173,20 +157,7 @@ my_delay_ms(3); // 3ms: Found by trial and error } @@ -128,7 +131,7 @@ Index: clib/rf_asksin.c enc[0] = dec[0]; enc[1] = (~dec[1]) ^ 0x89; -@@ -195,6 +171,15 @@ +@@ -195,6 +166,15 @@ enc[l] = dec[l] ^ dec[2]; @@ -144,7 +147,7 @@ Index: clib/rf_asksin.c // send CC1100_ASSERT; cc1100_sendbyte(CC1100_WRITE_BURST | CC1100_TXFIFO); -@@ -205,12 +190,10 @@ +@@ -205,12 +185,17 @@ CC1100_DEASSERT; @@ -153,6 +156,13 @@ Index: clib/rf_asksin.c + // wait for TX to finish + while(cc1100_readReg( CC1100_MARCSTATE ) == MARCSTATE_TX) + ; ++ ++ if (cc1100_readReg( CC1100_MARCSTATE ) == MARCSTATE_TXFIFO_UNDERFLOW) { ++ ccStrobe( CC1100_SFTX ); ++ ccStrobe( CC1100_SIDLE ); ++ ccStrobe( CC1100_SNOP ); ++ ccStrobe( CC1100_SRX ); ++ } - while( cc1100_readReg( CC1100_MARCSTATE ) != 1 ) - my_delay_ms(5);