]> git.zerfleddert.de Git - fhem-stuff/blame - culfw/culfw-cc1100-fix.diff
add WIP culfw patches to fix asksin problems with lost packets
[fhem-stuff] / culfw / culfw-cc1100-fix.diff
CommitLineData
b2720844
MG
1Index: clib/cc1100.c
2===================================================================
3--- clib/cc1100.c (revision 373)
4+++ clib/cc1100.c (working copy)
5@@ -266,26 +266,25 @@
6 void
7 ccTX(void)
8 {
9- uint8_t cnt = 0xff;
10 EIMSK &= ~_BV(CC1100_INT);
11
12 // Going from RX to TX does not work if there was a reception less than 0.5
13 // sec ago. Due to CCA? Using IDLE helps to shorten this period(?)
14- ccStrobe(CC1100_SIDLE);
15- while(cnt-- && (ccStrobe( CC1100_STX ) & 0x70) != 2)
16- my_delay_us(10);
17+
18+ while (cc1100_readReg(CC1100_MARCSTATE) != MARCSTATE_TX) {
19+ ccStrobe(CC1100_STX);
20+ }
21 }
22
23 //--------------------------------------------------------------------
24 void
25 ccRX(void)
26 {
27- uint8_t cnt = 0xff;
28+ while (cc1100_readReg(CC1100_MARCSTATE) != MARCSTATE_RX) {
29+ ccStrobe(CC1100_SRX);
30+ }
31
32- while(cnt-- && (ccStrobe( CC1100_SRX ) & 0x70) != 1)
33- my_delay_us(10);
34 EIMSK |= _BV(CC1100_INT);
35-
36 }
37
38
Impressum, Datenschutz