Skip to content

Commit 7b81ccd

Browse files
run all example files through astyle formatter
1 parent 04a6b00 commit 7b81ccd

File tree

7 files changed

+232
-233
lines changed

7 files changed

+232
-233
lines changed

examples/AllInputsFirmata/AllInputsFirmata.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ byte pin;
2222
int analogValue;
2323
int previousAnalogValues[TOTAL_ANALOG_PINS];
2424

25-
byte portStatus[TOTAL_PORTS]; // each bit: 1=pin is digital input, 0=other/ignore
25+
byte portStatus[TOTAL_PORTS]; // each bit: 1=pin is digital input, 0=other/ignore
2626
byte previousPINs[TOTAL_PORTS];
2727

2828
/* timer variables */

examples/AnalogFirmata/AnalogFirmata.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ void analogWriteCallback(byte pin, int value)
5353
void reportAnalogCallback(byte pin, int value)
5454
{
5555
if (value == 0) {
56-
analogInputsToReport = analogInputsToReport &~ (1 << pin);
56+
analogInputsToReport = analogInputsToReport & ~ (1 << pin);
5757
}
5858
else { // everything but 0 enables reporting of that pin
5959
analogInputsToReport = analogInputsToReport | (1 << pin);

examples/EchoString/EchoString.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ void stringCallback(char *myString)
2121
}
2222

2323

24-
void sysexCallback(byte command, byte argc, byte*argv)
24+
void sysexCallback(byte command, byte argc, byte *argv)
2525
{
2626
Firmata.sendSysex(command, argc, argv);
2727
}

examples/OldStandardFirmata/OldStandardFirmata.ino

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ unsigned long previousMillis; // for comparison with currentMillis
5555

5656
void outputPort(byte portNumber, byte portValue)
5757
{
58-
portValue = portValue &~ portStatus[portNumber];
58+
portValue = portValue & ~ portStatus[portNumber];
5959
if (previousPINs[portNumber] != portValue) {
6060
Firmata.sendDigitalPort(portNumber, portValue);
6161
previousPINs[portNumber] = portValue;
@@ -72,7 +72,7 @@ void checkDigitalInputs(void)
7272
for (i = 0; i < TOTAL_PORTS; i++) {
7373
if (reportPINs[i]) {
7474
switch (i) {
75-
case 0: outputPort(0, PIND &~ B00000011); break; // ignore Rx/Tx 0/1
75+
case 0: outputPort(0, PIND & ~ B00000011); break; // ignore Rx/Tx 0/1
7676
case 1: outputPort(1, PINB); break;
7777
case 2: outputPort(2, PINC); break;
7878
}
@@ -104,15 +104,15 @@ void setPinModeCallback(byte pin, int mode) {
104104
switch (mode) {
105105
case INPUT:
106106
pinMode(pin, INPUT);
107-
portStatus[port] = portStatus[port] &~ (1 << (pin - offset));
107+
portStatus[port] = portStatus[port] & ~ (1 << (pin - offset));
108108
break;
109109
case OUTPUT:
110110
digitalWrite(pin, LOW); // disable PWM
111111
case PWM:
112112
pinMode(pin, OUTPUT);
113113
portStatus[port] = portStatus[port] | (1 << (pin - offset));
114114
break;
115-
//case ANALOG: // TODO figure this out
115+
//case ANALOG: // TODO figure this out
116116
default:
117117
Firmata.sendString("");
118118
}
@@ -131,7 +131,7 @@ void digitalWriteCallback(byte port, int value)
131131
switch (port) {
132132
case 0: // pins 2-7 (don't change Rx/Tx, pins 0 and 1)
133133
// 0xFF03 == B1111111100000011 0x03 == B00000011
134-
PORTD = (value &~ 0xFF03) | (PORTD & 0x03);
134+
PORTD = (value & ~ 0xFF03) | (PORTD & 0x03);
135135
break;
136136
case 1: // pins 8-13 (14,15 are disabled for the crystal)
137137
PORTB = (byte)value;
@@ -150,7 +150,7 @@ void digitalWriteCallback(byte port, int value)
150150
void reportAnalogCallback(byte pin, int value)
151151
{
152152
if (value == 0) {
153-
analogInputsToReport = analogInputsToReport &~ (1 << pin);
153+
analogInputsToReport = analogInputsToReport & ~ (1 << pin);
154154
}
155155
else { // everything but 0 enables reporting of that pin
156156
analogInputsToReport = analogInputsToReport | (1 << pin);
@@ -202,7 +202,7 @@ void setup()
202202
/* send digital inputs here, if enabled, to set the initial state on the
203203
* host computer, since once in the loop(), this firmware will only send
204204
* digital data on change. */
205-
if (reportPINs[0]) outputPort(0, PIND &~ B00000011); // ignore Rx/Tx 0/1
205+
if (reportPINs[0]) outputPort(0, PIND & ~ B00000011); // ignore Rx/Tx 0/1
206206
if (reportPINs[1]) outputPort(1, PINB);
207207
if (reportPINs[2]) outputPort(2, PINC);
208208

examples/StandardFirmata/StandardFirmata.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ void reportAnalogCallback(byte analogPin, int value)
346346
{
347347
if (analogPin < TOTAL_ANALOG_PINS) {
348348
if (value == 0) {
349-
analogInputsToReport = analogInputsToReport &~ (1 << analogPin);
349+
analogInputsToReport = analogInputsToReport & ~ (1 << analogPin);
350350
} else {
351351
analogInputsToReport = analogInputsToReport | (1 << analogPin);
352352
// Send pin value immediately. This is helpful when connected via

0 commit comments

Comments
 (0)