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

Change SERIAL_DEBUG into RF24_DEBUG #980

Closed
2bndy5 opened this issue Jun 15, 2024 · 7 comments · Fixed by #981
Closed

Change SERIAL_DEBUG into RF24_DEBUG #980

2bndy5 opened this issue Jun 15, 2024 · 7 comments · Fixed by #981

Comments

@2bndy5
Copy link
Member

2bndy5 commented Jun 15, 2024

Basically, we need a way to differentiate between enabling RF24 debug output and enabling RF24Network debug output when compiling the RF24 stack into a single binary. This probably isn't a big concern, but the RF24 debug output can be noisy and make it difficult to see/find debug output from RF24Network.

Describe the solution you'd like
Just as the title says: Change SERIAL_DEBUG into RF24_DEBUG. We should also update the macro name from IF_SERIAL_DEBUG() into IF_RF24_DEBUG(). Doing this will avoid having to change the toggle/flags for the various levels of debug output in RF24Network.

Describe alternatives you've considered
None

Additional context
See nRF24/pyRF24#64 (comment). While this problem was identified in the pyRF24 project, I think it would also affect any project that involves RF24 and RF24Network libs using debug output for the Arduino and PicoSDK platforms. This problem is not present in typical usage on Linux where the RF24 stack is compiled into separate binary drivers.

@2bndy5
Copy link
Member Author

2bndy5 commented Jun 15, 2024

In researching why some portability uses

#undef SERIAL_DEBUG

I found a comment way back in 2016 that might be trying to reference this situation. 😄

@TMRh20
Copy link
Member

TMRh20 commented Jun 15, 2024

Hehe, I think the RF24Network define should probably be changed to RF24NETWORK_DEBUG too.

@2bndy5
Copy link
Member Author

2bndy5 commented Jun 15, 2024

Yeah, we can do that too. It is just a simple search and replace solution.

@2bndy5
Copy link
Member Author

2bndy5 commented Jun 15, 2024

BTW, the debug toggle in RF24Mesh is MESH_DEBUG. Do you want to prefix that to be RF24MESH_DEBUG?

@TMRh20
Copy link
Member

TMRh20 commented Jun 15, 2024

Sure - Nice and consistent and very unlikely to be repeated in other code.

@2bndy5
Copy link
Member Author

2bndy5 commented Jun 15, 2024

RF24Ethernet seems to be already using some lib-specific debug toggle names.

RF24Gateway seems to use a DEBUG_LEVEL in which the integer value dictates the verbosity of debug output. I'm guessing DEBUG_LEVEL should probably get renamed to RF24GATEWAY_DEBUG_LEVEL as well?

@TMRh20
Copy link
Member

TMRh20 commented Jun 15, 2024

Yeah lol

2bndy5 added a commit to nRF24/RF24Mesh that referenced this issue Jun 15, 2024
@2bndy5 2bndy5 closed this as completed in 0aac3d5 Jun 15, 2024
2bndy5 added a commit to nRF24/RF24Network that referenced this issue Jun 15, 2024
2bndy5 added a commit to nRF24/RF24Network that referenced this issue Jun 15, 2024
2bndy5 added a commit to nRF24/RF24Mesh that referenced this issue Jun 15, 2024
2bndy5 added a commit to nRF24/RF24Gateway that referenced this issue Jun 16, 2024
2bndy5 added a commit to nRF24/RF24Gateway that referenced this issue Jun 16, 2024
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

Successfully merging a pull request may close this issue.

2 participants