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 committed May 13, 2024
1 parent 6615844 commit 483af8a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Adafruit_FRAM_SPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,12 @@ static uint32_t check_supported_device(uint8_t manufID, uint16_t prodID) {
return _supported_devices[i].size;
}

#ifdef 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 0;
}
Expand Down Expand Up @@ -144,8 +146,10 @@ bool Adafruit_FRAM_SPI::begin(uint8_t nAddressSizeBytes) {
/* Everything seems to be properly initialised and connected */
uint32_t fram_size = check_supported_device(manufID, prodID);

#ifdef 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)
if (fram_size > 64UL * 1024) {
Expand Down

0 comments on commit 483af8a

Please sign in to comment.