Browse Source

starting with sanguino arduino 1.0 compatibility

pull/1/head
Bernhard 13 years ago
parent
commit
8463e39a4a
  1. 15
      Marlin/Marlin.h
  2. 3
      Marlin/SdFile.cpp
  3. 8
      Marlin/SdFile.h

15
Marlin/Marlin.h

@ -21,19 +21,16 @@
#include <avr/interrupt.h> #include <avr/interrupt.h>
#include "fastio.h" #include "fastio.h"
#include "Configuration.h" #include "Configuration.h"
#include "pins.h" #include "pins.h"
#if ARDUINO >= 100 #if ARDUINO >= 100
#include "Arduino.h" #if defined(__AVR_ATmega644P__)
#include "WProgram.h"
#else
#include "Arduino.h"
#endif
#else #else
#include "WProgram.h" #include "WProgram.h"
#endif #endif

3
Marlin/SdFile.cpp

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

8
Marlin/SdFile.h

@ -21,8 +21,8 @@
* \file * \file
* \brief SdFile class * \brief SdFile class
*/ */
#include "SdBaseFile.h"
#include "Marlin.h" #include "Marlin.h"
#include "SdBaseFile.h"
#include <Print.h> #include <Print.h>
#ifndef SdFile_h #ifndef SdFile_h
#define SdFile_h #define SdFile_h
@ -36,10 +36,10 @@ class SdFile : public SdBaseFile, public Print {
SdFile() {} SdFile() {}
SdFile(const char* name, uint8_t oflag); SdFile(const char* name, uint8_t oflag);
#if ARDUINO >= 100 #if ARDUINO >= 100
size_t write(uint8_t b); size_t write(uint8_t b);
#else #else
void write(uint8_t b); void write(uint8_t b);
#endif #endif
int16_t write(const void* buf, uint16_t nbyte); int16_t write(const void* buf, uint16_t nbyte);
void write(const char* str); void write(const char* str);

Loading…
Cancel
Save