Commit 02424869 authored by Abdullah Baig's avatar Abdullah Baig

maskIRQ: Fixed function to clear interrupt bits first.

parent 95926b2c
...@@ -1016,7 +1016,12 @@ bool RF24::txStandBy(uint32_t timeout, bool startTx){ ...@@ -1016,7 +1016,12 @@ bool RF24::txStandBy(uint32_t timeout, bool startTx){
void RF24::maskIRQ(bool tx, bool fail, bool rx){ 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