Permalink
Browse files

Merge pull request #4 from sudar/master

Added Arduino 1.0 compatibility
  • Loading branch information...
felis committed Jun 13, 2012
2 parents 4cae57e + ac68a66 commit 880773a1cfd5a521f97493b0e4de7f243a2c2925
Showing with 23 additions and 6 deletions.
  1. +6 −4 Max3421e.h
  2. +11 −1 Max_LCD.cpp
  3. +6 −1 Max_LCD.h
View
@@ -3,10 +3,12 @@
#ifndef _MAX3421E_H_
#define _MAX3421E_H_
-
-//#include <Spi.h>
-//#include <WProgram.h>
-#include "WProgram.h"
+// Arduino 1.0 compatibility
+#if defined(ARDUINO) && ARDUINO >= 100
+ #include <Arduino.h>
+#else
+ #include <WProgram.h>
+#endif
#include "Max3421e_constants.h"
class MAX3421E /* : public SPI */ {
View
@@ -7,7 +7,12 @@
#include <stdio.h>
#include <string.h>
#include <inttypes.h>
-#include "WProgram.h"
+// Arduino 1.0 compatibility
+#if defined(ARDUINO) && ARDUINO >= 100
+ #include <Arduino.h>
+#else
+ #include <WProgram.h>
+#endif
// When the display powers up, it is configured as follows:
//
@@ -226,7 +231,12 @@ inline void Max_LCD::command(uint8_t value) {
delayMicroseconds(100);
}
+// Arduino 1.0 compatibility
+#if defined(ARDUINO) && ARDUINO >= 100
+inline size_t Max_LCD::write(uint8_t value) {
+#else
inline void Max_LCD::write(uint8_t value) {
+#endif
LCD_sendchar(value);
}
View
@@ -70,7 +70,12 @@ class Max_LCD : public Print {
void noAutoscroll();
void createChar(uint8_t, uint8_t[]);
void setCursor(uint8_t, uint8_t);
+// Arduino 1.0 compatibility
+#if defined(ARDUINO) && ARDUINO >= 100
+ virtual size_t write(uint8_t);
+#else
virtual void write(uint8_t);
+#endif
void command(uint8_t);
private:
void sendbyte( uint8_t val );
@@ -84,4 +89,4 @@ class Max_LCD : public Print {
-#endif
+#endif

0 comments on commit 880773a

Please sign in to comment.