Skip to content

Commit

Permalink
conditional compile debug output
Browse files Browse the repository at this point in the history
  • Loading branch information
udo-munk authored and hathach committed Jul 18, 2024
1 parent a9f8d19 commit 868a791
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Adafruit_FRAM_SPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@

#include "Adafruit_FRAM_SPI.h"

#define FRAM_DEBUG 0

/// Supported flash devices
const struct {
uint8_t manufID; ///< Manufacture ID
Expand Down Expand Up @@ -152,15 +154,21 @@ bool Adafruit_FRAM_SPI::begin(uint8_t nAddressSizeBytes) {
_dev_idx = get_supported_idx(manufID, prodID);

if (_dev_idx == -1) {
#if FRAM_DEBUG
Serial.print(F("Unexpected Device: Manufacturer ID = 0x"));
Serial.print(manufID, HEX);
Serial.print(F(", Product ID = 0x"));
Serial.println(prodID, HEX);
#endif

return false;
} else {
uint32_t fram_size = _supported_devices[_dev_idx].size;
uint32_t const fram_size = _supported_devices[_dev_idx].size;

#if FRAM_DEBUG
Serial.print(F("FRAM Size = 0x"));
Serial.println(fram_size, HEX);
#endif

// Detect address size in bytes either 2 or 3 bytes (4 bytes is not
// supported)
Expand Down

0 comments on commit 868a791

Please sign in to comment.