From 8820b8e63f3f995523e7608196051e18c95c09e4 Mon Sep 17 00:00:00 2001 From: Matteo Concas Date: Fri, 25 Oct 2024 09:59:51 +0200 Subject: [PATCH] grlib/b1553rt: Fix bit shift direction The RT_TSW_OK field is set to 1 if there was no error. The Message Error (ME) field indicates an error and must be set to 0 if there was no error so the result of tsw&RT_TSW_OK must be negated. It is then left-shifted to the Messsage Error (ME) bit field of the message information word. Fix issue CID 1399772 --- bsps/shared/grlib/1553/b1553rt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bsps/shared/grlib/1553/b1553rt.c b/bsps/shared/grlib/1553/b1553rt.c index 7a4e2535bd..cf94dfba5a 100644 --- a/bsps/shared/grlib/1553/b1553rt.c +++ b/bsps/shared/grlib/1553/b1553rt.c @@ -745,7 +745,7 @@ static void b1553rt_interrupt(void *arg) tsw = READ_DMA(&rt->mem[tx*0x3E0+suba]); /* Build Message Information Word (B1553BRM-style) */ - miw = (wc<<11) | (tsw&RT_TSW_BUS)>>4 | !(tsw&RT_TSW_OK)>>7 | (tsw&RT_TSW_ILL)>>5 | + miw = (wc<<11) | (tsw&RT_TSW_BUS)>>4 | !(tsw&RT_TSW_OK)<<7 | (tsw&RT_TSW_ILL)>>5 | (tsw&RT_TSW_PAR)>>5 | (tsw&RT_TSW_MAN)>>7; descriptor = (tx << 5) | suba;