Merge pull request #34 from adafruit/fix-backward-compatible-cardsize

allow cardSize() for backward compatible with v1
This commit is contained in:
Ha Thach 2025-06-09 14:59:31 +07:00 committed by GitHub
commit 96a164f548
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -236,7 +236,9 @@ class SdSpiCard {
uint32_t sectorCount(); uint32_t sectorCount();
#ifndef DOXYGEN_SHOULD_SKIP_THIS #ifndef DOXYGEN_SHOULD_SKIP_THIS
// Use sectorCount(). cardSize() will be removed in the future. // Use sectorCount(). cardSize() will be removed in the future.
uint32_t __attribute__((error("use sectorCount()"))) cardSize(); uint32_t __attribute__((warning("use sectorCount()"))) cardSize() {
return sectorCount();
}
#endif // DOXYGEN_SHOULD_SKIP_THIS #endif // DOXYGEN_SHOULD_SKIP_THIS
/** Set SPI sharing state /** Set SPI sharing state
* \param[in] value desired state. * \param[in] value desired state.