Browse Source

make it compile with arduino 1.0 ; function is still untested.

Bernhard 13 years ago
parent
commit
0bc9daa4f7
8 changed files with 675 additions and 651 deletions
  1. 6
    1
      Marlin/Marlin.h
  2. 5
    1
      Marlin/MarlinSerial.cpp
  3. 642
    642
      Marlin/Sd2Card.cpp
  4. 2
    2
      Marlin/SdBaseFile.h
  5. 3
    2
      Marlin/SdFatUtil.h
  6. 6
    1
      Marlin/SdFile.cpp
  7. 6
    1
      Marlin/SdFile.h
  8. 5
    1
      Marlin/planner.h

+ 6
- 1
Marlin/Marlin.h View File

@@ -5,7 +5,12 @@
5 5
 // Licence: GPL
6 6
 #define  HardwareSerial_h // trick to disable the standard HWserial
7 7
 #include <math.h>
8
-#include <WProgram.h>
8
+#if ARDUINO >= 100
9
+  #include "Arduino.h"
10
+#else
11
+   #include "WProgram.h"
12
+#endif
13
+
9 14
 #include "fastio.h"
10 15
 #include <avr/pgmspace.h>
11 16
 #include "Configuration.h"

+ 5
- 1
Marlin/MarlinSerial.cpp View File

@@ -25,7 +25,11 @@
25 25
 #include <string.h>
26 26
 #include <inttypes.h>
27 27
 #include <math.h>
28
-#include "wiring.h"
28
+#if ARDUINO >= 100
29
+  #include "Arduino.h"
30
+#else
31
+   #include "wiring.h"
32
+#endif
29 33
 #include "wiring_private.h"
30 34
 
31 35
 // this next line disables the entire HardwareSerial.cpp, 

+ 642
- 642
Marlin/Sd2Card.cpp
File diff suppressed because it is too large
View File


+ 2
- 2
Marlin/SdBaseFile.h View File

@@ -24,13 +24,13 @@
24 24
  * \brief SdBaseFile class
25 25
  */
26 26
 #include <avr/pgmspace.h>
27
-#if ARDUINO < 100
28 27
 #define  HardwareSerial_h // trick to disable the standard HWserial
28
+#if ARDUINO < 100
29 29
 #include <WProgram.h>
30
-#include "MarlinSerial.h"
31 30
 #else  // ARDUINO
32 31
 #include <Arduino.h>
33 32
 #endif  // ARDUINO
33
+#include "MarlinSerial.h"
34 34
 #include "SdFatConfig.h"
35 35
 #include "SdVolume.h"
36 36
 //------------------------------------------------------------------------------

+ 3
- 2
Marlin/SdFatUtil.h View File

@@ -24,13 +24,14 @@
24 24
  * \brief Useful utility functions.
25 25
  */
26 26
 #include <avr/pgmspace.h>
27
-#if ARDUINO < 100
27
+
28 28
 #define  HardwareSerial_h // trick to disable the standard HWserial
29
+#if ARDUINO < 100
29 30
 #include <WProgram.h>
30
-#include "MarlinSerial.h"
31 31
 #else  // ARDUINO
32 32
 #include <Arduino.h>
33 33
 #endif  // ARDUINO
34
+#include "MarlinSerial.h"
34 35
 /** Store and print a string in flash memory.*/
35 36
 #define PgmPrint(x) SerialPrint_P(PSTR(x))
36 37
 /** Store and print a string in flash memory followed by a CR/LF.*/

+ 6
- 1
Marlin/SdFile.cpp View File

@@ -51,7 +51,12 @@ int16_t SdFile::write(const void* buf, uint16_t nbyte) {
51 51
  * \param[in] b the byte to be written.
52 52
  * Use writeError to check for errors.
53 53
  */
54
-void SdFile::write(uint8_t b) {
54
+#if ARDUINO >= 100
55
+  size_t SdFile::write(uint8_t b)
56
+#else
57
+  void SdFile::write(uint8_t b)
58
+#endif
59
+{
55 60
   SdBaseFile::write(&b, 1);
56 61
 }
57 62
 //------------------------------------------------------------------------------

+ 6
- 1
Marlin/SdFile.h View File

@@ -34,7 +34,12 @@ class SdFile : public SdBaseFile, public Print {
34 34
  public:
35 35
   SdFile() {}
36 36
   SdFile(const char* name, uint8_t oflag);
37
-  void write(uint8_t b);
37
+  #if ARDUINO >= 100
38
+  size_t write(uint8_t b);
39
+#else
40
+   void write(uint8_t b);
41
+#endif
42
+  
38 43
   int16_t write(const void* buf, uint16_t nbyte);
39 44
   void write(const char* str);
40 45
   void write_P(PGM_P str);

+ 5
- 1
Marlin/planner.h View File

@@ -101,7 +101,11 @@ extern uint8_t active_extruder;
101 101
 
102 102
     
103 103
 /////semi-private stuff
104
-#include <WProgram.h>
104
+#if ARDUINO >= 100
105
+  #include "Arduino.h"
106
+#else
107
+   #include "WProgram.h"
108
+#endif
105 109
 
106 110
 extern block_t block_buffer[BLOCK_BUFFER_SIZE];            // A ring buffer for motion instfructions
107 111
 extern volatile unsigned char block_buffer_head;           // Index of the next block to be pushed

Loading…
Cancel
Save