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

This commit is contained in:
Bernhard 2011-12-01 16:38:01 +01:00
parent b0c3871750
commit 0bc9daa4f7
8 changed files with 675 additions and 651 deletions

View file

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

View file

@ -25,7 +25,11 @@
#include <string.h>
#include <inttypes.h>
#include <math.h>
#if ARDUINO >= 100
#include "Arduino.h"
#else
#include "wiring.h"
#endif
#include "wiring_private.h"
// this next line disables the entire HardwareSerial.cpp,

View file

@ -17,8 +17,8 @@
* along with the Arduino Sd2Card Library. If not, see
* <http://www.gnu.org/licenses/>.
*/
#if ARDUINO < 100
#define HardwareSerial_h // trick to disable the standard HWserial
#if ARDUINO < 100
#include <WProgram.h>
#else // ARDUINO
#include <Arduino.h>

View file

@ -24,13 +24,13 @@
* \brief SdBaseFile class
*/
#include <avr/pgmspace.h>
#if ARDUINO < 100
#define HardwareSerial_h // trick to disable the standard HWserial
#if ARDUINO < 100
#include <WProgram.h>
#include "MarlinSerial.h"
#else // ARDUINO
#include <Arduino.h>
#endif // ARDUINO
#include "MarlinSerial.h"
#include "SdFatConfig.h"
#include "SdVolume.h"
//------------------------------------------------------------------------------

View file

@ -24,13 +24,14 @@
* \brief Useful utility functions.
*/
#include <avr/pgmspace.h>
#if ARDUINO < 100
#define HardwareSerial_h // trick to disable the standard HWserial
#if ARDUINO < 100
#include <WProgram.h>
#include "MarlinSerial.h"
#else // ARDUINO
#include <Arduino.h>
#endif // ARDUINO
#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.*/

View file

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

View file

@ -34,7 +34,12 @@ class SdFile : public SdBaseFile, public Print {
public:
SdFile() {}
SdFile(const char* name, uint8_t oflag);
#if ARDUINO >= 100
size_t write(uint8_t b);
#else
void write(uint8_t b);
#endif
int16_t write(const void* buf, uint16_t nbyte);
void write(const char* str);
void write_P(PGM_P str);

View file

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