diff --git a/library.properties b/library.properties index a56d965..bc3bf68 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=ConfigurableFirmata -version=2.8.1 +version=2.8.2 author=Firmata Developers maintainer=https://github.com/firmata/ConfigurableFirmata sentence=This library implements the Firmata protocol as a set of plugins that can be used to create applications to remotely interface with an Arduino board. diff --git a/src/ConfigurableFirmata.cpp b/src/ConfigurableFirmata.cpp index 9ce6c61..b4b43b2 100644 --- a/src/ConfigurableFirmata.cpp +++ b/src/ConfigurableFirmata.cpp @@ -1,5 +1,5 @@ /* - ConfigurableFirmata.pp - ConfigurableFirmata library v2.8.1 - 2016-1-23 + ConfigurableFirmata.pp - ConfigurableFirmata library v2.8.2 - 2016-2-16 Copyright (c) 2006-2008 Hans-Christoph Steiner. All rights reserved. Copyright (c) 2013 Norbert Truchsess. All rights reserved. Copyright (c) 2013-2016 Jeff Hoefs. All rights reserved. diff --git a/src/ConfigurableFirmata.h b/src/ConfigurableFirmata.h index bb71f1d..de38800 100644 --- a/src/ConfigurableFirmata.h +++ b/src/ConfigurableFirmata.h @@ -1,5 +1,5 @@ /* - ConfigurableFirmata.h - ConfigurableFirmata library v2.8.1 - 2016-1-23 + ConfigurableFirmata.h - ConfigurableFirmata library v2.8.2 - 2016-2-16 Copyright (c) 2006-2008 Hans-Christoph Steiner. All rights reserved. Copyright (c) 2013 Norbert Truchsess. All rights reserved. Copyright (c) 2013-2016 Jeff Hoefs. All rights reserved. @@ -33,7 +33,7 @@ */ #define FIRMATA_FIRMWARE_MAJOR_VERSION 2 // for non-compatible changes #define FIRMATA_FIRMWARE_MINOR_VERSION 8 // for backwards compatible changes -#define FIRMATA_FIRMWARE_BUGFIX_VERSION 1 // for bugfix releases +#define FIRMATA_FIRMWARE_BUGFIX_VERSION 2 // for bugfix releases // DEPRECATED as of ConfigurableFirmata v2.8.1. // Use FIRMATA_PROTOCOL_[MAJOR|MINOR|BUGFIX]_VERSION instead. @@ -44,7 +44,7 @@ //Use FIRMATA_FIRMWARE_[MAJOR|MINOR|BUGFIX]_VERSION instead. #define FIRMWARE_MAJOR_VERSION 2 #define FIRMWARE_MINOR_VERSION 8 -#define FIRMWARE_BUGFIX_VERSION 1 +#define FIRMWARE_BUGFIX_VERSION 2 #define MAX_DATA_BYTES 64 // max number of data bytes in incoming messages diff --git a/src/DigitalOutputFirmata.cpp b/src/DigitalOutputFirmata.cpp index 66363de..a4448f0 100644 --- a/src/DigitalOutputFirmata.cpp +++ b/src/DigitalOutputFirmata.cpp @@ -4,7 +4,7 @@ Copyright (C) 2010-2011 Paul Stoffregen. All rights reserved. Copyright (C) 2009 Shigeru Kobayashi. All rights reserved. Copyright (C) 2013 Norbert Truchsess. All rights reserved. - Copyright (C) 2009-2015 Jeff Hoefs. All rights reserved. + Copyright (C) 2009-2016 Jeff Hoefs. All rights reserved. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -13,7 +13,7 @@ See file LICENSE.txt for further informations on licensing terms. - Last updated by Jeff Hoefs: November 15th, 2015 + Last updated by Jeff Hoefs: February 16th, 2016 */ #include @@ -61,7 +61,7 @@ void DigitalOutputFirmata::reset() void DigitalOutputFirmata::digitalWritePort(byte port, int value) { - byte pin, lastPin, pinValue, pinMode, mask = 1, pinWriteMask = 0; + byte pin, lastPin, pinValue, mask = 1, pinWriteMask = 0; if (port < TOTAL_PORTS) { // create a mask of the pins on this port that are writable. @@ -70,14 +70,13 @@ void DigitalOutputFirmata::digitalWritePort(byte port, int value) for (pin = port * 8; pin < lastPin; pin++) { // do not disturb non-digital pins (eg, Rx & Tx) if (IS_PIN_DIGITAL(pin)) { - pinMode = Firmata.getPinMode(pin); // do not touch pins in PWM, ANALOG, SERVO or other modes - if (pinMode == OUTPUT || pinMode == INPUT) { + if (Firmata.getPinMode(pin) == OUTPUT || Firmata.getPinMode(pin) == INPUT) { pinValue = ((byte)value & mask) ? 1 : 0; - if (pinMode == OUTPUT) { + if (Firmata.getPinMode(pin) == OUTPUT) { pinWriteMask |= mask; - } else if (pinMode == INPUT && pinValue == 1 && Firmata.getPinState(pin) != 1) { - Firmata.setPinMode(pin, INPUT_PULLUP); + } else if (Firmata.getPinMode(pin) == INPUT && pinValue == 1 && Firmata.getPinState(pin) != 1) { + pinMode(pin, INPUT_PULLUP); } Firmata.setPinState(pin, pinValue); }