@@ -55,7 +55,7 @@ unsigned long previousMillis; // for comparison with currentMillis
5555
5656void 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)
150150void 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
0 commit comments