Skip to content

Commit 30ad9d2

Browse files
committed
mv memset() into pipe_address()
1 parent f8e3e1c commit 30ad9d2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

RF24Network.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@ void ESBNetwork<radio_t>::begin(uint8_t _channel, uint16_t _node_address)
109109
uint8_t i = NUM_PIPES;
110110
uint8_t address[5];
111111
while (i--) {
112-
memset(address, 0xCC, 5);
113112
pipe_address(_node_address, i, address);
114113
radio.openReadingPipe(i, address);
115114
}
@@ -1016,7 +1015,7 @@ bool ESBNetwork<radio_t>::write_to_pipe(uint16_t node, uint8_t pipe, bool multic
10161015
bool ok = false;
10171016

10181017
if (!(networkFlags & FLAG_FAST_FRAG) || (frame_buffer[6] == NETWORK_FIRST_FRAGMENT && networkFlags & FLAG_FAST_FRAG)) {
1019-
uint8_t address[5] = {0xCC};
1018+
uint8_t address[5];
10201019
pipe_address(node, pipe, address);
10211020
radio.stopListening(address);
10221021
radio.setAutoAck(0, !multicast);
@@ -1189,7 +1188,7 @@ void ESBNetwork<radio_t>::multicastLevel(uint8_t level)
11891188
{
11901189
_multicast_level = level;
11911190
radio.stopListening();
1192-
uint8_t address[5] = {0xCC};
1191+
uint8_t address[5];
11931192
pipe_address(levelToAddress(level), 0, address);
11941193
radio.openReadingPipe(0, address);
11951194
radio.startListening();
@@ -1233,6 +1232,7 @@ void ESBNetwork<radio_t>::pipe_address(uint16_t node, uint8_t pipe, uint8_t* add
12331232
#endif
12341233
#endif
12351234
};
1235+
memset(address, 0xCC, 5);
12361236
uint8_t* out = address;
12371237

12381238
// Translate the address to use our optimally chosen radio address bytes

0 commit comments

Comments
 (0)