Skip to content

Unclear about size of _BUFFER #37

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

Closed
reyeslucero opened this issue Feb 14, 2020 · 4 comments
Closed

Unclear about size of _BUFFER #37

reyeslucero opened this issue Feb 14, 2020 · 4 comments

Comments

@reyeslucero
Copy link

reyeslucero commented Feb 14, 2020

I am confused about the initialization of the global buffer for the radio _BUFFER.
It should be 256 bytes which is the size specified in the radio's data sheet.
However, it seems at though its only being initialized to 10 bytes?
Here is the code for initialization:

# Global buffer to hold data sent and received with the chip.  This must be
# at least as large as the FIFO on the chip (256 bytes)!  Keep this on the
# class level to ensure only one copy ever exists (with the trade-off that
# this is NOT re-entrant or thread safe code by design).
_BUFFER = bytearray(10)  

If someone could provide insight into the behavior of _BUFFER, that would be greatly appreciated.

@jerryneedell
Copy link
Contributor

jerryneedell commented Feb 14, 2020

Take a look at lines 401 to 437 in adafruit_rfm9x.py.
You’ll see that _BUFFER is only used to hold the SPI command or to read one byte. At most of a few bytes are used.

The comment describing. _BUFFER is incorrect and should be updated.

@brentru
Copy link
Member

brentru commented Feb 14, 2020

@jerryneedell possibly changing _BUFFER to CMD_BUFFER would make this more clear?

@reyeslucero reyeslucero changed the title Unclear about size of Unclear about size of _BUFFER Feb 14, 2020
@jerryneedell
Copy link
Contributor

address by #42 -- the name is still _BUFFER, but the comment was changed to clarify its use.

@jerryneedell
Copy link
Contributor

addressed in #42

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

3 participants