From: ian Date: Tue, 4 Jan 2005 22:21:08 +0000 (+0000) Subject: end of packet bit is top bit now X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ijackson/git?a=commitdiff_plain;h=a3c6bb36a34cc916394bc069357cc27e7f246a58;p=trains.git end of packet bit is top bit now --- diff --git a/hostside/nmra.c b/hostside/nmra.c index 443f235..ee5df11 100644 --- a/hostside/nmra.c +++ b/hostside/nmra.c @@ -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); }