1 Index: clib/rf_asksin.c
2 ===================================================================
3 --- clib/rf_asksin.c (revision 373)
4 +++ clib/rf_asksin.c (working copy)
9 -const uint8_t PROGMEM ASKSIN_CFG[50] = {
10 +const uint8_t PROGMEM ASKSIN_CFG[] = {
18 - 0x17, 0x30, // always go into IDLE
19 + 0x17, 0x3F, // always go into RX, CCA, ELV uses 0x03
39 - for (uint8_t i = 0; i<50; i += 2) {
40 + for (uint8_t i = 0; i < sizeof(ASKSIN_CFG); i += 2) {
42 if (pgm_read_byte( &ASKSIN_CFG[i] )>0x40)
46 ccStrobe( CC1100_SCAL );
58 rssi = cc1100_sendbyte( 0 );
59 + /* LQI = */ cc1100_sendbyte( 0 );
63 - ccStrobe( CC1100_SFRX );
64 - ccStrobe( CC1100_SIDLE );
65 - ccStrobe( CC1100_SNOP );
66 - ccStrobe( CC1100_SRX );
69 dec[1] = (~enc[1]) ^ 0x89;
73 dec[l] = enc[l] ^ dec[2];
76 if (tx_report & REP_BINTIME) {
87 - switch (cc1100_readReg( CC1100_MARCSTATE )) {
93 - ccStrobe( CC1100_SFRX );
94 - ccStrobe( CC1100_SIDLE );
95 - ccStrobe( CC1100_SNOP );
96 - ccStrobe( CC1100_SRX );
101 + if (cc1100_readReg( CC1100_MARCSTATE ) == MARCSTATE_RXFIFO_OVERFLOW) {
102 + ccStrobe( CC1100_SFRX );
103 + ccStrobe( CC1100_SIDLE );
104 + ccStrobe( CC1100_SNOP );
105 + ccStrobe( CC1100_SRX );
111 my_delay_ms(3); // 3ms: Found by trial and error
114 - ccStrobe(CC1100_SIDLE);
115 - ccStrobe(CC1100_SFRX );
116 - ccStrobe(CC1100_SFTX );
118 - if (dec[2] & (1 << 4)) { //BURST-bit set?
119 - ccStrobe(CC1100_STX ); //We need to send a burst
121 - //According to ELV, devices get activated every 300ms, so send burst for 360ms
122 - for(l = 0; l < 3; l++)
123 - my_delay_ms(120); //arg is uint_8, so loop
129 enc[1] = (~dec[1]) ^ 0x89;
133 enc[l] = dec[l] ^ dec[2];
136 + if (dec[2] & (1 << 4)) { // BURST-bit set?
137 + // According to ELV, devices get activated every 300ms, so send burst for 360ms
138 + for(l = 0; l < 3; l++)
139 + my_delay_ms(120); // arg is uint_8, so loop
146 cc1100_sendbyte(CC1100_WRITE_BURST | CC1100_TXFIFO);
147 @@ -205,12 +190,10 @@
151 - ccStrobe( CC1100_SFRX );
152 - ccStrobe( CC1100_STX );
153 + // wait for TX to finish
154 + while(cc1100_readReg( CC1100_MARCSTATE ) == MARCSTATE_TX)
157 - while( cc1100_readReg( CC1100_MARCSTATE ) != 1 )