From d09d30d0a8e81cb1966c9793d80213e23dd7e427 Mon Sep 17 00:00:00 2001 From: Jeff Hoefs Date: Sat, 26 Dec 2015 15:23:32 -0800 Subject: [PATCH] Bump version to 2.5.1. Separate protocol version and firmware (library) version. --- Boards.h | 1 + Firmata.cpp | 11 +++--- Firmata.h | 34 ++++++++++++++----- .../AllInputsFirmata/AllInputsFirmata.ino | 2 +- examples/AnalogFirmata/AnalogFirmata.ino | 2 +- examples/EchoString/EchoString.ino | 2 +- examples/ServoFirmata/ServoFirmata.ino | 2 +- .../SimpleAnalogFirmata.ino | 2 +- .../SimpleDigitalFirmata.ino | 2 +- examples/StandardFirmata/StandardFirmata.ino | 4 +-- .../StandardFirmataChipKIT.ino | 4 +-- .../StandardFirmataEthernet.ino | 4 +-- .../StandardFirmataEthernetPlus.ino | 4 +-- .../StandardFirmataPlus.ino | 4 +-- extras/revisions.txt | 15 +++++++- library.properties | 2 +- readme.md | 8 ++--- release.sh | 4 +-- test/firmata_test/firmata_test.ino | 4 +-- 19 files changed, 71 insertions(+), 40 deletions(-) diff --git a/Boards.h b/Boards.h index 41af1f37..a46625ca 100644 --- a/Boards.h +++ b/Boards.h @@ -1,6 +1,7 @@ /* Boards.h - Hardware Abstraction Layer for Firmata library Copyright (c) 2006-2008 Hans-Christoph Steiner. All rights reserved. + Copyright (C) 2009-2015 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 diff --git a/Firmata.cpp b/Firmata.cpp index 37a273dc..a96f1166 100644 --- a/Firmata.cpp +++ b/Firmata.cpp @@ -1,6 +1,7 @@ /* - Firmata.cpp - Firmata library v2.5.0 - 2015-11-7 + Firmata.cpp - Firmata library v2.5.1 - 2015-12-26 Copyright (c) 2006-2008 Hans-Christoph Steiner. All rights reserved. + Copyright (C) 2009-2015 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 @@ -87,8 +88,8 @@ void FirmataClass::begin(Stream &s) void FirmataClass::printVersion(void) { FirmataStream->write(REPORT_VERSION); - FirmataStream->write(FIRMATA_MAJOR_VERSION); - FirmataStream->write(FIRMATA_MINOR_VERSION); + FirmataStream->write(FIRMATA_PROTOCOL_MAJOR_VERSION); + FirmataStream->write(FIRMATA_PROTOCOL_MINOR_VERSION); } void FirmataClass::blinkVersion(void) @@ -96,9 +97,9 @@ void FirmataClass::blinkVersion(void) #if defined(VERSION_BLINK_PIN) // flash the pin with the protocol version pinMode(VERSION_BLINK_PIN, OUTPUT); - strobeBlinkPin(VERSION_BLINK_PIN, FIRMATA_MAJOR_VERSION, 40, 210); + strobeBlinkPin(VERSION_BLINK_PIN, FIRMATA_FIRMWARE_MAJOR_VERSION, 40, 210); delay(250); - strobeBlinkPin(VERSION_BLINK_PIN, FIRMATA_MINOR_VERSION, 40, 210); + strobeBlinkPin(VERSION_BLINK_PIN, FIRMATA_FIRMWARE_MINOR_VERSION, 40, 210); delay(125); #endif } diff --git a/Firmata.h b/Firmata.h index a724a1f2..171c1844 100644 --- a/Firmata.h +++ b/Firmata.h @@ -1,6 +1,7 @@ /* - Firmata.h - Firmata library v2.5.0 - 2015-11-7 + Firmata.h - Firmata library v2.5.1 - 2015-12-26 Copyright (c) 2006-2008 Hans-Christoph Steiner. All rights reserved. + Copyright (C) 2009-2015 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 @@ -16,14 +17,29 @@ #include "Boards.h" /* Hardware Abstraction Layer + Wiring/Arduino */ /* Version numbers for the protocol. The protocol is still changing, so these - * version numbers are important. This number can be queried so that host - * software can test whether it will be compatible with the currently - * installed firmware. */ -#define FIRMATA_MAJOR_VERSION 2 // for non-compatible changes -#define FIRMATA_MINOR_VERSION 5 // for backwards compatible changes -#define FIRMATA_BUGFIX_VERSION 0 // for bugfix releases - -#define MAX_DATA_BYTES 64 // max number of data bytes in incoming messages + * version numbers are important. + * Query using the REPORT_VERSION message. + */ +#define FIRMATA_PROTOCOL_MAJOR_VERSION 2 // for non-compatible changes +#define FIRMATA_PROTOCOL_MINOR_VERSION 5 // for backwards compatible changes +#define FIRMATA_PROTOCOL_BUGFIX_VERSION 1 // for bugfix releases + +/* Version numbers for the Firmata library. + * The firmware version will not always equal the protocol version going forward. + * Query using the REPORT_FIRMWARE message. + */ +#define FIRMATA_FIRMWARE_MAJOR_VERSION 2 +#define FIRMATA_FIRMWARE_MINOR_VERSION 5 +#define FIRMATA_FIRMWARE_BUGFIX_VERSION 1 + +/* DEPRECATED as of Firmata v2.5.1. As of 2.5.1 there are separate version numbers for + * the protocol version and the firmware version. + */ +#define FIRMATA_MAJOR_VERSION 2 // same as FIRMATA_PROTOCOL_MAJOR_VERSION +#define FIRMATA_MINOR_VERSION 5 // same as FIRMATA_PROTOCOL_MINOR_VERSION +#define FIRMATA_BUGFIX_VERSION 1 // same as FIRMATA_PROTOCOL_BUGFIX_VERSION + +#define MAX_DATA_BYTES 64 // max number of data bytes in incoming messages // Arduino 101 also defines SET_PIN_MODE as a macro in scss_registers.h #ifdef SET_PIN_MODE diff --git a/examples/AllInputsFirmata/AllInputsFirmata.ino b/examples/AllInputsFirmata/AllInputsFirmata.ino index b6f766d7..7cfcd60c 100644 --- a/examples/AllInputsFirmata/AllInputsFirmata.ino +++ b/examples/AllInputsFirmata/AllInputsFirmata.ino @@ -45,7 +45,7 @@ void setup() { byte i, port, status; - Firmata.setFirmwareVersion(FIRMATA_MAJOR_VERSION, FIRMATA_MINOR_VERSION); + Firmata.setFirmwareVersion(FIRMATA_FIRMWARE_MAJOR_VERSION, FIRMATA_FIRMWARE_MINOR_VERSION); for (pin = 0; pin < TOTAL_PINS; pin++) { if IS_PIN_DIGITAL(pin) pinMode(PIN_TO_DIGITAL(pin), INPUT); diff --git a/examples/AnalogFirmata/AnalogFirmata.ino b/examples/AnalogFirmata/AnalogFirmata.ino index de86f5f4..8373f88d 100644 --- a/examples/AnalogFirmata/AnalogFirmata.ino +++ b/examples/AnalogFirmata/AnalogFirmata.ino @@ -66,7 +66,7 @@ void reportAnalogCallback(byte pin, int value) *============================================================================*/ void setup() { - Firmata.setFirmwareVersion(FIRMATA_MAJOR_VERSION, FIRMATA_MINOR_VERSION); + Firmata.setFirmwareVersion(FIRMATA_FIRMWARE_MAJOR_VERSION, FIRMATA_FIRMWARE_MINOR_VERSION); Firmata.attach(ANALOG_MESSAGE, analogWriteCallback); Firmata.attach(REPORT_ANALOG, reportAnalogCallback); diff --git a/examples/EchoString/EchoString.ino b/examples/EchoString/EchoString.ino index 84fb3ea2..9849806a 100644 --- a/examples/EchoString/EchoString.ino +++ b/examples/EchoString/EchoString.ino @@ -28,7 +28,7 @@ void sysexCallback(byte command, byte argc, byte *argv) void setup() { - Firmata.setFirmwareVersion(FIRMATA_MAJOR_VERSION, FIRMATA_MINOR_VERSION); + Firmata.setFirmwareVersion(FIRMATA_FIRMWARE_MAJOR_VERSION, FIRMATA_FIRMWARE_MINOR_VERSION); Firmata.attach(STRING_DATA, stringCallback); Firmata.attach(START_SYSEX, sysexCallback); Firmata.begin(57600); diff --git a/examples/ServoFirmata/ServoFirmata.ino b/examples/ServoFirmata/ServoFirmata.ino index 2df19297..1ccc411d 100644 --- a/examples/ServoFirmata/ServoFirmata.ino +++ b/examples/ServoFirmata/ServoFirmata.ino @@ -38,7 +38,7 @@ void setup() { byte pin; - Firmata.setFirmwareVersion(FIRMATA_MAJOR_VERSION, FIRMATA_MINOR_VERSION); + Firmata.setFirmwareVersion(FIRMATA_FIRMWARE_MAJOR_VERSION, FIRMATA_FIRMWARE_MINOR_VERSION); Firmata.attach(ANALOG_MESSAGE, analogWriteCallback); Firmata.attach(SYSTEM_RESET, systemResetCallback); diff --git a/examples/SimpleAnalogFirmata/SimpleAnalogFirmata.ino b/examples/SimpleAnalogFirmata/SimpleAnalogFirmata.ino index de7c4e2c..f4a3eaab 100644 --- a/examples/SimpleAnalogFirmata/SimpleAnalogFirmata.ino +++ b/examples/SimpleAnalogFirmata/SimpleAnalogFirmata.ino @@ -27,7 +27,7 @@ void analogWriteCallback(byte pin, int value) void setup() { - Firmata.setFirmwareVersion(FIRMATA_MAJOR_VERSION, FIRMATA_MINOR_VERSION); + Firmata.setFirmwareVersion(FIRMATA_FIRMWARE_MAJOR_VERSION, FIRMATA_FIRMWARE_MINOR_VERSION); Firmata.attach(ANALOG_MESSAGE, analogWriteCallback); Firmata.begin(57600); } diff --git a/examples/SimpleDigitalFirmata/SimpleDigitalFirmata.ino b/examples/SimpleDigitalFirmata/SimpleDigitalFirmata.ino index a2b74179..56d388e9 100644 --- a/examples/SimpleDigitalFirmata/SimpleDigitalFirmata.ino +++ b/examples/SimpleDigitalFirmata/SimpleDigitalFirmata.ino @@ -52,7 +52,7 @@ void digitalWriteCallback(byte port, int value) void setup() { - Firmata.setFirmwareVersion(FIRMATA_MAJOR_VERSION, FIRMATA_MINOR_VERSION); + Firmata.setFirmwareVersion(FIRMATA_FIRMWARE_MAJOR_VERSION, FIRMATA_FIRMWARE_MINOR_VERSION); Firmata.attach(DIGITAL_MESSAGE, digitalWriteCallback); Firmata.attach(SET_PIN_MODE, setPinModeCallback); Firmata.begin(57600); diff --git a/examples/StandardFirmata/StandardFirmata.ino b/examples/StandardFirmata/StandardFirmata.ino index 7d42e646..a19441d0 100755 --- a/examples/StandardFirmata/StandardFirmata.ino +++ b/examples/StandardFirmata/StandardFirmata.ino @@ -20,7 +20,7 @@ See file LICENSE.txt for further informations on licensing terms. - Last updated by Jeff Hoefs: December 20th, 2015 + Last updated by Jeff Hoefs: December 26th, 2015 */ #include @@ -725,7 +725,7 @@ void systemResetCallback() void setup() { - Firmata.setFirmwareVersion(FIRMATA_MAJOR_VERSION, FIRMATA_MINOR_VERSION); + Firmata.setFirmwareVersion(FIRMATA_FIRMWARE_MAJOR_VERSION, FIRMATA_FIRMWARE_MINOR_VERSION); Firmata.attach(ANALOG_MESSAGE, analogWriteCallback); Firmata.attach(DIGITAL_MESSAGE, digitalWriteCallback); diff --git a/examples/StandardFirmataChipKIT/StandardFirmataChipKIT.ino b/examples/StandardFirmataChipKIT/StandardFirmataChipKIT.ino index 94439229..b47afeab 100644 --- a/examples/StandardFirmataChipKIT/StandardFirmataChipKIT.ino +++ b/examples/StandardFirmataChipKIT/StandardFirmataChipKIT.ino @@ -21,7 +21,7 @@ See file LICENSE.txt for further informations on licensing terms. - Last updated by Jeff Hoefs: December 20th, 2015 + Last updated by Jeff Hoefs: December 26th, 2015 */ #include // Gives us PWM and Servo on every pin @@ -734,7 +734,7 @@ void systemResetCallback() void setup() { - Firmata.setFirmwareVersion(FIRMATA_MAJOR_VERSION, FIRMATA_MINOR_VERSION); + Firmata.setFirmwareVersion(FIRMATA_FIRMWARE_MAJOR_VERSION, FIRMATA_FIRMWARE_MINOR_VERSION); Firmata.attach(ANALOG_MESSAGE, analogWriteCallback); Firmata.attach(DIGITAL_MESSAGE, digitalWriteCallback); diff --git a/examples/StandardFirmataEthernet/StandardFirmataEthernet.ino b/examples/StandardFirmataEthernet/StandardFirmataEthernet.ino index 485c8fcc..9bc927bf 100644 --- a/examples/StandardFirmataEthernet/StandardFirmataEthernet.ino +++ b/examples/StandardFirmataEthernet/StandardFirmataEthernet.ino @@ -20,7 +20,7 @@ See file LICENSE.txt for further informations on licensing terms. - Last updated by Jeff Hoefs: December 20th, 2015 + Last updated by Jeff Hoefs: December 26th, 2015 */ /* @@ -857,7 +857,7 @@ void setup() DEBUG_PRINTLN("connecting..."); - Firmata.setFirmwareVersion(FIRMATA_MAJOR_VERSION, FIRMATA_MINOR_VERSION); + Firmata.setFirmwareVersion(FIRMATA_FIRMWARE_MAJOR_VERSION, FIRMATA_FIRMWARE_MINOR_VERSION); Firmata.attach(ANALOG_MESSAGE, analogWriteCallback); Firmata.attach(DIGITAL_MESSAGE, digitalWriteCallback); diff --git a/examples/StandardFirmataEthernetPlus/StandardFirmataEthernetPlus.ino b/examples/StandardFirmataEthernetPlus/StandardFirmataEthernetPlus.ino index 5b553f63..8063ae22 100644 --- a/examples/StandardFirmataEthernetPlus/StandardFirmataEthernetPlus.ino +++ b/examples/StandardFirmataEthernetPlus/StandardFirmataEthernetPlus.ino @@ -20,7 +20,7 @@ See file LICENSE.txt for further informations on licensing terms. - Last updated by Jeff Hoefs: December 20th, 2015 + Last updated by Jeff Hoefs: December 26th, 2015 */ /* @@ -1110,7 +1110,7 @@ void setup() DEBUG_PRINTLN("connecting..."); - Firmata.setFirmwareVersion(FIRMATA_MAJOR_VERSION, FIRMATA_MINOR_VERSION); + Firmata.setFirmwareVersion(FIRMATA_FIRMWARE_MAJOR_VERSION, FIRMATA_FIRMWARE_MINOR_VERSION); Firmata.attach(ANALOG_MESSAGE, analogWriteCallback); Firmata.attach(DIGITAL_MESSAGE, digitalWriteCallback); diff --git a/examples/StandardFirmataPlus/StandardFirmataPlus.ino b/examples/StandardFirmataPlus/StandardFirmataPlus.ino index 2dbd55b3..ec09408b 100644 --- a/examples/StandardFirmataPlus/StandardFirmataPlus.ino +++ b/examples/StandardFirmataPlus/StandardFirmataPlus.ino @@ -20,7 +20,7 @@ See file LICENSE.txt for further informations on licensing terms. - Last updated by Jeff Hoefs: December 20th, 2015 + Last updated by Jeff Hoefs: December 26th, 2015 */ /* @@ -1036,7 +1036,7 @@ void systemResetCallback() void setup() { - Firmata.setFirmwareVersion(FIRMATA_MAJOR_VERSION, FIRMATA_MINOR_VERSION); + Firmata.setFirmwareVersion(FIRMATA_FIRMWARE_MAJOR_VERSION, FIRMATA_FIRMWARE_MINOR_VERSION); Firmata.attach(ANALOG_MESSAGE, analogWriteCallback); Firmata.attach(DIGITAL_MESSAGE, digitalWriteCallback); diff --git a/extras/revisions.txt b/extras/revisions.txt index 01ca4836..a0e2cf32 100644 --- a/extras/revisions.txt +++ b/extras/revisions.txt @@ -1,4 +1,17 @@ -FIRMATA 2.5.0 0 Nov 7, 2015 +FIRMATA 2.5.1 - Dec 26, 2015 + +[core library] +* Added support for Arduino 101 +* Make VERSION_BLINK_PIN optional +* Separate protocol version from firmware version. + Use FIRMATA_PROTOCOL_VERSION_[MAJOR/MINOR/BUGFIX] for protocol and use + FIRMATA_FIRMWARE_VERSION_[MAJOR/MINOR/BUGFIX] for firmware (library version). + +[StandardFirmata & variants] +* Added ability to auto-restart I2C transmission by setting bit 6 of byte 3 + of the I2C_REQUEST message. + +FIRMATA 2.5.0 - Nov 7, 2015 [core library] * Added Serial feature for interfacing with serial devices via hardware diff --git a/library.properties b/library.properties index f898de0d..61e07328 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=Firmata -version=2.5.0 +version=2.5.1 author=Firmata Developers maintainer=https://github.com/firmata/arduino sentence=Enables the communication with computer apps using a standard serial protocol. For all Arduino boards. diff --git a/readme.md b/readme.md index bcb8ec05..595c8008 100644 --- a/readme.md +++ b/readme.md @@ -81,7 +81,7 @@ $ git clone git@github.com:firmata/arduino.git ~/Documents/Arduino/libraries/Fir ##Updating Firmata in the Arduino IDE - older versions (<= 1.6.3 or 1.0.x) -Download the latest [release](https://github.com/firmata/arduino/releases/tag/v2.5.0) (for Arduino 1.0.x or Arduino 1.5.6 or higher) and replace the existing Firmata folder in your Arduino application. See the instructions below for your platform. +Download the latest [release](https://github.com/firmata/arduino/releases/tag/2.5.1) (for Arduino 1.0.x or Arduino 1.5.6 or higher) and replace the existing Firmata folder in your Arduino application. See the instructions below for your platform. *Note that Arduino 1.5.0 - 1.5.5 are not supported. Please use Arduino 1.5.6 or higher (or Arduino 1.0.5 or 1.0.6).* @@ -92,7 +92,7 @@ The Firmata library is contained within the Arduino package. 1. Navigate to the Arduino application 2. Right click on the application icon and select `Show Package Contents` 3. Navigate to: `/Contents/Resources/Java/libraries/` and replace the existing -`Firmata` folder with latest [Firmata release](https://github.com/firmata/arduino/releases/tag/v2.5.0) (note there is a different download +`Firmata` folder with latest [Firmata release](https://github.com/firmata/arduino/releases/tag/2.5.1) (note there is a different download for Arduino 1.0.x vs 1.6.x) 4. Restart the Arduino application and the latest version of Firmata will be available. @@ -102,7 +102,7 @@ will differ slightly: `Contents/Java/libraries/Firmata` (no Resources directory) ###Windows: 1. Navigate to `c:/Program\ Files/arduino-1.x/libraries/` and replace the existing -`Firmata` folder with the latest [Firmata release](https://github.com/firmata/arduino/releases/tag/v2.5.0) (note there is a different download +`Firmata` folder with the latest [Firmata release](https://github.com/firmata/arduino/releases/tag/2.5.1) (note there is a different download for Arduino 1.0.x vs 1.6.x). 2. Restart the Arduino application and the latest version of Firmata will be available. @@ -111,7 +111,7 @@ for Arduino 1.0.x vs 1.6.x). ###Linux: 1. Navigate to `~/arduino-1.x/libraries/` and replace the existing -`Firmata` folder with the latest [Firmata release](https://github.com/firmata/arduino/releases/tag/v2.5.0) (note there is a different download +`Firmata` folder with the latest [Firmata release](https://github.com/firmata/arduino/releases/tag/2.5.1) (note there is a different download for Arduino 1.0.x vs 1.6.x). 2. Restart the Arduino application and the latest version of Firmata will be available. diff --git a/release.sh b/release.sh index 58025fe9..ada2bdfb 100644 --- a/release.sh +++ b/release.sh @@ -16,7 +16,7 @@ cd temp find . -name "*.DS_Store" -type f -delete zip -r Firmata.zip ./Firmata/ cd .. -mv ./temp/Firmata.zip Firmata-2.5.0.zip +mv ./temp/Firmata.zip Firmata-2.5.1.zip #package for Arduino 1.6.x cp library.properties temp/Firmata @@ -31,5 +31,5 @@ cd .. find . -name "*.DS_Store" -type f -delete zip -r Firmata.zip ./Firmata/ cd .. -mv ./temp/Firmata.zip Arduino-1.6.x-Firmata-2.5.0.zip +mv ./temp/Firmata.zip Arduino-1.6.x-Firmata-2.5.1.zip rm -r ./temp diff --git a/test/firmata_test/firmata_test.ino b/test/firmata_test/firmata_test.ino index 811b7b44..ce40afa5 100644 --- a/test/firmata_test/firmata_test.ino +++ b/test/firmata_test/firmata_test.ino @@ -26,8 +26,8 @@ test(beginPrintsVersion) char expected[] = { REPORT_VERSION, - FIRMATA_MAJOR_VERSION, - FIRMATA_MINOR_VERSION, + FIRMATA_PROTOCOL_MAJOR_VERSION, + FIRMATA_PROTOCOL_MINOR_VERSION, 0 }; assertEqual(expected, stream.bytesWritten());