From: Mikko Rasa Date: Thu, 7 Nov 2013 18:57:45 +0000 (+0200) Subject: Fix a logic error in arducontrol accessory control X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=2399146e4235d9923ee4256c413574d4395312e3;p=r2c2.git Fix a logic error in arducontrol accessory control --- diff --git a/source/libr2c2/arducontrol.cpp b/source/libr2c2/arducontrol.cpp index a1d2381..213a848 100644 --- a/source/libr2c2/arducontrol.cpp +++ b/source/libr2c2/arducontrol.cpp @@ -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;