[gnoduino] fix I2CFirmata for newer gcc



commit 08dd99bf5ab031fad56d589b117bc91358932a5c
Author: Pascal de Bruijn <pmjdebruijn pcode nl>
Date:   Sat May 25 14:14:02 2013 +0200

    fix I2CFirmata for newer gcc

 .../Firmata/examples/I2CFirmata/I2CFirmata.ino     |   32 ++++++++++----------
 1 files changed, 16 insertions(+), 16 deletions(-)
---
diff --git a/libraries/Firmata/examples/I2CFirmata/I2CFirmata.ino 
b/libraries/Firmata/examples/I2CFirmata/I2CFirmata.ino
index 1da8963..7ed7b63 100644
--- a/libraries/Firmata/examples/I2CFirmata/I2CFirmata.ino
+++ b/libraries/Firmata/examples/I2CFirmata/I2CFirmata.ino
@@ -55,6 +55,22 @@ byte i2cRxData[32];
 boolean readingContinuously = false;
 byte queryIndex = 0;
 
+/* reference: BlinkM_funcs.h by Tod E. Kurt, ThingM, http://thingm.com/ */
+// Enables Pins A2 and A3 to be used as GND and Power
+// so that I2C devices can be plugged directly
+// into Arduino header (pins A2 - A5)
+static void enablePowerPins(byte pwrpin, byte gndpin)
+{
+  if(powerPinsEnabled == 0) {
+    DDRC |= _BV(pwrpin) | _BV(gndpin);
+    PORTC &=~ _BV(gndpin);
+    PORTC |=  _BV(pwrpin);
+    powerPinsEnabled = 1;
+    Firmata.sendString("Power pins enabled");
+    delay(100);
+  }
+}
+
 void readAndReportData(byte address, int theRegister, byte numBytes)
 {
   if (theRegister != REGISTER_NOT_SPECIFIED) {
@@ -180,22 +196,6 @@ void systemResetCallback()
   queryIndex = 0;
 }
 
-/* reference: BlinkM_funcs.h by Tod E. Kurt, ThingM, http://thingm.com/ */
-// Enables Pins A2 and A3 to be used as GND and Power
-// so that I2C devices can be plugged directly
-// into Arduino header (pins A2 - A5)
-static void enablePowerPins(byte pwrpin, byte gndpin)
-{
-  if(powerPinsEnabled == 0) {
-    DDRC |= _BV(pwrpin) | _BV(gndpin);
-    PORTC &=~ _BV(gndpin);
-    PORTC |=  _BV(pwrpin);
-    powerPinsEnabled = 1;
-    Firmata.sendString("Power pins enabled");
-    delay(100);
-  }
-}
-
 void setup()
 {
   Firmata.setFirmwareVersion(2, 0);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]