Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

whatHappened clears status before reading status #32

Open
AidanHolmes opened this issue Jan 16, 2017 · 1 comment
Open

whatHappened clears status before reading status #32

AidanHolmes opened this issue Jan 16, 2017 · 1 comment

Comments

@AidanHolmes
Copy link

The initial call to
self.write_register(NRF24.STATUS, NRF24.RX_DR | NRF24.TX_DS | NRF24.MAX_RT)
clears the status flags so whatHappened never returns that anything happened for RX_DR, TX_DS or MAX_RT

@diodelass
Copy link

It sure doesn't work now, but since the STATUS register is shifted out immediately every time any command (including a 'write register' command) is executed, the best way to grab the status in this case (and, judging by the comments, what was originally intended) would be to catch the output of the call to spi.xfer2 in write_register. Because of this behavior of the device, write_register should probably return the STATUS register's contents whenever it's called anyway, so this seems like a perfectly reasonable change. I'll see if I can put together a pull request implementing this soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants