From 2399146e4235d9923ee4256c413574d4395312e3 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Thu, 7 Nov 2013 20:57:45 +0200 Subject: [PATCH] Fix a logic error in arducontrol accessory control --- source/libr2c2/arducontrol.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- 2.43.0