adafruit / Adafruit_FRAM_SPI

Driver for Adafruit's SPI-Based FRAM Breakouts
Other
34 stars 30 forks source link

conditional compile debug output #30

Closed udo-munk closed 1 month ago

udo-munk commented 3 months ago

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

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.

udo-munk commented 4 weeks ago

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