Skip to content

Commit d3be79a

Browse files
eliminate Firmata related compiler warnings
1 parent e6c4d69 commit d3be79a

File tree

8 files changed

+34
-23
lines changed

8 files changed

+34
-23
lines changed

examples/StandardFirmata/StandardFirmata.ino

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
2121
See file LICENSE.txt for further informations on licensing terms.
2222
23-
Last updated by Jeff Hoefs: December 9th, 2015
23+
Last updated by Jeff Hoefs: December 20th, 2015
2424
*/
2525

2626
#include <Servo.h>
@@ -517,6 +517,7 @@ void sysexCallback(byte command, byte argc, byte *argv)
517517
if (queryIndex <= 0) {
518518
queryIndex = -1;
519519
} else {
520+
queryIndexToSkip = 0;
520521
// if read continuous mode is enabled for multiple devices,
521522
// determine which device to stop reading and remove it's data from
522523
// the array, shifiting other array data to fill the space

examples/StandardFirmataChipKIT/StandardFirmataChipKIT.ino

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
2222
See file LICENSE.txt for further informations on licensing terms.
2323
24-
Last updated by Jeff Hoefs: December 9th, 2015
24+
Last updated by Jeff Hoefs: December 20th, 2015
2525
*/
2626

2727
#include <SoftPWMServo.h> // Gives us PWM and Servo on every pin
@@ -528,6 +528,7 @@ void sysexCallback(byte command, byte argc, byte *argv)
528528
if (queryIndex <= 0) {
529529
queryIndex = -1;
530530
} else {
531+
queryIndexToSkip = 0;
531532
// if read continuous mode is enabled for multiple devices,
532533
// determine which device to stop reading and remove it's data from
533534
// the array, shifiting other array data to fill the space

examples/StandardFirmataEthernet/StandardFirmataEthernet.ino

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
2121
See file LICENSE.txt for further informations on licensing terms.
2222
23-
Last updated by Jeff Hoefs: December 9th, 2015
23+
Last updated by Jeff Hoefs: December 20th, 2015
2424
*/
2525

2626
/*
@@ -635,6 +635,7 @@ void sysexCallback(byte command, byte argc, byte *argv)
635635
if (queryIndex <= 0) {
636636
queryIndex = -1;
637637
} else {
638+
queryIndexToSkip = 0;
638639
// if read continuous mode is enabled for multiple devices,
639640
// determine which device to stop reading and remove it's data from
640641
// the array, shifiting other array data to fill the space

examples/StandardFirmataEthernetPlus/StandardFirmataEthernetPlus.ino

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
2121
See file LICENSE.txt for further informations on licensing terms.
2222
23-
Last updated by Jeff Hoefs: December 19th, 2015
23+
Last updated by Jeff Hoefs: December 20th, 2015
2424
*/
2525

2626
/*
@@ -723,6 +723,7 @@ void sysexCallback(byte command, byte argc, byte *argv)
723723
if (queryIndex <= 0) {
724724
queryIndex = -1;
725725
} else {
726+
queryIndexToSkip = 0;
726727
// if read continuous mode is enabled for multiple devices,
727728
// determine which device to stop reading and remove it's data from
728729
// the array, shifiting other array data to fill the space
@@ -862,11 +863,6 @@ void sysexCallback(byte command, byte argc, byte *argv)
862863
byte swTxPin, swRxPin;
863864
serial_pins pins;
864865

865-
if (portId > 7 && argc > 4) {
866-
swRxPin = argv[4];
867-
swTxPin = argv[5];
868-
}
869-
870866
if (portId < 8) {
871867
serialPort = getPortFromId(portId);
872868
if (serialPort != NULL) {
@@ -882,6 +878,14 @@ void sysexCallback(byte command, byte argc, byte *argv)
882878
}
883879
} else {
884880
#if defined(SoftwareSerial_h)
881+
if (argc > 4) {
882+
swRxPin = argv[4];
883+
swTxPin = argv[5];
884+
} else {
885+
// RX and TX pins must be specified when using SW serial
886+
Firmata.sendString("Specify serial RX and TX pins");
887+
return;
888+
}
885889
switch (portId) {
886890
case SW_SERIAL0:
887891
if (swSerial0 == NULL) {
@@ -943,7 +947,7 @@ void sysexCallback(byte command, byte argc, byte *argv)
943947
serialIndex++;
944948
reportSerial[serialIndex] = portId;
945949
} else if (argv[1] == SERIAL_STOP_READING) {
946-
byte serialIndexToSkip;
950+
byte serialIndexToSkip = 0;
947951
if (serialIndex <= 0) {
948952
serialIndex = -1;
949953
} else {

examples/StandardFirmataPlus/StandardFirmataPlus.ino

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
2121
See file LICENSE.txt for further informations on licensing terms.
2222
23-
Last updated by Jeff Hoefs: December 19th, 2015
23+
Last updated by Jeff Hoefs: December 20th, 2015
2424
*/
2525

2626
/*
@@ -655,6 +655,7 @@ void sysexCallback(byte command, byte argc, byte *argv)
655655
if (queryIndex <= 0) {
656656
queryIndex = -1;
657657
} else {
658+
queryIndexToSkip = 0;
658659
// if read continuous mode is enabled for multiple devices,
659660
// determine which device to stop reading and remove it's data from
660661
// the array, shifiting other array data to fill the space
@@ -798,11 +799,6 @@ void sysexCallback(byte command, byte argc, byte *argv)
798799
byte swTxPin, swRxPin;
799800
serial_pins pins;
800801

801-
if (portId > 7 && argc > 4) {
802-
swRxPin = argv[4];
803-
swTxPin = argv[5];
804-
}
805-
806802
if (portId < 8) {
807803
serialPort = getPortFromId(portId);
808804
if (serialPort != NULL) {
@@ -818,6 +814,14 @@ void sysexCallback(byte command, byte argc, byte *argv)
818814
}
819815
} else {
820816
#if defined(SoftwareSerial_h)
817+
if (argc > 4) {
818+
swRxPin = argv[4];
819+
swTxPin = argv[5];
820+
} else {
821+
// RX and TX pins must be specified when using SW serial
822+
Firmata.sendString("Specify serial RX and TX pins");
823+
return;
824+
}
821825
switch (portId) {
822826
case SW_SERIAL0:
823827
if (swSerial0 == NULL) {
@@ -879,7 +883,7 @@ void sysexCallback(byte command, byte argc, byte *argv)
879883
serialIndex++;
880884
reportSerial[serialIndex] = portId;
881885
} else if (argv[1] == SERIAL_STOP_READING) {
882-
byte serialIndexToSkip;
886+
byte serialIndexToSkip = 0;
883887
if (serialIndex <= 0) {
884888
serialIndex = -1;
885889
} else {

readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ The second and more common model is to load a general purpose sketch called Stan
1313
##Firmata Client Libraries
1414
Most of the time you will be interacting with Arduino with a client library on the host computers. Several Firmata client libraries have been implemented in a variety of popular programming languages:
1515

16-
* procesing
16+
* processing
1717
* [https://github.com/firmata/processing]
1818
* [http://funnel.cc]
1919
* python

utility/EthernetClientStream.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@
2626
#define MILLIS_RECONNECT 5000
2727

2828
EthernetClientStream::EthernetClientStream(Client &client, IPAddress localip, IPAddress ip, const char* host, uint16_t port)
29-
: ip(ip),
29+
: client(client),
30+
localip(localip),
31+
ip(ip),
3032
host(host),
3133
port(port),
32-
connected(false),
33-
client(client),
34-
localip(localip)
34+
connected(false)
3535
{
3636
}
3737

utility/EthernetClientStream.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ class EthernetClientStream : public Stream
3838
void maintain(IPAddress localip);
3939

4040
private:
41+
Client &client;
4142
IPAddress localip;
4243
IPAddress ip;
4344
const char* host;
4445
uint16_t port;
45-
Client &client;
4646
bool connected;
4747
uint32_t time_connect;
4848
bool maintain();

0 commit comments

Comments
 (0)