Browse Source

Revert "Move Sd library out into library"

galexander1 10 years ago
parent
commit
d4880a9e60

+ 0
- 3
.travis.yml View File

@@ -26,9 +26,6 @@ before_script:
26 26
   - cd $TRAVIS_BUILD_DIR
27 27
   # ino needs files in src directory
28 28
   - ln -s Marlin src
29
-  - mkdir lib
30
-  - ln -s ../ArduinoAddons/Arduino_1.0.x/libraries/SdFat lib/SdFat
31
-  - ls -la lib/SdFat
32 29
   # remove Marlin.pde as it confuses ino after it finds Marlin.ino
33 30
   - rm Marlin/Marlin.pde
34 31
 script:

+ 0
- 5
ArduinoAddons/Arduino_1.0.x/libraries/SdFat/SdFat.h View File

@@ -1,5 +0,0 @@
1
-#ifndef AT90USB
2
-#define  HardwareSerial_h // trick to disable the standard HWserial
3
-#endif
4
-
5
-#include <Arduino.h>

+ 0
- 5
Marlin/Marlin.pde View File

@@ -54,8 +54,3 @@
54 54
 #if defined(DIGIPOT_I2C)
55 55
   #include <Wire.h>
56 56
 #endif
57
-
58
-#if defined(HEATER_0_USES_MAX6675) || defined(SDSUPPORT)
59
-#include <Sd2Card.h>
60
-#endif
61
-

ArduinoAddons/Arduino_1.0.x/libraries/SdFat/Sd2Card.cpp → Marlin/Sd2Card.cpp View File

@@ -17,8 +17,9 @@
17 17
  * along with the Arduino Sd2Card Library.  If not, see
18 18
  * <http://www.gnu.org/licenses/>.
19 19
  */
20
-#include "SdFat.h"
20
+#include "Marlin.h"
21 21
 
22
+#ifdef SDSUPPORT
22 23
 #include "Sd2Card.h"
23 24
 //------------------------------------------------------------------------------
24 25
 #ifndef SOFTWARE_SPI
@@ -718,3 +719,5 @@ bool Sd2Card::writeStop() {
718 719
   chipSelectHigh();
719 720
   return false;
720 721
 }
722
+
723
+#endif

ArduinoAddons/Arduino_1.0.x/libraries/SdFat/Sd2Card.h → Marlin/Sd2Card.h View File

@@ -18,6 +18,9 @@
18 18
  * <http://www.gnu.org/licenses/>.
19 19
  */
20 20
 
21
+#include "Marlin.h"
22
+#ifdef SDSUPPORT
23
+
21 24
 #ifndef Sd2Card_h
22 25
 #define Sd2Card_h
23 26
 /**
@@ -235,3 +238,6 @@ class Sd2Card {
235 238
   bool writeData(uint8_t token, const uint8_t* src);
236 239
 };
237 240
 #endif  // Sd2Card_h
241
+
242
+
243
+#endif

ArduinoAddons/Arduino_1.0.x/libraries/SdFat/Sd2PinMap.h → Marlin/Sd2PinMap.h View File

@@ -18,6 +18,9 @@
18 18
  * <http://www.gnu.org/licenses/>.
19 19
  */
20 20
 // Warning this file was generated by a program.
21
+#include "Marlin.h"
22
+#ifdef SDSUPPORT
23
+
21 24
 #ifndef Sd2PinMap_h
22 25
 #define Sd2PinMap_h
23 26
 #include <avr/io.h>
@@ -360,3 +363,6 @@ static inline __attribute__((always_inline))
360 363
   }
361 364
 }
362 365
 #endif  // Sd2PinMap_h
366
+
367
+
368
+#endif

ArduinoAddons/Arduino_1.0.x/libraries/SdFat/SdBaseFile.cpp → Marlin/SdBaseFile.cpp View File

@@ -17,8 +17,9 @@
17 17
  * along with the Arduino SdFat Library.  If not, see
18 18
  * <http://www.gnu.org/licenses/>.
19 19
  */
20
-#include "SdFat.h"
21
-#include <Print.h>
20
+
21
+#include "Marlin.h"
22
+#ifdef SDSUPPORT
22 23
 
