From e9de20843c45612e7ef6be7ea7cbf16ed486bafe Mon Sep 17 00:00:00 2001 From: TMRh20 Date: Sat, 23 Sep 2023 14:14:57 -0600 Subject: [PATCH] Minor update to recent changes --- RF24Network.cpp | 8 +++++++- RF24Network.h | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/RF24Network.cpp b/RF24Network.cpp index 7b963eba..ae135392 100644 --- a/RF24Network.cpp +++ b/RF24Network.cpp @@ -56,6 +56,7 @@ ESBNetwork::ESBNetwork(radio_t& _radio) : radio(_radio), frame_size(MAX multicastRelay = 0; #if defined (multichannel) baseChannel = 0; + initialChannel = 255; #endif } #else @@ -71,6 +72,7 @@ ESBNetwork::ESBNetwork(radio_t& _radio) : radio(_radio), next_frame(fra multicastRelay = 0; #if defined (multichannel) baseChannel = 0; + initialChannel = 255; #endif } #endif @@ -91,8 +93,12 @@ void ESBNetwork::begin(uint8_t _channel, uint16_t _node_address) if (_channel != USE_CURRENT_CHANNEL) radio.setChannel(_channel); + + if(initialChannel == 255){ + initialChannel = radio.getChannel(); + } #if defined (multichannel) - baseChannel = USE_CURRENT_CHANNEL == 255 ? radio.getChannel() : _channel; + baseChannel = USE_CURRENT_CHANNEL == 255 ? initialChannel : _channel; networkChannel = baseChannel; #endif //radio.enableDynamicAck(); diff --git a/RF24Network.h b/RF24Network.h index 0f39d57f..bd1d7c3c 100644 --- a/RF24Network.h +++ b/RF24Network.h @@ -978,6 +978,7 @@ class ESBNetwork #if defined (multichannel) uint8_t baseChannel; uint8_t networkChannel; + uint8_t initialChannel; #endif /** @} */