]> git.zerfleddert.de Git - fhem-stuff/blame - culfw/culfw-cc1100-fix.diff
try even harder to not drop any 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
9fbb2249 13- // sec ago. Due to CCA? Using IDLE helps to shorten this period(?)
b2720844
MG
14- ccStrobe(CC1100_SIDLE);
15- while(cnt-- && (ccStrobe( CC1100_STX ) & 0x70) != 2)
16- my_delay_us(10);
9fbb2249 17+ // sec ago. Due to CCA? Wait for chip to enter TX state.
b2720844
MG
18+
19+ while (cc1100_readReg(CC1100_MARCSTATE) != MARCSTATE_TX) {
20+ ccStrobe(CC1100_STX);
21+ }
22 }
23
24 //--------------------------------------------------------------------
25 void
26 ccRX(void)
27 {
28- uint8_t cnt = 0xff;
29+ while (cc1100_readReg(CC1100_MARCSTATE) != MARCSTATE_RX) {
30+ ccStrobe(CC1100_SRX);
31+ }
32
33- while(cnt-- && (ccStrobe( CC1100_SRX ) & 0x70) != 1)
34- my_delay_us(10);
35 EIMSK |= _BV(CC1100_INT);
36-
37 }
38
39
Impressum, Datenschutz