Skip to content

Commit

Permalink
More changes for reading pipes
Browse files Browse the repository at this point in the history
  • Loading branch information
TMRh20 committed Oct 7, 2023
1 parent f0d66a0 commit ee25550
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/nrf_to_nrf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -845,13 +845,15 @@ void nrf_to_nrf::openReadingPipe(uint8_t child, uint64_t address)
prefix = prefix >> 24;

if (!child) {
NRF_RADIO->PREFIX0 = rxPrefix;
NRF_RADIO->BASE0 = base;
NRF_RADIO->PREFIX0 &= ~(0xFF);
NRF_RADIO->PREFIX0 |= prefix;
rxBase = NRF_RADIO->BASE0;
rxPrefix = NRF_RADIO->PREFIX0;
}
else if (child < 4) { // prefixes AP1-3 are in prefix0
NRF_RADIO->PREFIX0 = rxPrefix;
NRF_RADIO->BASE1 = base;
NRF_RADIO->PREFIX0 &= ~(0xFF << (8 * child));
NRF_RADIO->PREFIX0 |= prefix << (8 * child);
Expand Down Expand Up @@ -906,13 +908,15 @@ void nrf_to_nrf::openReadingPipe(uint8_t child, const uint8_t* address)

// Using pipes 1-7 for reading pipes, leaving pipe0 for a tx pipe
if (!child) {
NRF_RADIO->PREFIX0 = rxPrefix;
NRF_RADIO->BASE0 = base;
NRF_RADIO->PREFIX0 &= ~(0xFF);
NRF_RADIO->PREFIX0 |= prefix;
rxBase = NRF_RADIO->BASE0;
rxPrefix = NRF_RADIO->PREFIX0;
}
else if (child < 4) { // prefixes AP1-3 are in prefix0
NRF_RADIO->PREFIX0 = rxPrefix;
NRF_RADIO->BASE1 = base;
NRF_RADIO->PREFIX0 &= ~(0xFF << (8 * child));
NRF_RADIO->PREFIX0 |= prefix << (8 * child);
Expand Down

0 comments on commit ee25550

Please sign in to comment.