Commit f043cb78 authored by Avamander's avatar Avamander

Merge pull request #206 from ab316/master

maskIRQ: Fixed function to clear interrupt bits first.
parents 47435fdd 02424869
......@@ -1016,7 +1016,12 @@ bool RF24::txStandBy(uint32_t timeout, bool startTx){
void RF24::maskIRQ(bool tx, bool fail, bool rx){
write_register(CONFIG, ( read_register(CONFIG) ) | fail << MASK_MAX_RT | tx << MASK_TX_DS | rx << MASK_RX_DR );
uint8_t config = read_register(CONFIG);
/* clear the interrupt flags */
config &= ~(1 << MASK_MAX_RT | 1 << MASK_TX_DS | 1 << MASK_RX_DR);
/* set the specified interrupt flags */
config |= fail << MASK_MAX_RT | tx << MASK_TX_DS | rx << MASK_RX_DR;
write_register(CONFIG, config);
}
/****************************************************************************/
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment