読者です 読者をやめる 読者になる 読者になる

Arduino 1.0用のADK demo kit firmware

Arduino

Arduino 1.0でAndroid ADKのdemokitをビルドしようとすると、コンパイラさんに怒られてしまいます。
しょうがないのでせこせこ修正しました。
どうやらWProgram.hが無くなって、かわりにArduino.hを仕えってことになったようです。
とりあえずこんな感じのパッチを当てるとビルドできるようになりました。

diff -u arduino-0022/libraries/USB_Host_Shield//Max3421e.h arduino-1.0/libraries/USB_Host_Shield//Max3421e.h
--- arduino-0022/libraries/USB_Host_Shield//Max3421e.h	2011-09-22 18:01:09.089227300 +0900
+++ arduino-1.0/libraries/USB_Host_Shield//Max3421e.h	2012-04-16 17:04:31.406365000 +0900
@@ -34,7 +34,7 @@
 
 //#include <Spi.h>
 //#include <WProgram.h>
-#include "WProgram.h"
+#include "Arduino.h"
 #include "Max3421e_constants.h"
 
 class MAX3421E /* : public SPI */ {
diff -u arduino-0022/libraries/USB_Host_Shield//Max_LCD.cpp arduino-1.0/libraries/USB_Host_Shield//Max_LCD.cpp
--- arduino-0022/libraries/USB_Host_Shield//Max_LCD.cpp	2011-09-22 18:01:09.111228500 +0900
+++ arduino-1.0/libraries/USB_Host_Shield//Max_LCD.cpp	2012-04-16 17:04:56.230784900 +0900
@@ -35,7 +35,7 @@
 #include <stdio.h>
 #include <string.h>
 #include <inttypes.h>
-#include "WProgram.h"
+#include "Arduino.h"
 
 // When the display powers up, it is configured as follows:
 //
@@ -254,8 +254,9 @@
   delayMicroseconds(100);
 }
 
-inline void Max_LCD::write(uint8_t value) {
-  LCD_sendchar(value);
+inline size_t Max_LCD::write(uint8_t value) {
+  LCD_sendchar(value);
+  return 1;
 }
 
 void Max_LCD::sendbyte( uint8_t val )
diff -u arduino-0022/libraries/USB_Host_Shield//Max_LCD.h arduino-1.0/libraries/USB_Host_Shield//Max_LCD.h
--- arduino-0022/libraries/USB_Host_Shield//Max_LCD.h	2011-09-22 18:01:09.121229100 +0900
+++ arduino-1.0/libraries/USB_Host_Shield//Max_LCD.h	2012-04-16 15:43:50.363473200 +0900
@@ -98,7 +98,7 @@
   void noAutoscroll();
   void createChar(uint8_t, uint8_t[]);
   void setCursor(uint8_t, uint8_t); 
-  virtual void write(uint8_t);
+  virtual size_t write(uint8_t);
   void command(uint8_t);
 private:
   void sendbyte( uint8_t val );
diff -u arduino-0022/libraries/CapSense//CapSense.cpp arduino-1.0/libraries/CapSense//CapSense.cpp
--- arduino-0022/libraries/CapSense//CapSense.cpp	2011-09-22 18:03:16.691525700 +0900
+++ arduino-1.0/libraries/CapSense//CapSense.cpp	2012-04-16 17:02:16.193631300 +0900
@@ -7,12 +7,11 @@
 #include "CapSense.h"
 
 // include core Wiring API
-#include "WProgram.h"
+#include "Arduino.h"
 
 
 // include description files for other libraries used (if any)
 #include "pins_arduino.h"
-#include "WConstants.h"
 
 // Constructor /////////////////////////////////////////////////////////////////
 // Function that handles the creation and setup of instances
diff -u arduino-0022/libraries/CapSense//CapSense.h arduino-1.0/libraries/CapSense//CapSense.h
--- arduino-0022/libraries/CapSense//CapSense.h	2011-09-22 18:03:16.775530500 +0900
+++ arduino-1.0/libraries/CapSense//CapSense.h	2012-04-16 17:02:59.004079900 +0900
@@ -8,7 +8,7 @@
 #define CapSense_h
 
 // include types & constants of Wiring core API
-#include <WProgram.h>
+#include <Arduino.h>
 
 // library interface description
 class CapSense
@@ -49,4 +49,4 @@
 
 };
 
-#endif
\ No newline at end of file
+#endif
diff -u arduino-0022/libraries/AndroidAccessory/AndroidAccessory.h arduino-1.0/libraries/AndroidAccessory/AndroidAccessory.h
--- arduino-0022/libraries/AndroidAccessory/AndroidAccessory.h	2011-09-22 18:01:09.050225100 +0900
+++ arduino-1.0/libraries/AndroidAccessory/AndroidAccessory.h	2012-04-16 17:05:48.705786300 +0900
@@ -17,7 +17,7 @@
 #ifndef __AndroidAccessory_h__
 #define __AndroidAccessory_h__
 
-#include "WProgram.h"
+#include "Arduino.h"
 
 class AndroidAccessory {
 private:

パッチファイルだけ欲しい人は下記からどうぞ。

http://dl.dropbox.com/u/53296750/arduino_patches/AndroidAccessory.patch
http://dl.dropbox.com/u/53296750/arduino_patches/CapSense.patch
http://dl.dropbox.com/u/53296750/arduino_patches/USB_Host_Shield.patch