]> mj.ucw.cz Git - home-hw.git/commitdiff
BSB: Bug fixes
authorMartin Mares <mj@ucw.cz>
Fri, 28 Feb 2020 16:11:31 +0000 (17:11 +0100)
committerMartin Mares <mj@ucw.cz>
Fri, 28 Feb 2020 16:11:31 +0000 (17:11 +0100)
bsb/firmware/main.c

index 31a64a6c94ea32952216d11d1ab451f76826915b..61716b0f28a31681de53484256abb4106a79a6ed 100644 (file)
@@ -432,7 +432,7 @@ static void bsb_send(byte *buf, uint len)
 static bool bsb_is_reply_for(byte *reply, byte *req) {
        // Check source and destination address
        if (reply[BF_DEST] != BSB_ADDR_GATEWAY ||
-           reply[BF_SRC] != req[BF_DEST] ^ 0x80)
+           reply[BF_SRC] != (req[BF_DEST] ^ 0x80))
                return 0;
 
        // Extract body of request and reply
@@ -445,6 +445,8 @@ static bool bsb_is_reply_for(byte *reply, byte *req) {
        rq_len -= BF_BODY + 2;
        rp_len -= BF_BODY + 2;
 
+       // debug_printf("BSB: Matching reply op=%u/len=%u for op=%u/len=%u\n", reply[BF_OP], rp_len, req[BF_OP], rq_len);
+
        switch (req[BF_OP]) {
                case BSB_OP_QUERY:
                        switch (reply[BF_OP]) {