0x00, 0x07,
0x02, 0x2e,
0x03, 0x0d,
-@@ -26,16 +26,18 @@
+@@ -26,16 +26,17 @@
0x11, 0x93,
0x12, 0x03,
0x15, 0x34,
+ 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 );
}
void
-@@ -97,14 +101,10 @@
+@@ -97,14 +96,10 @@
}
rssi = cc1100_sendbyte( 0 );
dec[0] = enc[0];
dec[1] = (~enc[1]) ^ 0x89;
-@@ -113,7 +113,6 @@
+@@ -113,7 +108,6 @@
dec[l] = enc[l] ^ dec[2];
if (tx_report & REP_BINTIME) {
DC('a');
-@@ -133,24 +132,14 @@
+@@ -133,24 +127,14 @@
}
return;
}
void
-@@ -173,20 +162,7 @@
+@@ -173,20 +157,7 @@
my_delay_ms(3); // 3ms: Found by trial and error
}
enc[0] = dec[0];
enc[1] = (~dec[1]) ^ 0x89;
-@@ -195,6 +171,15 @@
+@@ -195,6 +166,15 @@
enc[l] = dec[l] ^ dec[2];
// send
CC1100_ASSERT;
cc1100_sendbyte(CC1100_WRITE_BURST | CC1100_TXFIFO);
-@@ -205,12 +190,10 @@
+@@ -205,12 +185,17 @@
CC1100_DEASSERT;
+ // 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);