chiark / gitweb /
invert sense of "more command" bit
authorian <ian>
Thu, 29 Dec 2005 18:20:57 +0000 (18:20 +0000)
committerian <ian>
Thu, 29 Dec 2005 18:20:57 +0000 (18:20 +0000)
hostside/nmra.c

index be0d38ab9f6b803528bc3a533c5a14a11f73f086..24a92b051976cb538169a83e9f023b6d85b0f76b 100644 (file)
@@ -44,12 +44,13 @@ void nmra_encodeforpic(const Nmra *packet, PicInsn *pi) {
       }
     }
     assert(encp < pi->d + COMMAND_ENCODED_MAX);
-    *encp++= (working >> 9) & 0x7f; /* top 7 bits, right-justified */
+    *encp++= ((working >> 9) & 0x7f) | 0x80;
+      /* top 7 bits, right-justified, plus `more command' bit */
     working <<= 7;
     working_qty -= 7;
   }
   assert(encp > pi->d);
-  encp[-1] |= 0x80; /* `end of command' bit */
+  encp[-1] &= ~0x80; /* clear `more command' bit */
   pi->l= encp - pi->d;
 }