Eurobot2012_Beacons

Files at this revision

API Documentation at this revision

Comitter:
narshu
Date:
Sat Apr 28 17:11:25 2012 +0000
Parent:
1:b0aa1251016a
Child:
3:bf8a2e4b8012
Commit message:
Working High baud rate

Changed in this revision

RF12B/RF12B.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/RF12B/RF12B.cpp	Sat Apr 28 17:07:20 2012 +0000
+++ b/RF12B/RF12B.cpp	Sat Apr 28 17:11:25 2012 +0000
@@ -24,7 +24,7 @@
 
     /* Setup interrupt to happen on falling edge of NIRQ */
     NIRQ.fall(this, &RF12B::rxISR);
-    
+
     /* Dummy code init */
     rfCode = 0x00;
 }
@@ -183,8 +183,8 @@
 
 
     // 4. Data Rate Command
-    writeCmd(RFM_DATA_RATE_9600);
-
+    //writeCmd(RFM_DATA_RATE_9600);
+    writeCmd(RFM_DATA_RATE_57600);
 
     // 5. Receiver Control Command
     writeCmd(
@@ -344,6 +344,13 @@
                     while (!temp.empty()) {
                         fifo.push(temp.front());
                         temp.pop();
+
+                        if (read() == rfCode) {
+                            TRIG = 1;
+                            wait_us(10);
+                            TRIG = 0;
+                            trigLED = !trigLED;
+                        }
                     }
                 }
 
@@ -356,12 +363,6 @@
             }
         }
     }
-    if (read() == rfCode) {
-        TRIG = 1;
-        wait_us(10);
-        TRIG = 0;
-        trigLED = !trigLED;
-    }
 }
 
 unsigned int RF12B::status() {
@@ -388,6 +389,6 @@
 }
 
 /* RF code set */
-void RF12B::setCode(unsigned char code){
-rfCode = code;
+void RF12B::setCode(unsigned char code) {
+    rfCode = code;
 }
\ No newline at end of file