Browse Source

starting with sanguino arduino 1.0 compatibility

Bernhard 13 years ago
parent
commit
8463e39a4a
3 changed files with 12 additions and 14 deletions
  1. 6
    9
      Marlin/Marlin.h
  2. 2
    1
      Marlin/SdFile.cpp
  3. 4
    4
      Marlin/SdFile.h

+ 6
- 9
Marlin/Marlin.h View File

@@ -21,19 +21,16 @@
21 21
 #include  <avr/interrupt.h>
22 22
 
23 23
 
24
-
25
-
26
-
27
-
28
-
29
-
30
-
31 24
 #include "fastio.h"
32 25
 #include "Configuration.h"
33 26
 #include "pins.h"
34 27
 
35
-#if ARDUINO >= 100
36
-  #include "Arduino.h"
28
+#if ARDUINO >= 100 
29
+  #if defined(__AVR_ATmega644P__)
30
+    #include "WProgram.h"
31
+  #else
32
+    #include "Arduino.h"
33
+  #endif
37 34
 #else
38 35
    #include "WProgram.h"
39 36
 #endif

+ 2
- 1
Marlin/SdFile.cpp View File

@@ -47,13 +47,14 @@ SdFile::SdFile(const char* path, uint8_t oflag) : SdBaseFile(path, oflag) {
47 47
 int16_t SdFile::write(const void* buf, uint16_t nbyte) {
48 48
   return SdBaseFile::write(buf, nbyte);
49 49
 }
50
+#warning F_CPU
50 51
 //------------------------------------------------------------------------------
51 52
 /** Write a byte to a file. Required by the Arduino Print class.
52 53
  * \param[in] b the byte to be written.
53 54
  * Use writeError to check for errors.
54 55
  */
55 56
 #if ARDUINO >= 100
56
-  size_t SdFile::write(uint8_t b)
57
+    size_t SdFile::write(uint8_t b)
57 58
 #else
58 59
   void SdFile::write(uint8_t b)
59 60
 #endif

+ 4
- 4
Marlin/SdFile.h View File

@@ -21,8 +21,8 @@
21 21
  * \file
22 22
  * \brief SdFile class
23 23
  */
24
-#include "SdBaseFile.h"
25 24
 #include "Marlin.h"
25
+#include "SdBaseFile.h"
26 26
 #include <Print.h>
27 27
 #ifndef SdFile_h
28 28
 #define SdFile_h
@@ -36,10 +36,10 @@ class SdFile : public SdBaseFile, public Print {
36 36
   SdFile() {}
37 37
   SdFile(const char* name, uint8_t oflag);
38 38
   #if ARDUINO >= 100
39
-  size_t write(uint8_t b);
40
-#else
39
+      size_t write(uint8_t b);
40
+  #else
41 41
    void write(uint8_t b);
42
-#endif
42
+  #endif
43 43
   
44 44
   int16_t write(const void* buf, uint16_t nbyte);
45 45
   void write(const char* str);

Loading…
Cancel
Save