From: ian Date: Thu, 29 Dec 2005 18:20:57 +0000 (+0000) Subject: invert sense of "more command" bit X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ijackson/git?a=commitdiff_plain;h=317364006d592ddf287422d9f689ae473afc2fd9;p=trains.git invert sense of "more command" bit --- diff --git a/hostside/nmra.c b/hostside/nmra.c index be0d38a..24a92b0 100644 --- a/hostside/nmra.c +++ b/hostside/nmra.c @@ -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; }