Browse Source

Fixed RX Binding

master
Englebert 4 years ago
parent
commit
e4cb38abfb
  1. 33
      OpenFlightTX.ino

33
OpenFlightTX.ino

@ -73,7 +73,8 @@ TxMessage txmessage;
struct SyncData {
uint8_t freq_channel;
uint64_t pipe;
uint8_t dummy;
uint8_t fixed;
};
SyncData syncdata;
@ -386,7 +387,7 @@ input[type=button] {
/*** Index Page ***/
const char* index_html PROGMEM = R"rawliteral(<pre><strong>OpenFlightTX v1.0.9</strong>
const char* index_html PROGMEM = R"rawliteral(<pre><strong>OpenFlightTX v1.0.10</strong>
)rawliteral";
// WebPages ----- END
@ -1187,15 +1188,19 @@ void SignalHandler(void *pvParameters) {
nrf_profiling_raw++;
// delay(1);
} else if(binding) {
syncdata.freq_channel = freq_channel;
syncdata.pipe = pipeIn;
Serial.print(F("Sending Binding Channel:"));
Serial.println(freq_channel);
syncdata.freq_channel = (uint8_t) freq_channel;
syncdata.dummy = 100;
syncdata.fixed = 88;
// syncdata.pipe = pipeIn;
// Sending Data over NRF
radio.write(&syncdata, sizeof(syncdata));
radio.write(&syncdata, sizeof(SyncData));
nrf_profiling_raw++;
} else {
delay(10);
delay(1);
} // End of if(nrf_scanner)
} // End of for(;;)
@ -1332,7 +1337,7 @@ void loop() {
// u8g2_left.setFont(u8g2_font_micro_tr);
u8g2_left.setFont(u8g2_font_5x7_tf);
u8g2_left.setCursor(0,62);
u8g2_left.print(F("OpenFlightTX - 1.0.9"));
u8g2_left.print(F("OpenFlightTX - 1.0.10"));
// Battery
show_battery_level(115, 56);
@ -1350,7 +1355,7 @@ void loop() {
}
} else if(binding) {
u8g2_left.setFont(u8g2_font_5x7_tf);
u8g2_left.setCursor(0, 55);
u8g2_left.setCursor(0, 53);
u8g2_left.print(F("RX Binding in Progress"));
}
@ -2622,14 +2627,14 @@ void setup_nrf_sync(void) {
// radio.setAutoAck(true);
radio.setAutoAck(false); // Seems like i am doing this on the last version...
radio.setPayloadSize(sizeof(SyncData));
radio.setChannel(0); // 0: Sync channel (2400MHz)
radio.setChannel(125); // 0: Sync channel (2525MHz)
radio.setDataRate(RF24_250KBPS); // Lowest.. at 250kbps
radio.setPALevel(RF24_PA_MIN);
// delay_maxrf_time = millis() + 2000; // Delay 2 seconds later
// delay_maxrf = true;
// radio.setPALevel(RF24_PA_MAX); // Set the transmit power to Maximum... Later make it configurable.
const uint64_t pipe = 0xE8E8F0F0E1LL;
const uint64_t pipe = 0x1111111111LL;
radio.openWritingPipe(pipe);
// radio.printDetails();
}
@ -2663,8 +2668,8 @@ void setup_nrf_tx(void) {
// radio.setPALevel(RF24_PA_MAX); // Set the transmit power to Maximum... Later make it configurable.
// const uint64_t pipe = 0xE8E8F0F0E1LL;
radio.openWritingPipe(pipeIn);
const uint64_t pipe = 0xE8E8F0F0E1LL;
radio.openWritingPipe(pipe);
// radio.printDetails();
Serial.println("SET nrf_scanner = TRUE");
@ -2690,8 +2695,8 @@ void restore_radio(void) {
break;
}
// const uint64_t pipe = 0xE8E8F0F0E1LL;
radio.openWritingPipe(pipeIn);
const uint64_t pipe = 0xE8E8F0F0E1LL;
radio.openWritingPipe(pipe);
nrf_enable = true;
}

Loading…
Cancel
Save