made sd code only compile with SDSUPPORT defined. safes 10k of codespace

This commit is contained in:
Bernhard 2011-12-26 09:28:51 +01:00
parent 729cde4475
commit 3814bbb529
14 changed files with 72 additions and 0 deletions

View file

@ -18,6 +18,8 @@
* <http://www.gnu.org/licenses/>. * <http://www.gnu.org/licenses/>.
*/ */
#include "Marlin.h" #include "Marlin.h"
#ifdef SDSUPPORT
#include "Sd2Card.h" #include "Sd2Card.h"
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#ifndef SOFTWARE_SPI #ifndef SOFTWARE_SPI
@ -636,3 +638,6 @@ bool Sd2Card::writeStop() {
chipSelectHigh(); chipSelectHigh();
return false; return false;
} }
#endif

View file

@ -17,6 +17,10 @@
* along with the Arduino Sd2Card Library. If not, see * along with the Arduino Sd2Card Library. If not, see
* <http://www.gnu.org/licenses/>. * <http://www.gnu.org/licenses/>.
*/ */
#include "Marlin.h"
#ifdef SDSUPPORT
#ifndef Sd2Card_h #ifndef Sd2Card_h
#define Sd2Card_h #define Sd2Card_h
/** /**
@ -232,3 +236,6 @@ class Sd2Card {
bool writeData(uint8_t token, const uint8_t* src); bool writeData(uint8_t token, const uint8_t* src);
}; };
#endif // Sd2Card_h #endif // Sd2Card_h
#endif

View file

@ -18,6 +18,9 @@
* <http://www.gnu.org/licenses/>. * <http://www.gnu.org/licenses/>.
*/ */
// Warning this file was generated by a program. // Warning this file was generated by a program.
#include "Marlin.h"
#ifdef SDSUPPORT
#ifndef Sd2PinMap_h #ifndef Sd2PinMap_h
#define Sd2PinMap_h #define Sd2PinMap_h
#include <avr/io.h> #include <avr/io.h>
@ -360,3 +363,6 @@ static inline __attribute__((always_inline))
} }
} }
#endif // Sd2PinMap_h #endif // Sd2PinMap_h
#endif

View file

