chiark / gitweb /
end of packet bit is top bit now
authorian <ian>
Tue, 4 Jan 2005 22:21:08 +0000 (22:21 +0000)
committerian <ian>
Tue, 4 Jan 2005 22:21:08 +0000 (22:21 +0000)
hostside/nmra.c

index 443f23587e5ab50f9f182fb7b836bd90325e9d2c..ee5df112cf1eb45763a7836bf393f94e1c235e93 100644 (file)
@@ -31,12 +31,12 @@ void nmra_transmit(const Byte *nmra_packet, int length) {
       }
     }
     assert(encp < encoded + COMMAND_ENCODED_MAX);
-    *encp++= (working >> 8) & 0xfe; /* top 7 bits, shifted left one */
+    *encp++= (working >> 9) & 0x7f; /* top 7 bits, right-justified */
     working <<= 7;
     working_qty -= 7;
   }
   assert(encp > encoded);
-  encp[-1] |= 0x01; /* `end of command' bit */
+  encp[-1] |= 0x80; /* `end of command' bit */
 
   command_transmit(encoded, encp - encoded);
 }