diff --git a/Adafruit_FRAM_SPI.cpp b/Adafruit_FRAM_SPI.cpp index 256eabf..81f2e00 100644 --- a/Adafruit_FRAM_SPI.cpp +++ b/Adafruit_FRAM_SPI.cpp @@ -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 @@ -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)