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

conditional compile debug output #30

Merged
merged 3 commits into from
Jul 18, 2024
Merged

Conversation

udo-munk
Copy link
Contributor

When using the library I get debug output to the terminal, which is unwanted for 2 reasons:

  1. it screws up the terminal output of my application
  2. it needs memory space which is very spare in my project.

My application looks like this:

//#define DEBUG // enables some debug messages

#include <SPI.h>
#include "Adafruit_FRAM_SPI.h"

....
....

void setup()
{
if (!fram.begin(FRAM_ADDR_SIZE)) {
Serial.println(F("No FRAM found"));
exit(1);
}
...
...
}

So if I should run into problems with the FRAM module I can enable additional DEBUG output to see what happens. But only then and not in the production version of the software.

Copy link
Member

@hathach hathach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

look good, thank you. I rebased and got a slightly change

@hathach hathach merged commit 928281f into adafruit:master Jul 18, 2024
1 check passed
@udo-munk
Copy link
Contributor Author

Thank you, change is fine, in my application I can now do:

//#define FRAM_DEBUG 1 // enables FRAM debug messages
//#define DEBUG // enables some application debug messages

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 this pull request may close these issues.

2 participants