]> git.tdb.fi Git - r2c2.git/commitdiff
Fix a logic error in arducontrol accessory control
authorMikko Rasa <tdb@tdb.fi>
Thu, 7 Nov 2013 18:57:45 +0000 (20:57 +0200)
committerMikko Rasa <tdb@tdb.fi>
Thu, 7 Nov 2013 18:57:45 +0000 (20:57 +0200)
source/libr2c2/arducontrol.cpp

index a1d238103004d1e95cba46ffd65fb57ef7b6caf7..213a848d95a5d921406fb750bb284fd08818a952 100644 (file)
@@ -515,7 +515,7 @@ unsigned ArduControl::Accessory::create_state_command(unsigned b, bool c, char *
                throw invalid_argument("Accessory::create_state_command");
 
        unsigned a = (address+b+3)*2;
-       if((state.pending>>b)&1)
+       if(!((state.pending>>b)&1))
                ++a;
        buffer[0] = MOTOROLA_SOLENOID;
        buffer[1] = a>>3;