Read Error 9 years ago
parent
commit
167967c88b
1 changed files with 33 additions and 8 deletions
  1. 33
    8
      frsky_arduino_rx_complete.ino

+ 33
- 8
frsky_arduino_rx_complete.ino View File

@@ -12,13 +12,13 @@
12 12
 #include <avr/interrupt.h>
13 13
 #include <EEPROM.h>
14 14
 #include "iface_cc2500.h"
15
-//#define DEBUG
16
-//#define DEBUG0
17
-//#define DEBUG1
18
-//#define DEBUG2
19
-//#define DEBUG3
20
-//#define DEBUG4
21
-//#define DEBUG5
15
+#define DEBUG
16
+#define DEBUG0
17
+#define DEBUG1
18
+#define DEBUG2
19
+#define DEBUG3
20
+#define DEBUG4
21
+#define DEBUG5
22 22
 #define FAILSAFE
23 23
 #define SPIBB
24 24
 //#define SPIHW
@@ -102,7 +102,8 @@ static byte cur_chan_numb = 0;
102 102
 boolean debug = false;
103 103
 int count = 0;
104 104
 uint16_t c[8];
105
-
105
+boolean debug2 = true;
106
+boolean debug3 = false;
106 107
 
107 108
 void setup()
108 109
 {
@@ -381,11 +382,33 @@ void getBind(void)
381 382
                     cc2500_readFifo((uint8_t *)ccData, ccLen);
382 383
                     if (ccData[ccLen - 1] & 0x80) {
383 384
                         if (ccData[2] == 0x01) {
385
+                          if(debug2) {
386
+                            //Serial.print(" ccData[2] = ");
387
+                            //Serial.println(ccData[2]);
388
+                          }
384 389
                             if ((ccData[3] == txid[0]) && (ccData[4] == txid[1])) {
390
+                              if(debug2) 
391
+                              {
392
+                                Serial.print("ccData[5] = ");
393
+                                Serial.println(ccData[5]);
394
+                                Serial.print("bindIdx = ");
395
+                                Serial.println(bindIdx);                      
396
+                              }
385 397
                                 if (ccData[5] == bindIdx) {
386 398
                                     for (uint8_t n = 0; n < 5; n++) {
399
+                                      if(debug3) 
400
+                                      {
401
+                                        Serial.print("ccData[6 + n] = ");
402
+                                        Serial.println(ccData[6 + n]);
403
+                                        Serial.print("ccData[ccLen - 3] = ");
404
+                                        Serial.println(ccData[ccLen - 3]);                      
405
+                                      }
387 406
                                         if (ccData[6 + n] == ccData[ccLen - 3]) {
388 407
                                             eol = true;
408
+                                            #if defined(DEBUG)
409
+                                                Serial.print("listLength: ");
410
+                                                Serial.println(listLength);
411
+                                            #endif
389 412
                                             listLength = ccData[5] + n;
390 413
                                             break;
391 414
                                         }
@@ -406,6 +429,8 @@ void getBind(void)
406 429
     }
407 430
 
408 431
     #if defined(DEBUG)
432
+        listLength = 47;
433
+        Serial.println("jumpIdx list: ");
409 434
         for (uint8_t jumpIdx = 0; jumpIdx < (listLength); jumpIdx++) {
410 435
             Serial.print(" ");
411 436
             Serial.print(hopData[jumpIdx], HEX);

Loading…
Cancel
Save