Possible Uninstall Fix, plus cleanup, more keysets
[pierogi] / protocols / spaceprotocol.cpp
index f6179ec..6ed91db 100644 (file)
@@ -1,5 +1,7 @@
 #include "spaceprotocol.h"
 
+#include "pirrx51hardware.h"
+
 SpaceProtocol::SpaceProtocol(
   QObject *guiObject,
   unsigned int index,
@@ -78,6 +80,33 @@ int SpaceProtocol::pushReverseBits(
 }
 
 
+int SpaceProtocol::pushInvertedBits(
+  const CommandSequence &bits,
+  PIRRX51Hardware &rx51device)
+{
+  int duration = 0;
+  CommandSequence::const_iterator i = bits.begin();
+  while (i != bits.end())
+  {
+    if (*i)
+    {
+      // Send the pulse for "Zero":
+      rx51device.addPair(zeroPulse, zeroSpace);
+      duration += (zeroPulse + zeroSpace);
+    }
+    else
+    {
+      // Send the pulse for "One":
+      rx51device.addPair(onePulse, oneSpace);
+      duration += (onePulse + oneSpace);
+    }
+    ++i;
+  }
+
+  return duration;
+}
+
+
 int SpaceProtocol::pushInvertedReverseBits(
   const CommandSequence &bits,
   PIRRX51Hardware &rx51device)