23 24
 #include "SdBaseFile.h"
24 25
 //------------------------------------------------------------------------------
@@ -314,14 +315,14 @@ void SdBaseFile::getpos(fpos_t* pos) {
314 315
  * \param[in] indent Amount of space before file name. Used for recursive
315 316
  * list to indicate subdirectory level.
316 317
  */
317
-void SdBaseFile::ls(Print *p, uint8_t flags, uint8_t indent) {
318
+void SdBaseFile::ls(uint8_t flags, uint8_t indent) {
318 319
   rewind();
319 320
   int8_t status;
320
-  while ((status = lsPrintNext( p, flags, indent))) {
321
+  while ((status = lsPrintNext( flags, indent))) {
321 322
     if (status > 1 && (flags & LS_R)) {
322 323
       uint16_t index = curPosition()/32 - 1;
323 324
       SdBaseFile s;
324
-      if (s.open(this, index, O_READ)) s.ls( p, flags, indent + 2);
325
+      if (s.open(this, index, O_READ)) s.ls( flags, indent + 2);
325 326
       seekSet(32 * (index + 1));
326 327
     }
327 328
   }
@@ -329,8 +330,7 @@ void SdBaseFile::ls(Print *p, uint8_t flags, uint8_t indent) {
329 330
 //------------------------------------------------------------------------------
330 331
 // saves 32 bytes on stack for ls recursion
331 332
 // return 0 - EOF, 1 - normal file, or 2 - directory
332
-int8_t SdBaseFile::lsPrintNext( Print *p, uint8_t flags, uint8_t indent) {
333
-	Print &MYSERIAL = *p;
333
+int8_t SdBaseFile::lsPrintNext( uint8_t flags, uint8_t indent) {
334 334
   dir_t dir;
335 335
   uint8_t w = 0;
336 336
 
@@ -365,9 +365,9 @@ int8_t SdBaseFile::lsPrintNext( Print *p, uint8_t flags, uint8_t indent) {
365 365
   // print modify date/time if requested
366 366
   if (flags & LS_DATE) {
367 367
     MYSERIAL.write(' ');
368
-    printFatDate( p, dir.lastWriteDate);
368
+    printFatDate( dir.lastWriteDate);
369 369
     MYSERIAL.write(' ');
370
-    printFatTime( p, dir.lastWriteTime);
370
+    printFatTime( dir.lastWriteTime);
371 371
   }
372 372
   // print size if requested
373 373
   if (!DIR_IS_SUBDIR(&dir) && (flags & LS_SIZE)) {
@@ -939,8 +939,8 @@ int SdBaseFile::peek() {
939 939
  * \param[in] width Blank fill name if length is less than \a width.
940 940
  * \param[in] printSlash Print '/' after directory names if true.
941 941
  */
942
-void SdBaseFile::printDirName(Print *p, const dir_t& dir, uint8_t width, bool printSlash) {
943
-		Print &MYSERIAL = *p;
942
+void SdBaseFile::printDirName(const dir_t& dir,
943
+  uint8_t width, bool printSlash) {
944 944
   uint8_t w = 0;
945 945
   for (uint8_t i = 0; i < 11; i++) {
946 946
     if (dir.name[i] == ' ')continue;
@@ -962,8 +962,7 @@ void SdBaseFile::printDirName(Print *p, const dir_t& dir, uint8_t width, bool pr
962 962
 }
963 963
 //------------------------------------------------------------------------------
964 964
 // print uint8_t with width 2
965
-static void print2u( Print *p, uint8_t v) {
966
-	Print &MYSERIAL = *p;
965
+static void print2u( uint8_t v) {
967 966
   if (v < 10) MYSERIAL.write('0');
968 967
   MYSERIAL.print(v, DEC);
969 968
 }
@@ -983,14 +982,12 @@ static void print2u( Print *p, uint8_t v) {
983 982
  * \param[in] pr Print stream for output.
984 983
  * \param[in] fatDate The date field from a directory entry.
985 984
  */
986
-void SdBaseFile::printFatDate(Print *p, uint16_t fatDate) {
987
-	Print &MYSERIAL = *p;
988
-
985
+void SdBaseFile::printFatDate(uint16_t fatDate) {
989 986
   MYSERIAL.print(FAT_YEAR(fatDate));
990 987
   MYSERIAL.write('-');
991
-  print2u( p, FAT_MONTH(fatDate));
988
+  print2u( FAT_MONTH(fatDate));
992 989
   MYSERIAL.write('-');
993
-  print2u( p, FAT_DAY(fatDate));
990
+  print2u( FAT_DAY(fatDate));
994 991
 }
995 992
 
996 993
 //------------------------------------------------------------------------------
@@ -1001,14 +998,12 @@ void SdBaseFile::printFatDate(Print *p, uint16_t fatDate) {
1001 998
  * \param[in] pr Print stream for output.
1002 999
  * \param[in] fatTime The time field from a directory entry.
1003 1000
  */
1004
-void SdBaseFile::printFatTime( Print *p, uint16_t fatTime) {
1005
-	Print &MYSERIAL = *p;
1006
-
1007
-  print2u( p, FAT_HOUR(fatTime));
1001
+void SdBaseFile::printFatTime( uint16_t fatTime) {
1002
+  print2u( FAT_HOUR(fatTime));
1008 1003
   MYSERIAL.write(':');
1009
-  print2u( p, FAT_MINUTE(fatTime));
1004
+  print2u( FAT_MINUTE(fatTime));
1010 1005
   MYSERIAL.write(':');
1011
-  print2u( p, FAT_SECOND(fatTime));
1006
+  print2u( FAT_SECOND(fatTime));
1012 1007
 }
1013 1008
 //------------------------------------------------------------------------------
1014 1009
 /** Print a file's name to Serial
@@ -1016,8 +1011,7 @@ void SdBaseFile::printFatTime( Print *p, uint16_t fatTime) {
1016 1011
  * \return The value one, true, is returned for success and
1017 1012
  * the value zero, false, is returned for failure.
1018 1013
  */
1019
-bool SdBaseFile::printName(Print *p) {
1020
-	Print &MYSERIAL = *p;
1014
+bool SdBaseFile::printName() {
1021 1015
   char name[13];
1022 1016
   if (!getFilename(name)) return false;
1023 1017
   MYSERIAL.print(name);
@@ -1826,3 +1820,6 @@ int16_t SdBaseFile::write(const void* buf, uint16_t nbyte) {
1826 1820
 #if ALLOW_DEPRECATED_FUNCTIONS && !defined(DOXYGEN)
1827 1821
 void (*SdBaseFile::oldDateTime_)(uint16_t& date, uint16_t& time) = 0;  // NOLINT
1828 1822
 #endif  // ALLOW_DEPRECATED_FUNCTIONS
1823
+
1824
+
1825
+#endif

ArduinoAddons/Arduino_1.0.x/libraries/SdFat/SdBaseFile.h → Marlin/SdBaseFile.h View File

@@ -17,12 +17,16 @@
17 17
  * along with the Arduino SdFat Library.  If not, see
18 18
  * <http://www.gnu.org/licenses/>.
19 19
  */
20
+#include "Marlin.h"
21
+#ifdef SDSUPPORT
22
+
20 23
 #ifndef SdBaseFile_h
21 24
 #define SdBaseFile_h
22 25
 /**
23 26
  * \file
24 27
  * \brief SdBaseFile class
25 28
  */
29
+#include "Marlin.h"
26 30
 #include "SdFatConfig.h"
27 31
 #include "SdVolume.h"
28 32
 //------------------------------------------------------------------------------
@@ -170,8 +174,6 @@ static inline uint8_t FAT_SECOND(uint16_t fatTime) {
170 174
 uint16_t const FAT_DEFAULT_DATE = ((2000 - 1980) << 9) | (1 << 5) | 1;
171 175
 /** Default time for file timestamp is 1 am */
172 176
 uint16_t const FAT_DEFAULT_TIME = (1 << 11);
173
-
174
-class Print;
175 177
 //------------------------------------------------------------------------------
176 178
 /**
177 179
  * \class SdBaseFile
@@ -264,7 +266,7 @@ class SdBaseFile {
264 266
   bool isRoot() const {
265 267
     return type_ == FAT_FILE_TYPE_ROOT_FIXED || type_ == FAT_FILE_TYPE_ROOT32;
266 268
   }
267
-  void ls( Print *p, uint8_t flags = 0, uint8_t indent = 0);
269
+  void ls( uint8_t flags = 0, uint8_t indent = 0);
268 270
   bool mkdir(SdBaseFile* dir, const char* path, bool pFlag = true);
269 271
   // alias for backward compactability
270 272
   bool makeDir(SdBaseFile* dir, const char* path) {
@@ -276,9 +278,9 @@ class SdBaseFile {
276 278
   bool openNext(SdBaseFile* dirFile, uint8_t oflag);
277 279
   bool openRoot(SdVolume* vol);
278 280
   int peek();
279
-  static void printFatDate(Print *p, uint16_t fatDate);
280
-  static void printFatTime(Print *p, uint16_t fatTime);
281
-  bool printName(Print *p);
281
+  static void printFatDate(uint16_t fatDate);
282
+  static void printFatTime( uint16_t fatTime);
283
+  bool printName();
282 284
   int16_t read();
283 285
   int16_t read(void* buf, uint16_t nbyte);
284 286
   int8_t readDir(dir_t* dir, char* longFilename);
@@ -350,7 +352,7 @@ class SdBaseFile {
350 352
   bool addCluster();
351 353
   bool addDirCluster();
352 354
   dir_t* cacheDirEntry(uint8_t action);
353
-  int8_t lsPrintNext( Print *p, uint8_t flags, uint8_t indent);
355
+  int8_t lsPrintNext( uint8_t flags, uint8_t indent);
354 356
   static bool make83Name(const char* str, uint8_t* name, const char** ptr);
355 357
   bool mkdir(SdBaseFile* parent, const uint8_t dname[11]);
356 358
   bool open(SdBaseFile* dirFile, const uint8_t dname[11], uint8_t oflag);
@@ -358,7 +360,7 @@ class SdBaseFile {
358 360
   dir_t* readDirCache();
359 361
 //------------------------------------------------------------------------------
360 362
 // to be deleted
361
-  static void printDirName( Print *p, const dir_t& dir,
363
+  static void printDirName( const dir_t& dir,
362 364
     uint8_t width, bool printSlash);
363 365
 //------------------------------------------------------------------------------
364 366
 // Deprecated functions  - suppress cpplint warnings with NOLINT comment
@@ -478,3 +480,4 @@ class SdBaseFile {
478 480
 };
479 481
 
480 482
 #endif  // SdBaseFile_h
483
+#endif

ArduinoAddons/Arduino_1.0.x/libraries/SdFat/SdFatConfig.h → Marlin/SdFatConfig.h View File

@@ -21,6 +21,9 @@
21 21
  * \file
22 22
  * \brief configuration definitions
23 23
  */
24
+#include "Marlin.h"
25
+#ifdef SDSUPPORT
26
+
24 27
 #ifndef SdFatConfig_h
25 28
 #define SdFatConfig_h
26 29
 #include <stdint.h>
@@ -115,3 +118,6 @@ uint8_t const SOFT_SPI_SCK_PIN = 13;
115 118
 /** Total size of the buffer used to store the long filenames */
116 119
 #define LONG_FILENAME_LENGTH (13*MAX_VFAT_ENTRIES+1)
117 120
 #endif  // SdFatConfig_h
121
+
122
+
123
+#endif

ArduinoAddons/Arduino_1.0.x/libraries/SdFat/SdFatStructs.h → Marlin/SdFatStructs.h View File

@@ -17,6 +17,9 @@
17 17
  * along with the Arduino SdFat Library.  If not, see
18 18
  * <http://www.gnu.org/licenses/>.
19 19
  */
20
+#include "Marlin.h"
21
+#ifdef SDSUPPORT
22
+
20 23
 #ifndef SdFatStructs_h
21 24
 #define SdFatStructs_h
22 25
 
@@ -638,3 +641,6 @@ static inline uint8_t DIR_IS_FILE_OR_SUBDIR(const dir_t* dir) {
638 641
   return (dir->attributes & DIR_ATT_VOLUME_ID) == 0;
639 642
 }
640 643
 #endif  // SdFatStructs_h
644
+
645
+
646
+#endif

ArduinoAddons/Arduino_1.0.x/libraries/SdFat/SdFatUtil.cpp → Marlin/SdFatUtil.cpp View File

@@ -17,8 +17,9 @@
17 17
  * along with the Arduino SdFat Library.  If not, see
18 18
  * <http://www.gnu.org/licenses/>.
19 19
  */
20
-#include "SdFat.h"
21
-#include <Print.h>
20
+#include "Marlin.h"
21
+
22
+#ifdef SDSUPPORT
22 23
 #include "SdFatUtil.h"
23 24
 
24 25
 //------------------------------------------------------------------------------
@@ -49,8 +50,7 @@ int SdFatUtil::FreeRam() {
49 50
  * \param[in] pr Print object for output.
50 51
  * \param[in] str Pointer to string stored in flash memory.
51 52
  */
52
-void SdFatUtil::print_P( Print *p, PGM_P str) {
53
-	Print &MYSERIAL = *p;
53
+void SdFatUtil::print_P( PGM_P str) {
54 54
   for (uint8_t c; (c = pgm_read_byte(str)); str++) MYSERIAL.write(c);
55 55
 }
56 56
 //------------------------------------------------------------------------------
@@ -59,9 +59,8 @@ void SdFatUtil::print_P( Print *p, PGM_P str) {
59 59
  * \param[in] pr Print object for output.
60 60
  * \param[in] str Pointer to string stored in flash memory.
61 61
  */
62
-void SdFatUtil::println_P( Print *p, PGM_P str) {
63
-	Print &MYSERIAL = *p;
64
-  print_P( p, str);
62
+void SdFatUtil::println_P( PGM_P str) {
63
+  print_P( str);
65 64
   MYSERIAL.println();
66 65
 }
67 66
 //------------------------------------------------------------------------------
@@ -69,14 +68,15 @@ void SdFatUtil::println_P( Print *p, PGM_P str) {
69 68
  *
70 69
  * \param[in] str Pointer to string stored in flash memory.
71 70
  */
72
-void SdFatUtil::SerialPrint_P( Print *p, PGM_P str) {
73
-  print_P(p, str);
71
+void SdFatUtil::SerialPrint_P(PGM_P str) {
72
+  print_P(str);
74 73
 }
75 74
 //------------------------------------------------------------------------------
76 75
 /** %Print a string in flash memory to Serial followed by a CR/LF.
77 76
  *
78 77
  * \param[in] str Pointer to string stored in flash memory.
79 78
  */
80
-void SdFatUtil::SerialPrintln_P(Print *p, PGM_P str) {
81
-  println_P( p, str);
79
+void SdFatUtil::SerialPrintln_P(PGM_P str) {
80
+  println_P( str);
82 81
 }
82
+#endif

ArduinoAddons/Arduino_1.0.x/libraries/SdFat/SdFatUtil.h → Marlin/SdFatUtil.h View File

@@ -17,19 +17,32 @@
17 17
  * along with the Arduino SdFat Library.  If not, see
18 18
  * <http://www.gnu.org/licenses/>.
19 19
  */
20
+#include "Marlin.h"
21
+#ifdef SDSUPPORT
22
+
20 23
 #ifndef SdFatUtil_h
21 24
 #define SdFatUtil_h
22 25
 /**
23 26
  * \file
24 27
  * \brief Useful utility functions.
25 28
  */
29
+#include "Marlin.h"
30
+#include "MarlinSerial.h"
31
+/** Store and print a string in flash memory.*/
32
+#define PgmPrint(x) SerialPrint_P(PSTR(x))
33
+/** Store and print a string in flash memory followed by a CR/LF.*/
34
+#define PgmPrintln(x) SerialPrintln_P(PSTR(x))
26 35
 
27 36
 namespace SdFatUtil {
28 37
   int FreeRam();
29
-  void print_P( Print *p, PGM_P str);
30
-  void println_P( Print *p, PGM_P str);
31
-  void SerialPrint_P(Print *p, PGM_P str);
32
-  void SerialPrintln_P(Print *p, PGM_P str);
38
+  void print_P( PGM_P str);
39
+  void println_P( PGM_P str);
40
+  void SerialPrint_P(PGM_P str);
41
+  void SerialPrintln_P(PGM_P str);
33 42
 }
43
+
34 44
 using namespace SdFatUtil;  // NOLINT
35 45
 #endif  // #define SdFatUtil_h
46
+
47
+
48
+#endif

ArduinoAddons/Arduino_1.0.x/libraries/SdFat/SdFile.cpp → Marlin/SdFile.cpp View File

@@ -17,6 +17,9 @@
17 17
  * along with the Arduino SdFat Library.  If not, see
18 18
  * <http://www.gnu.org/licenses/>.
19 19
  */
20
+#include "Marlin.h"
21
+
22
+#ifdef SDSUPPORT
20 23
 #include "SdFile.h"
21 24
 /**  Create a file object and open it in the current working directory.
22 25
  *
@@ -87,3 +90,6 @@ void SdFile::writeln_P(PGM_P str) {
87 90
   write_P(str);
88 91
   write_P(PSTR("\r\n"));
89 92
 }
93
+
94
+
95
+#endif

ArduinoAddons/Arduino_1.0.x/libraries/SdFat/SdFile.h → Marlin/SdFile.h View File

@@ -21,6 +21,9 @@
21 21
  * \file
22 22
  * \brief SdFile class
23 23
  */
24
+#include "Marlin.h"
25
+
26
+#ifdef SDSUPPORT
24 27
 #include "SdBaseFile.h"
25 28
 #include <Print.h>
26 29
 #ifndef SdFile_h
@@ -46,3 +49,6 @@ class SdFile : public SdBaseFile, public Print {
46 49
   void writeln_P(PGM_P str);
47 50
 };
48 51
 #endif  // SdFile_h
52
+
53
+
54
+#endif

ArduinoAddons/Arduino_1.0.x/libraries/SdFat/SdInfo.h → Marlin/SdInfo.h View File

@@ -17,6 +17,9 @@
17 17
  * along with the Arduino Sd2Card Library.  If not, see
18 18
  * <http://www.gnu.org/licenses/>.
19 19
  */
20
+#include "Marlin.h"
21
+#ifdef SDSUPPORT
22
+
20 23
 #ifndef SdInfo_h
21 24
 #define SdInfo_h
22 25
 #include <stdint.h>
@@ -273,3 +276,5 @@ union csd_t {
273 276
   csd2_t v2;
274 277
 };
275 278
 #endif  // SdInfo_h
279
+
280
+#endif

ArduinoAddons/Arduino_1.0.x/libraries/SdFat/SdVolume.cpp → Marlin/SdVolume.cpp View File

@@ -17,7 +17,9 @@
17 17
  * along with the Arduino SdFat Library.  If not, see
18 18
  * <http://www.gnu.org/licenses/>.
19 19
  */
20
-#include "SdFat.h"
20
+#include "Marlin.h"
21
+#ifdef SDSUPPORT
22
+
21 23
 #include "SdVolume.h"
22 24
 //------------------------------------------------------------------------------
23 25
 #if !USE_MULTIPLE_CARDS
@@ -400,3 +402,4 @@ bool SdVolume::init(Sd2Card* dev, uint8_t part) {
400 402
  fail:
401 403
   return false;
402 404
 }
405
+#endif

ArduinoAddons/Arduino_1.0.x/libraries/SdFat/SdVolume.h → Marlin/SdVolume.h View File

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

+ 2
- 3
Marlin/temperature.cpp View File

@@ -35,9 +35,8 @@
35 35
 #include "watchdog.h"
36 36
 #include "thermistortables.h"
37 37
 
38
-#ifdef HEATER_0_USES_MAX6675
39
-//#include <Sd2PinMap.h>
40
-#endif
38
+#include "Sd2PinMap.h"
39
+
41 40
 
42 41
 //===========================================================================
43 42
 //=============================public variables============================

Loading…
Cancel
Save