Skip to content

Commit 8759712

Browse files
committed
Added closeReadingPipe.
1 parent 6530f95 commit 8759712

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

RF24.cpp

+8
Original file line numberDiff line numberDiff line change
@@ -860,6 +860,14 @@ void RF24::openReadingPipe(uint8_t child, uint64_t address)
860860
}
861861
}
862862

863+
/****************************************************************************/
864+
865+
void RF24::closeReadingPipe( uint8_t pipe )
866+
{
867+
write_register(EN_RXADDR,read_register(EN_RXADDR) & ~_BV(pgm_read_byte(&child_pipe_enable[pipe])));
868+
}
869+
870+
863871
/****************************************************************************/
864872

865873
void RF24::toggle_features(void)

RF24.h

+9
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,15 @@ class RF24
208208
*/
209209
void openReadingPipe(uint8_t number, uint64_t address);
210210

211+
212+
213+
/**
214+
* Close a pipe after it has been previously opened.
215+
* Can be safely called without having previously opened a pipe.
216+
* @param pipe Which pipe # to close, 0-5.
217+
*/
218+
void closeReadingPipe( uint8_t pipe ) ;
219+
211220
/**@}*/
212221
/**
213222
* @name Advanced Operation

0 commit comments

Comments
 (0)