General testings

Dependencies:   mbed

Fork of BEACON_CODE_NEW by Mohamed Azad

Revision:
1:e4b70669ae61
Parent:
0:e0a901172445
Child:
2:5b000925d960
Child:
3:60598b6b5778
Child:
4:d1a2b3ff6b5e
diff -r e0a901172445 -r e4b70669ae61 BCN.cpp
--- a/BCN.cpp	Sun Nov 01 08:31:17 2015 +0000
+++ b/BCN.cpp	Mon Nov 02 14:22:50 2015 +0000
@@ -57,8 +57,8 @@
             else
             {       
                     //transmit short beacon and long beacon
-                    SHORT_BCN_TX();
-                    //LONG_BCN_TX();
+                    //SHORT_BCN_TX();
+                    LONG_BCN_TX();
                     
                     if(Check_ACK_RECEIVED() == 1)
                     {
@@ -269,19 +269,13 @@
     writereg(RF22_REG_08_OPERATING_MODE2,0x01);
     writereg(RF22_REG_08_OPERATING_MODE2,0x00);
 }
-uint8_t setFrequency(double centre,float afcPullInRange)
+uint8_t setFrequency(double centre)
 {
     uint8_t fbsel = 0x40;
-    uint8_t afclimiter;
     if (centre >= 480.0) {
         centre /= 2;
         fbsel |= 0x20;
-        afclimiter = afcPullInRange * 1000000.0 / 1250.0;
-    } else {
-        if (afcPullInRange < 0.0 || afcPullInRange > 0.159375)
-            return false;
-        afclimiter = afcPullInRange * 1000000.0 / 625.0;
-    }
+    } 
     centre /= 10.0;
     double integerPart = floor(centre);
     double fractionalPart = centre - integerPart;
@@ -294,7 +288,6 @@
     writereg(RF22_REG_75_FREQUENCY_BAND_SELECT, fbsel);
     writereg(RF22_REG_76_NOMINAL_CARRIER_FREQUENCY1, fc >> 8);
     writereg(RF22_REG_77_NOMINAL_CARRIER_FREQUENCY0, fc & 0xff);
-    //writereg(RF22_REG_2A_AFC_LIMITER, afclimiter);
     return 0;
 }
 
@@ -334,7 +327,7 @@
     writereg(RF22_REG_0B_GPIO_CONFIGURATION0,0x15); // TX state                        
     writereg(RF22_REG_0C_GPIO_CONFIGURATION1,0x12); // RX state                        
 
-    setFrequency(435.0,0.05);
+    setFrequency(435.0);
 
     if((readreg(RF22_REG_02_DEVICE_STATUS)& 0x08)!= 0x00)
         {