From 9d9c859ac14a2e1864f72d0355920a8d8d42be95 Mon Sep 17 00:00:00 2001 From: odewdney Date: Tue, 13 Jan 2015 08:04:32 +0000 Subject: [PATCH 1/5] First move of SdFat library --- .../Arduino_1.0.x/libraries/SdFat}/Sd2Card.cpp | 0 {Marlin => ArduinoAddons/Arduino_1.0.x/libraries/SdFat}/Sd2Card.h | 0 .../Arduino_1.0.x/libraries/SdFat}/Sd2PinMap.h | 0 .../Arduino_1.0.x/libraries/SdFat}/SdBaseFile.cpp | 0 .../Arduino_1.0.x/libraries/SdFat}/SdBaseFile.h | 0 .../Arduino_1.0.x/libraries/SdFat}/SdFatConfig.h | 0 .../Arduino_1.0.x/libraries/SdFat}/SdFatStructs.h | 0 .../Arduino_1.0.x/libraries/SdFat}/SdFatUtil.cpp | 0 .../Arduino_1.0.x/libraries/SdFat}/SdFatUtil.h | 0 .../Arduino_1.0.x/libraries/SdFat}/SdFile.cpp | 0 {Marlin => ArduinoAddons/Arduino_1.0.x/libraries/SdFat}/SdFile.h | 0 {Marlin => ArduinoAddons/Arduino_1.0.x/libraries/SdFat}/SdInfo.h | 0 .../Arduino_1.0.x/libraries/SdFat}/SdVolume.cpp | 0 .../Arduino_1.0.x/libraries/SdFat}/SdVolume.h | 0 14 files changed, 0 insertions(+), 0 deletions(-) rename {Marlin => ArduinoAddons/Arduino_1.0.x/libraries/SdFat}/Sd2Card.cpp (100%) rename {Marlin => ArduinoAddons/Arduino_1.0.x/libraries/SdFat}/Sd2Card.h (100%) rename {Marlin => ArduinoAddons/Arduino_1.0.x/libraries/SdFat}/Sd2PinMap.h (100%) rename {Marlin => ArduinoAddons/Arduino_1.0.x/libraries/SdFat}/SdBaseFile.cpp (100%) rename {Marlin => ArduinoAddons/Arduino_1.0.x/libraries/SdFat}/SdBaseFile.h (100%) rename {Marlin => ArduinoAddons/Arduino_1.0.x/libraries/SdFat}/SdFatConfig.h (100%) rename {Marlin => ArduinoAddons/Arduino_1.0.x/libraries/SdFat}/SdFatStructs.h (100%) rename {Marlin => ArduinoAddons/Arduino_1.0.x/libraries/SdFat}/SdFatUtil.cpp (100%) rename {Marlin => ArduinoAddons/Arduino_1.0.x/libraries/SdFat}/SdFatUtil.h (100%) rename {Marlin => ArduinoAddons/Arduino_1.0.x/libraries/SdFat}/SdFile.cpp (100%) rename {Marlin => ArduinoAddons/Arduino_1.0.x/libraries/SdFat}/SdFile.h (100%) rename {Marlin => ArduinoAddons/Arduino_1.0.x/libraries/SdFat}/SdInfo.h (100%) rename {Marlin => ArduinoAddons/Arduino_1.0.x/libraries/SdFat}/SdVolume.cpp (100%) rename {Marlin => ArduinoAddons/Arduino_1.0.x/libraries/SdFat}/SdVolume.h (100%) diff --git a/Marlin/Sd2Card.cpp b/ArduinoAddons/Arduino_1.0.x/libraries/SdFat/Sd2Card.cpp similarity index 100% rename from Marlin/Sd2Card.cpp rename to ArduinoAddons/Arduino_1.0.x/libraries/SdFat/Sd2Card.cpp diff --git a/Marlin/Sd2Card.h b/ArduinoAddons/Arduino_1.0.x/libraries/SdFat/Sd2Card.h similarity index 100% rename from Marlin/Sd2Card.h rename to ArduinoAddons/Arduino_1.0.x/libraries/SdFat/Sd2Card.h diff --git a/Marlin/Sd2PinMap.h b/ArduinoAddons/Arduino_1.0.x/libraries/SdFat/Sd2PinMap.h similarity index 100% rename from Marlin/Sd2PinMap.h rename to ArduinoAddons/Arduino_1.0.x/libraries/SdFat/Sd2PinMap.h diff --git a/Marlin/SdBaseFile.cpp b/ArduinoAddons/Arduino_1.0.x/libraries/SdFat/SdBaseFile.cpp similarity index 100% rename from Marlin/SdBaseFile.cpp rename to ArduinoAddons/Arduino_1.0.x/libraries/SdFat/SdBaseFile.cpp diff --git a/Marlin/SdBaseFile.h b/ArduinoAddons/Arduino_1.0.x/libraries/SdFat/SdBaseFile.h similarity index 100% rename from Marlin/SdBaseFile.h rename to ArduinoAddons/Arduino_1.0.x/libraries/SdFat/SdBaseFile.h diff --git a/Marlin/SdFatConfig.h b/ArduinoAddons/Arduino_1.0.x/libraries/SdFat/SdFatConfig.h similarity index 100% rename from Marlin/SdFatConfig.h rename to ArduinoAddons/Arduino_1.0.x/libraries/SdFat/SdFatConfig.h diff --git a/Marlin/SdFatStructs.h b/ArduinoAddons/Arduino_1.0.x/libraries/SdFat/SdFatStructs.h similarity index 100% rename from Marlin/SdFatStructs.h rename to ArduinoAddons/Arduino_1.0.x/libraries/SdFat/SdFatStructs.h diff --git a/Marlin/SdFatUtil.cpp b/ArduinoAddons/Arduino_1.0.x/libraries/SdFat/SdFatUtil.cpp similarity index 100% rename from Marlin/SdFatUtil.cpp rename to ArduinoAddons/Arduino_1.0.x/libraries/SdFat/SdFatUtil.cpp diff --git a/Marlin/SdFatUtil.h b/ArduinoAddons/Arduino_1.0.x/libraries/SdFat/SdFatUtil.h similarity index 100% rename from Marlin/SdFatUtil.h rename to ArduinoAddons/Arduino_1.0.x/libraries/SdFat/SdFatUtil.h diff --git a/Marlin/SdFile.cpp b/ArduinoAddons/Arduino_1.0.x/libraries/SdFat/SdFile.cpp similarity index 100% rename from Marlin/SdFile.cpp rename to ArduinoAddons/Arduino_1.0.x/libraries/SdFat/SdFile.cpp diff --git a/Marlin/SdFile.h b/ArduinoAddons/Arduino_1.0.x/libraries/SdFat/SdFile.h similarity index 100% rename from Marlin/SdFile.h rename to ArduinoAddons/Arduino_1.0.x/libraries/SdFat/SdFile.h diff --git a/Marlin/SdInfo.h b/ArduinoAddons/Arduino_1.0.x/libraries/SdFat/SdInfo.h similarity index 100% rename from Marlin/SdInfo.h rename to ArduinoAddons/Arduino_1.0.x/libraries/SdFat/SdInfo.h diff --git a/Marlin/SdVolume.cpp b/ArduinoAddons/Arduino_1.0.x/libraries/SdFat/SdVolume.cpp similarity index 100% rename from Marlin/SdVolume.cpp rename to ArduinoAddons/Arduino_1.0.x/libraries/SdFat/SdVolume.cpp diff --git a/Marlin/SdVolume.h b/ArduinoAddons/Arduino_1.0.x/libraries/SdFat/SdVolume.h similarity index 100% rename from Marlin/SdVolume.h rename to ArduinoAddons/Arduino_1.0.x/libraries/SdFat/SdVolume.h From f84ff4ba7d842b8cf5d18d8385b18ef0a8d5ce68 Mon Sep 17 00:00:00 2001 From: odewdney Date: Tue, 13 Jan 2015 13:31:55 +0000 Subject: [PATCH 2/5] Move SD Fat library out of main src --- .../Arduino_1.0.x/libraries/SdFat/Sd2Card.cpp | 5 +- .../Arduino_1.0.x/libraries/SdFat/Sd2Card.h | 6 --- .../Arduino_1.0.x/libraries/SdFat/Sd2PinMap.h | 6 --- .../libraries/SdFat/SdBaseFile.cpp | 49 ++++++++++--------- .../libraries/SdFat/SdBaseFile.h | 19 +++---- .../Arduino_1.0.x/libraries/SdFat/SdFat.h | 5 ++ .../libraries/SdFat/SdFatConfig.h | 6 --- .../libraries/SdFat/SdFatStructs.h | 6 --- .../libraries/SdFat/SdFatUtil.cpp | 22 ++++----- .../Arduino_1.0.x/libraries/SdFat/SdFatUtil.h | 21 ++------ .../Arduino_1.0.x/libraries/SdFat/SdFile.cpp | 6 --- .../Arduino_1.0.x/libraries/SdFat/SdFile.h | 6 --- .../Arduino_1.0.x/libraries/SdFat/SdInfo.h | 5 -- .../libraries/SdFat/SdVolume.cpp | 5 +- .../Arduino_1.0.x/libraries/SdFat/SdVolume.h | 3 -- Marlin/Marlin.pde | 5 ++ Marlin/temperature.cpp | 5 +- 17 files changed, 64 insertions(+), 116 deletions(-) create mode 100644 ArduinoAddons/Arduino_1.0.x/libraries/SdFat/SdFat.h diff --git a/ArduinoAddons/Arduino_1.0.x/libraries/SdFat/Sd2Card.cpp b/ArduinoAddons/Arduino_1.0.x/libraries/SdFat/Sd2Card.cpp index 69ae77735..55bc5870a 100644 --- a/ArduinoAddons/Arduino_1.0.x/libraries/SdFat/Sd2Card.cpp +++ b/ArduinoAddons/Arduino_1.0.x/libraries/SdFat/Sd2Card.cpp @@ -17,9 +17,8 @@ * along with the Arduino Sd2Card Library. If not, see * . */ -#include "Marlin.h" +#include "SdFat.h" -#ifdef SDSUPPORT #include "Sd2Card.h" //------------------------------------------------------------------------------ #ifndef SOFTWARE_SPI @@ -719,5 +718,3 @@ bool Sd2Card::writeStop() { chipSelectHigh(); return false; } - -#endif diff --git a/ArduinoAddons/Arduino_1.0.x/libraries/SdFat/Sd2Card.h b/ArduinoAddons/Arduino_1.0.x/libraries/SdFat/Sd2Card.h index d6b302bfe..06dfa1c67 100644 --- a/ArduinoAddons/Arduino_1.0.x/libraries/SdFat/Sd2Card.h +++ b/ArduinoAddons/Arduino_1.0.x/libraries/SdFat/Sd2Card.h @@ -18,9 +18,6 @@ * . */ -#include "Marlin.h" -#ifdef SDSUPPORT - #ifndef Sd2Card_h #define Sd2Card_h /** @@ -238,6 +235,3 @@ class Sd2Card { bool writeData(uint8_t token, const uint8_t* src); }; #endif // Sd2Card_h - - -#endif \ No newline at end of file diff --git a/ArduinoAddons/Arduino_1.0.x/libraries/SdFat/Sd2PinMap.h b/ArduinoAddons/Arduino_1.0.x/libraries/SdFat/Sd2PinMap.h index 93ab943ce..77e4e5c52 100644 --- a/ArduinoAddons/Arduino_1.0.x/libraries/SdFat/Sd2PinMap.h +++ b/ArduinoAddons/Arduino_1.0.x/libraries/SdFat/Sd2PinMap.h @@ -18,9 +18,6 @@ * . */ // Warning this file was generated by a program. -#include "Marlin.h" -#ifdef SDSUPPORT - #ifndef Sd2PinMap_h #define Sd2PinMap_h #include @@ -363,6 +360,3 @@ static inline __attribute__((always_inline)) } } #endif // Sd2PinMap_h - - -#endif \ No newline at end of file diff --git a/ArduinoAddons/Arduino_1.0.x/libraries/SdFat/SdBaseFile.cpp b/ArduinoAddons/Arduino_1.0.x/libraries/SdFat/SdBaseFile.cpp index dbcf77fbd..1a12af5c8 100644 --- a/ArduinoAddons/Arduino_1.0.x/libraries/SdFat/SdBaseFile.cpp +++ b/ArduinoAddons/Arduino_1.0.x/libraries/SdFat/SdBaseFile.cpp @@ -17,9 +17,8 @@ * along with the Arduino SdFat Library. If not, see * . */ - -#include "Marlin.h" -#ifdef SDSUPPORT +#include "SdFat.h" +#include #include "SdBaseFile.h" //------------------------------------------------------------------------------ @@ -315,14 +314,14 @@ void SdBaseFile::getpos(fpos_t* pos) { * \param[in] indent Amount of space before file name. Used for recursive * list to indicate subdirectory level. */ -void SdBaseFile::ls(uint8_t flags, uint8_t indent) { +void SdBaseFile::ls(Print *p, uint8_t flags, uint8_t indent) { rewind(); int8_t status; - while ((status = lsPrintNext( flags, indent))) { + while ((status = lsPrintNext( p, flags, indent))) { if (status > 1 && (flags & LS_R)) { uint16_t index = curPosition()/32 - 1; SdBaseFile s; - if (s.open(this, index, O_READ)) s.ls( flags, indent + 2); + if (s.open(this, index, O_READ)) s.ls( p, flags, indent + 2); seekSet(32 * (index + 1)); } } @@ -330,7 +329,8 @@ void SdBaseFile::ls(uint8_t flags, uint8_t indent) { //------------------------------------------------------------------------------ // saves 32 bytes on stack for ls recursion // return 0 - EOF, 1 - normal file, or 2 - directory -int8_t SdBaseFile::lsPrintNext( uint8_t flags, uint8_t indent) { +int8_t SdBaseFile::lsPrintNext( Print *p, uint8_t flags, uint8_t indent) { + Print &MYSERIAL = *p; dir_t dir; uint8_t w = 0; @@ -365,9 +365,9 @@ int8_t SdBaseFile::lsPrintNext( uint8_t flags, uint8_t indent) { // print modify date/time if requested if (flags & LS_DATE) { MYSERIAL.write(' '); - printFatDate( dir.lastWriteDate); + printFatDate( p, dir.lastWriteDate); MYSERIAL.write(' '); - printFatTime( dir.lastWriteTime); + printFatTime( p, dir.lastWriteTime); } // print size if requested if (!DIR_IS_SUBDIR(&dir) && (flags & LS_SIZE)) { @@ -939,8 +939,8 @@ int SdBaseFile::peek() { * \param[in] width Blank fill name if length is less than \a width. * \param[in] printSlash Print '/' after directory names if true. */ -void SdBaseFile::printDirName(const dir_t& dir, - uint8_t width, bool printSlash) { +void SdBaseFile::printDirName(Print *p, const dir_t& dir, uint8_t width, bool printSlash) { + Print &MYSERIAL = *p; uint8_t w = 0; for (uint8_t i = 0; i < 11; i++) { if (dir.name[i] == ' ')continue; @@ -962,7 +962,8 @@ void SdBaseFile::printDirName(const dir_t& dir, } //------------------------------------------------------------------------------ // print uint8_t with width 2 -static void print2u( uint8_t v) { +static void print2u( Print *p, uint8_t v) { + Print &MYSERIAL = *p; if (v < 10) MYSERIAL.write('0'); MYSERIAL.print(v, DEC); } @@ -982,12 +983,14 @@ static void print2u( uint8_t v) { * \param[in] pr Print stream for output. * \param[in] fatDate The date field from a directory entry. */ -void SdBaseFile::printFatDate(uint16_t fatDate) { +void SdBaseFile::printFatDate(Print *p, uint16_t fatDate) { + Print &MYSERIAL = *p; + MYSERIAL.print(FAT_YEAR(fatDate)); MYSERIAL.write('-'); - print2u( FAT_MONTH(fatDate)); + print2u( p, FAT_MONTH(fatDate)); MYSERIAL.write('-'); - print2u( FAT_DAY(fatDate)); + print2u( p, FAT_DAY(fatDate)); } //------------------------------------------------------------------------------ @@ -998,12 +1001,14 @@ void SdBaseFile::printFatDate(uint16_t fatDate) { * \param[in] pr Print stream for output. * \param[in] fatTime The time field from a directory entry. */ -void SdBaseFile::printFatTime( uint16_t fatTime) { - print2u( FAT_HOUR(fatTime)); +void SdBaseFile::printFatTime( Print *p, uint16_t fatTime) { + Print &MYSERIAL = *p; + + print2u( p, FAT_HOUR(fatTime)); MYSERIAL.write(':'); - print2u( FAT_MINUTE(fatTime)); + print2u( p, FAT_MINUTE(fatTime)); MYSERIAL.write(':'); - print2u( FAT_SECOND(fatTime)); + print2u( p, FAT_SECOND(fatTime)); } //------------------------------------------------------------------------------ /** Print a file's name to Serial @@ -1011,7 +1016,8 @@ void SdBaseFile::printFatTime( uint16_t fatTime) { * \return The value one, true, is returned for success and * the value zero, false, is returned for failure. */ -bool SdBaseFile::printName() { +bool SdBaseFile::printName(Print *p) { + Print &MYSERIAL = *p; char name[13]; if (!getFilename(name)) return false; MYSERIAL.print(name); @@ -1820,6 +1826,3 @@ int16_t SdBaseFile::write(const void* buf, uint16_t nbyte) { #if ALLOW_DEPRECATED_FUNCTIONS && !defined(DOXYGEN) void (*SdBaseFile::oldDateTime_)(uint16_t& date, uint16_t& time) = 0; // NOLINT #endif // ALLOW_DEPRECATED_FUNCTIONS - - -#endif diff --git a/ArduinoAddons/Arduino_1.0.x/libraries/SdFat/SdBaseFile.h b/ArduinoAddons/Arduino_1.0.x/libraries/SdFat/SdBaseFile.h index dea299a64..9df19c475 100644 --- a/ArduinoAddons/Arduino_1.0.x/libraries/SdFat/SdBaseFile.h +++ b/ArduinoAddons/Arduino_1.0.x/libraries/SdFat/SdBaseFile.h @@ -17,16 +17,12 @@ * along with the Arduino SdFat Library. If not, see * . */ -#include "Marlin.h" -#ifdef SDSUPPORT - #ifndef SdBaseFile_h #define SdBaseFile_h /** * \file * \brief SdBaseFile class */ -#include "Marlin.h" #include "SdFatConfig.h" #include "SdVolume.h" //------------------------------------------------------------------------------ @@ -174,6 +170,8 @@ static inline uint8_t FAT_SECOND(uint16_t fatTime) { uint16_t const FAT_DEFAULT_DATE = ((2000 - 1980) << 9) | (1 << 5) | 1; /** Default time for file timestamp is 1 am */ uint16_t const FAT_DEFAULT_TIME = (1 << 11); + +class Print; //------------------------------------------------------------------------------ /** * \class SdBaseFile @@ -266,7 +264,7 @@ class SdBaseFile { bool isRoot() const { return type_ == FAT_FILE_TYPE_ROOT_FIXED || type_ == FAT_FILE_TYPE_ROOT32; } - void ls( uint8_t flags = 0, uint8_t indent = 0); + void ls( Print *p, uint8_t flags = 0, uint8_t indent = 0); bool mkdir(SdBaseFile* dir, const char* path, bool pFlag = true); // alias for backward compactability bool makeDir(SdBaseFile* dir, const char* path) { @@ -278,9 +276,9 @@ class SdBaseFile { bool openNext(SdBaseFile* dirFile, uint8_t oflag); bool openRoot(SdVolume* vol); int peek(); - static void printFatDate(uint16_t fatDate); - static void printFatTime( uint16_t fatTime); - bool printName(); + static void printFatDate(Print *p, uint16_t fatDate); + static void printFatTime(Print *p, uint16_t fatTime); + bool printName(Print *p); int16_t read(); int16_t read(void* buf, uint16_t nbyte); int8_t readDir(dir_t* dir, char* longFilename); @@ -352,7 +350,7 @@ class SdBaseFile { bool addCluster(); bool addDirCluster(); dir_t* cacheDirEntry(uint8_t action); - int8_t lsPrintNext( uint8_t flags, uint8_t indent); + int8_t lsPrintNext( Print *p, uint8_t flags, uint8_t indent); static bool make83Name(const char* str, uint8_t* name, const char** ptr); bool mkdir(SdBaseFile* parent, const uint8_t dname[11]); bool open(SdBaseFile* dirFile, const uint8_t dname[11], uint8_t oflag); @@ -360,7 +358,7 @@ class SdBaseFile { dir_t* readDirCache(); //------------------------------------------------------------------------------ // to be deleted - static void printDirName( const dir_t& dir, + static void printDirName( Print *p, const dir_t& dir, uint8_t width, bool printSlash); //------------------------------------------------------------------------------ // Deprecated functions - suppress cpplint warnings with NOLINT comment @@ -480,4 +478,3 @@ class SdBaseFile { }; #endif // SdBaseFile_h -#endif diff --git a/ArduinoAddons/Arduino_1.0.x/libraries/SdFat/SdFat.h b/ArduinoAddons/Arduino_1.0.x/libraries/SdFat/SdFat.h new file mode 100644 index 000000000..2eca03499 --- /dev/null +++ b/ArduinoAddons/Arduino_1.0.x/libraries/SdFat/SdFat.h @@ -0,0 +1,5 @@ +#ifndef AT90USB +#define HardwareSerial_h // trick to disable the standard HWserial +#endif + +#include diff --git a/ArduinoAddons/Arduino_1.0.x/libraries/SdFat/SdFatConfig.h b/ArduinoAddons/Arduino_1.0.x/libraries/SdFat/SdFatConfig.h index 24caf6f3e..406a5a5be 100644 --- a/ArduinoAddons/Arduino_1.0.x/libraries/SdFat/SdFatConfig.h +++ b/ArduinoAddons/Arduino_1.0.x/libraries/SdFat/SdFatConfig.h @@ -21,9 +21,6 @@ * \file * \brief configuration definitions */ -#include "Marlin.h" -#ifdef SDSUPPORT - #ifndef SdFatConfig_h #define SdFatConfig_h #include @@ -118,6 +115,3 @@ uint8_t const SOFT_SPI_SCK_PIN = 13; /** Total size of the buffer used to store the long filenames */ #define LONG_FILENAME_LENGTH (13*MAX_VFAT_ENTRIES+1) #endif // SdFatConfig_h - - -#endif diff --git a/ArduinoAddons/Arduino_1.0.x/libraries/SdFat/SdFatStructs.h b/ArduinoAddons/Arduino_1.0.x/libraries/SdFat/SdFatStructs.h index 386721616..899131655 100644 --- a/ArduinoAddons/Arduino_1.0.x/libraries/SdFat/SdFatStructs.h +++ b/ArduinoAddons/Arduino_1.0.x/libraries/SdFat/SdFatStructs.h @@ -17,9 +17,6 @@ * along with the Arduino SdFat Library. If not, see * . */ -#include "Marlin.h" -#ifdef SDSUPPORT - #ifndef SdFatStructs_h #define SdFatStructs_h @@ -641,6 +638,3 @@ static inline uint8_t DIR_IS_FILE_OR_SUBDIR(const dir_t* dir) { return (dir->attributes & DIR_ATT_VOLUME_ID) == 0; } #endif // SdFatStructs_h - - -#endif diff --git a/ArduinoAddons/Arduino_1.0.x/libraries/SdFat/SdFatUtil.cpp b/ArduinoAddons/Arduino_1.0.x/libraries/SdFat/SdFatUtil.cpp index 32cd198b6..f6c825a49 100644 --- a/ArduinoAddons/Arduino_1.0.x/libraries/SdFat/SdFatUtil.cpp +++ b/ArduinoAddons/Arduino_1.0.x/libraries/SdFat/SdFatUtil.cpp @@ -17,9 +17,8 @@ * along with the Arduino SdFat Library. If not, see * . */ -#include "Marlin.h" - -#ifdef SDSUPPORT +#include "SdFat.h" +#include #include "SdFatUtil.h" //------------------------------------------------------------------------------ @@ -50,7 +49,8 @@ int SdFatUtil::FreeRam() { * \param[in] pr Print object for output. * \param[in] str Pointer to string stored in flash memory. */ -void SdFatUtil::print_P( PGM_P str) { +void SdFatUtil::print_P( Print *p, PGM_P str) { + Print &MYSERIAL = *p; for (uint8_t c; (c = pgm_read_byte(str)); str++) MYSERIAL.write(c); } //------------------------------------------------------------------------------ @@ -59,8 +59,9 @@ void SdFatUtil::print_P( PGM_P str) { * \param[in] pr Print object for output. * \param[in] str Pointer to string stored in flash memory. */ -void SdFatUtil::println_P( PGM_P str) { - print_P( str); +void SdFatUtil::println_P( Print *p, PGM_P str) { + Print &MYSERIAL = *p; + print_P( p, str); MYSERIAL.println(); } //------------------------------------------------------------------------------ @@ -68,15 +69,14 @@ void SdFatUtil::println_P( PGM_P str) { * * \param[in] str Pointer to string stored in flash memory. */ -void SdFatUtil::SerialPrint_P(PGM_P str) { - print_P(str); +void SdFatUtil::SerialPrint_P( Print *p, PGM_P str) { + print_P(p, str); } //------------------------------------------------------------------------------ /** %Print a string in flash memory to Serial followed by a CR/LF. * * \param[in] str Pointer to string stored in flash memory. */ -void SdFatUtil::SerialPrintln_P(PGM_P str) { - println_P( str); +void SdFatUtil::SerialPrintln_P(Print *p, PGM_P str) { + println_P( p, str); } -#endif diff --git a/ArduinoAddons/Arduino_1.0.x/libraries/SdFat/SdFatUtil.h b/ArduinoAddons/Arduino_1.0.x/libraries/SdFat/SdFatUtil.h index 7f1809422..4265d8c42 100644 --- a/ArduinoAddons/Arduino_1.0.x/libraries/SdFat/SdFatUtil.h +++ b/ArduinoAddons/Arduino_1.0.x/libraries/SdFat/SdFatUtil.h @@ -17,32 +17,19 @@ * along with the Arduino SdFat Library. If not, see * . */ -#include "Marlin.h" -#ifdef SDSUPPORT - #ifndef SdFatUtil_h #define SdFatUtil_h /** * \file * \brief Useful utility functions. */ -#include "Marlin.h" -#include "MarlinSerial.h" -/** Store and print a string in flash memory.*/ -#define PgmPrint(x) SerialPrint_P(PSTR(x)) -/** Store and print a string in flash memory followed by a CR/LF.*/ -#define PgmPrintln(x) SerialPrintln_P(PSTR(x)) namespace SdFatUtil { int FreeRam(); - void print_P( PGM_P str); - void println_P( PGM_P str); - void SerialPrint_P(PGM_P str); - void SerialPrintln_P(PGM_P str); + void print_P( Print *p, PGM_P str); + void println_P( Print *p, PGM_P str); + void SerialPrint_P(Print *p, PGM_P str); + void SerialPrintln_P(Print *p, PGM_P str); } - using namespace SdFatUtil; // NOLINT #endif // #define SdFatUtil_h - - -#endif \ No newline at end of file diff --git a/ArduinoAddons/Arduino_1.0.x/libraries/SdFat/SdFile.cpp b/ArduinoAddons/Arduino_1.0.x/libraries/SdFat/SdFile.cpp index 29f5efadc..09e2fbaef 100644 --- a/ArduinoAddons/Arduino_1.0.x/libraries/SdFat/SdFile.cpp +++ b/ArduinoAddons/Arduino_1.0.x/libraries/SdFat/SdFile.cpp @@ -17,9 +17,6 @@ * along with the Arduino SdFat Library. If not, see * . */ -#include "Marlin.h" - -#ifdef SDSUPPORT #include "SdFile.h" /** Create a file object and open it in the current working directory. * @@ -90,6 +87,3 @@ void SdFile::writeln_P(PGM_P str) { write_P(str); write_P(PSTR("\r\n")); } - - -#endif diff --git a/ArduinoAddons/Arduino_1.0.x/libraries/SdFat/SdFile.h b/ArduinoAddons/Arduino_1.0.x/libraries/SdFat/SdFile.h index cbf1bbdbd..f0611c475 100644 --- a/ArduinoAddons/Arduino_1.0.x/libraries/SdFat/SdFile.h +++ b/ArduinoAddons/Arduino_1.0.x/libraries/SdFat/SdFile.h @@ -21,9 +21,6 @@ * \file * \brief SdFile class */ -#include "Marlin.h" - -#ifdef SDSUPPORT #include "SdBaseFile.h" #include #ifndef SdFile_h @@ -49,6 +46,3 @@ class SdFile : public SdBaseFile, public Print { void writeln_P(PGM_P str); }; #endif // SdFile_h - - -#endif \ No newline at end of file diff --git a/ArduinoAddons/Arduino_1.0.x/libraries/SdFat/SdInfo.h b/ArduinoAddons/Arduino_1.0.x/libraries/SdFat/SdInfo.h index 03ece1022..2a58eb7db 100644 --- a/ArduinoAddons/Arduino_1.0.x/libraries/SdFat/SdInfo.h +++ b/ArduinoAddons/Arduino_1.0.x/libraries/SdFat/SdInfo.h @@ -17,9 +17,6 @@ * along with the Arduino Sd2Card Library. If not, see * . */ -#include "Marlin.h" -#ifdef SDSUPPORT - #ifndef SdInfo_h #define SdInfo_h #include @@ -276,5 +273,3 @@ union csd_t { csd2_t v2; }; #endif // SdInfo_h - -#endif \ No newline at end of file diff --git a/ArduinoAddons/Arduino_1.0.x/libraries/SdFat/SdVolume.cpp b/ArduinoAddons/Arduino_1.0.x/libraries/SdFat/SdVolume.cpp index f14d7bc70..3c84c1881 100644 --- a/ArduinoAddons/Arduino_1.0.x/libraries/SdFat/SdVolume.cpp +++ b/ArduinoAddons/Arduino_1.0.x/libraries/SdFat/SdVolume.cpp @@ -17,9 +17,7 @@ * along with the Arduino SdFat Library. If not, see * . */ -#include "Marlin.h" -#ifdef SDSUPPORT - +#include "SdFat.h" #include "SdVolume.h" //------------------------------------------------------------------------------ #if !USE_MULTIPLE_CARDS @@ -402,4 +400,3 @@ bool SdVolume::init(Sd2Card* dev, uint8_t part) { fail: return false; } -#endif \ No newline at end of file diff --git a/ArduinoAddons/Arduino_1.0.x/libraries/SdFat/SdVolume.h b/ArduinoAddons/Arduino_1.0.x/libraries/SdFat/SdVolume.h index 2ff2b6eb9..0f2e55ab2 100644 --- a/ArduinoAddons/Arduino_1.0.x/libraries/SdFat/SdVolume.h +++ b/ArduinoAddons/Arduino_1.0.x/libraries/SdFat/SdVolume.h @@ -17,8 +17,6 @@ * along with the Arduino SdFat Library. If not, see * . */ -#include "Marlin.h" -#ifdef SDSUPPORT #ifndef SdVolume_h #define SdVolume_h /** @@ -211,4 +209,3 @@ class SdVolume { #endif // ALLOW_DEPRECATED_FUNCTIONS }; #endif // SdVolume -#endif \ No newline at end of file diff --git a/Marlin/Marlin.pde b/Marlin/Marlin.pde index 79c934bf0..f65681f59 100644 --- a/Marlin/Marlin.pde +++ b/Marlin/Marlin.pde @@ -54,3 +54,8 @@ #if defined(DIGIPOT_I2C) #include #endif + +#if defined(HEATER_0_USES_MAX6675) || defined(SDSUPPORT) +#include +#endif + diff --git a/Marlin/temperature.cpp b/Marlin/temperature.cpp index 7acc5ffd8..5d966f25f 100644 --- a/Marlin/temperature.cpp +++ b/Marlin/temperature.cpp @@ -34,8 +34,9 @@ #include "temperature.h" #include "watchdog.h" -#include "Sd2PinMap.h" - +#ifdef HEATER_0_USES_MAX6675 +//#include +#endif //=========================================================================== //=============================public variables============================ From db3b4d0c98c0478852f1eefa3c66b4641f048f3c Mon Sep 17 00:00:00 2001 From: odewdney Date: Tue, 13 Jan 2015 14:19:20 +0000 Subject: [PATCH 3/5] Add library to build --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index 8a378c787..5befa5f46 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,6 +26,9 @@ before_script: - cd $TRAVIS_BUILD_DIR # ino needs files in src directory - ln -s Marlin src + - mkdir lib + - ln -s ..\ArduinoAddons\Arduino_1.0.x\libraries\SdFat lib\SdFat + - ls -la lib\SdFat # remove Marlin.pde as it confuses ino after it finds Marlin.ino - rm Marlin/Marlin.pde script: From abdb974d7ffbd8741a6ce6b1304fc8f886103830 Mon Sep 17 00:00:00 2001 From: odewdney Date: Tue, 13 Jan 2015 14:22:57 +0000 Subject: [PATCH 4/5] Changed dir sep from windows to unix --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5befa5f46..14532987a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,8 +27,8 @@ before_script: # ino needs files in src directory - ln -s Marlin src - mkdir lib - - ln -s ..\ArduinoAddons\Arduino_1.0.x\libraries\SdFat lib\SdFat - - ls -la lib\SdFat + - ln -s ../ArduinoAddons/Arduino_1.0.x/libraries/SdFat lib/SdFat + - ls -la lib/SdFat # remove Marlin.pde as it confuses ino after it finds Marlin.ino - rm Marlin/Marlin.pde script: From cf50c0eff8472ff922f217e7ed94393a85428a20 Mon Sep 17 00:00:00 2001 From: odewdney Date: Tue, 13 Jan 2015 14:30:28 +0000 Subject: [PATCH 5/5] Arduino.h case sensitive include --- ArduinoAddons/Arduino_1.0.x/libraries/SdFat/SdFat.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ArduinoAddons/Arduino_1.0.x/libraries/SdFat/SdFat.h b/ArduinoAddons/Arduino_1.0.x/libraries/SdFat/SdFat.h index 2eca03499..77c1d0d5e 100644 --- a/ArduinoAddons/Arduino_1.0.x/libraries/SdFat/SdFat.h +++ b/ArduinoAddons/Arduino_1.0.x/libraries/SdFat/SdFat.h @@ -2,4 +2,4 @@ #define HardwareSerial_h // trick to disable the standard HWserial #endif -#include +#include