Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Added Arduino 1.0 compatibility #4

Merged
merged 1 commit into from

2 participants

@sudar

I have added Arduino 1.0 compatibility for this library.

I know that that the development of this library has stopped. But there are still certain projects that work only with this v1.0 of this library (eg: Your code for connecting Bluetooth Dongle etc)

Would appreciate if you could merge the pull request.

Sudar
(one of the proud owner of your USB Host Shield)

@felis
Owner

thanks!

@felis felis merged commit 880773a into felis:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jun 11, 2012
  1. @sudar
This page is out of date. Refresh to see the latest.
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
10 Max3421e.h
@@ -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
12 Max_LCD.cpp
@@ -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
7 Max_LCD.h
@@ -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
Something went wrong with that request. Please try again.