Skip to content

Commit

Permalink
Minor update to recent changes
Browse files Browse the repository at this point in the history
  • Loading branch information
TMRh20 committed Sep 23, 2023
1 parent 707b5ce commit e9de208
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
8 changes: 7 additions & 1 deletion RF24Network.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ ESBNetwork<radio_t>::ESBNetwork(radio_t& _radio) : radio(_radio), frame_size(MAX
multicastRelay = 0;
#if defined (multichannel)
baseChannel = 0;
initialChannel = 255;
#endif
}
#else
Expand All @@ -71,6 +72,7 @@ ESBNetwork<radio_t>::ESBNetwork(radio_t& _radio) : radio(_radio), next_frame(fra
multicastRelay = 0;
#if defined (multichannel)
baseChannel = 0;
initialChannel = 255;
#endif
}
#endif
Expand All @@ -91,8 +93,12 @@ void ESBNetwork<radio_t>::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();
Expand Down
1 change: 1 addition & 0 deletions RF24Network.h
Original file line number Diff line number Diff line change
Expand Up @@ -978,6 +978,7 @@ class ESBNetwork
#if defined (multichannel)
uint8_t baseChannel;
uint8_t networkChannel;
uint8_t initialChannel;
#endif

/** @} */
Expand Down

0 comments on commit e9de208

Please sign in to comment.