@ -19,6 +19,10 @@
*/ */
#define SERIAL MSerial #define SERIAL MSerial
#include "Marlin.h"
#ifdef SDSUPPORT
#include "SdBaseFile.h" #include "SdBaseFile.h"
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// pointer to cwd directory // pointer to cwd directory
@ -1784,3 +1788,6 @@ int16_t SdBaseFile::write(const void* buf, uint16_t nbyte) {
#if ALLOW_DEPRECATED_FUNCTIONS && !defined(DOXYGEN) #if ALLOW_DEPRECATED_FUNCTIONS && !defined(DOXYGEN)
void (*SdBaseFile::oldDateTime_)(uint16_t& date, uint16_t& time) = 0; // NOLINT void (*SdBaseFile::oldDateTime_)(uint16_t& date, uint16_t& time) = 0; // NOLINT
#endif // ALLOW_DEPRECATED_FUNCTIONS #endif // ALLOW_DEPRECATED_FUNCTIONS
#endif

View file

@ -17,6 +17,9 @@
* along with the Arduino SdFat Library. If not, see * along with the Arduino SdFat Library. If not, see
* <http://www.gnu.org/licenses/>. * <http://www.gnu.org/licenses/>.
*/ */
#include "Marlin.h"
#ifdef SDSUPPORT
#ifndef SdBaseFile_h #ifndef SdBaseFile_h
#define SdBaseFile_h #define SdBaseFile_h
/** /**
@ -477,3 +480,4 @@ class SdBaseFile {
}; };
#endif // SdBaseFile_h #endif // SdBaseFile_h
#endif

View file

@ -21,6 +21,9 @@
* \file * \file
* \brief configuration definitions * \brief configuration definitions
*/ */
#include "Marlin.h"
#ifdef SDSUPPORT
#ifndef SdFatConfig_h #ifndef SdFatConfig_h
#define SdFatConfig_h #define SdFatConfig_h
#include <stdint.h> #include <stdint.h>
@ -106,3 +109,6 @@ uint8_t const SOFT_SPI_SCK_PIN = 13;
*/ */
#define USE_CXA_PURE_VIRTUAL 1 #define USE_CXA_PURE_VIRTUAL 1
#endif // SdFatConfig_h #endif // SdFatConfig_h
#endif

View file

@ -17,6 +17,9 @@
* along with the Arduino SdFat Library. If not, see * along with the Arduino SdFat Library. If not, see
* <http://www.gnu.org/licenses/>. * <http://www.gnu.org/licenses/>.
*/ */
#include "Marlin.h"
#ifdef SDSUPPORT
#ifndef SdFatStructs_h #ifndef SdFatStructs_h
#define SdFatStructs_h #define SdFatStructs_h
/** /**
@ -602,3 +605,6 @@ static inline uint8_t DIR_IS_FILE_OR_SUBDIR(const dir_t* dir) {
return (dir->attributes & DIR_ATT_VOLUME_ID) == 0; return (dir->attributes & DIR_ATT_VOLUME_ID) == 0;
} }
#endif // SdFatStructs_h #endif // SdFatStructs_h
#endif

View file

@ -18,6 +18,8 @@
* <http://www.gnu.org/licenses/>. * <http://www.gnu.org/licenses/>.
*/ */
#include "Marlin.h" #include "Marlin.h"
#ifdef SDSUPPORT
#include "SdFatUtil.h" #include "SdFatUtil.h"
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
@ -74,3 +76,4 @@ void SdFatUtil::SerialPrint_P(PGM_P str) {
void SdFatUtil::SerialPrintln_P(PGM_P str) { void SdFatUtil::SerialPrintln_P(PGM_P str) {
println_P( str); println_P( str);
} }
#endif

View file

@ -17,6 +17,9 @@
* along with the Arduino SdFat Library. If not, see * along with the Arduino SdFat Library. If not, see
* <http://www.gnu.org/licenses/>. * <http://www.gnu.org/licenses/>.
*/ */
#include "Marlin.h"
#ifdef SDSUPPORT
#ifndef SdFatUtil_h #ifndef SdFatUtil_h
#define SdFatUtil_h #define SdFatUtil_h
/** /**
@ -40,3 +43,6 @@ namespace SdFatUtil {
using namespace SdFatUtil; // NOLINT using namespace SdFatUtil; // NOLINT
#endif // #define SdFatUtil_h #endif // #define SdFatUtil_h
#endif

View file

@ -18,6 +18,8 @@
* <http://www.gnu.org/licenses/>. * <http://www.gnu.org/licenses/>.
*/ */
#include "Marlin.h" #include "Marlin.h"
#ifdef SDSUPPORT
#include "SdFile.h" #include "SdFile.h"
/** Create a file object and open it in the current working directory. /** Create a file object and open it in the current working directory.
* *
@ -85,3 +87,6 @@ void SdFile::writeln_P(PGM_P str) {
write_P(str); write_P(str);
write_P(PSTR("\r\n")); write_P(PSTR("\r\n"));
} }
#endif

View file

@ -22,6 +22,8 @@
* \brief SdFile class * \brief SdFile class
*/ */
#include "Marlin.h" #include "Marlin.h"
#ifdef SDSUPPORT
#include "SdBaseFile.h" #include "SdBaseFile.h"
#include <Print.h> #include <Print.h>
#ifndef SdFile_h #ifndef SdFile_h
@ -47,3 +49,6 @@ class SdFile : public SdBaseFile, public Print {
void writeln_P(PGM_P str); void writeln_P(PGM_P str);
}; };
#endif // SdFile_h #endif // SdFile_h
#endif

View file

@ -17,6 +17,9 @@
* along with the Arduino Sd2Card Library. If not, see * along with the Arduino Sd2Card Library. If not, see
* <http://www.gnu.org/licenses/>. * <http://www.gnu.org/licenses/>.
*/ */
#include "Marlin.h"
#ifdef SDSUPPORT
#ifndef SdInfo_h #ifndef SdInfo_h
#define SdInfo_h #define SdInfo_h
#include <stdint.h> #include <stdint.h>
@ -273,3 +276,5 @@ union csd_t {
csd2_t v2; csd2_t v2;
}; };
#endif // SdInfo_h #endif // SdInfo_h
#endif

View file

@ -17,6 +17,9 @@
* along with the Arduino SdFat Library. If not, see * along with the Arduino SdFat Library. If not, see
* <http://www.gnu.org/licenses/>. * <http://www.gnu.org/licenses/>.
*/ */
#include "Marlin.h"
#ifdef SDSUPPORT
#include "SdVolume.h" #include "SdVolume.h"
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#if !USE_MULTIPLE_CARDS #if !USE_MULTIPLE_CARDS
@ -399,3 +402,4 @@ bool SdVolume::init(Sd2Card* dev, uint8_t part) {
fail: fail:
return false; return false;
} }
#endif

View file

@ -17,6 +17,8 @@
* along with the Arduino SdFat Library. If not, see * along with the Arduino SdFat Library. If not, see
* <http://www.gnu.org/licenses/>. * <http://www.gnu.org/licenses/>.
*/ */
#include "Marlin.h"
#ifdef SDSUPPORT
#ifndef SdVolume_h #ifndef SdVolume_h
#define SdVolume_h #define SdVolume_h
/** /**
@ -209,3 +211,4 @@ class SdVolume {
#endif // ALLOW_DEPRECATED_FUNCTIONS #endif // ALLOW_DEPRECATED_FUNCTIONS
}; };
#endif // SdVolume #endif // SdVolume
#endif