Skip to content

Commit

Permalink
Merge pull request #30 from udo-munk/master
Browse files Browse the repository at this point in the history
conditional compile debug output
  • Loading branch information
hathach authored Jul 18, 2024
2 parents a9f8d19 + d5e94c2 commit 928281f
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion Adafruit_FRAM_SPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@

#include "Adafruit_FRAM_SPI.h"

/// Enable debug output
#define FRAM_DEBUG 0

/// Supported flash devices
const struct {
uint8_t manufID; ///< Manufacture ID
Expand Down Expand Up @@ -152,15 +155,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 928281f

Please sign in to comment.