RTEMS | grlib/b1553rt: Fix bit shift direction (!273)

Matteo Concas (@matteo.concas) gitlab at rtems.org
Tue Oct 29 12:32:50 UTC 2024




Matteo Concas commented on a discussion on bsps/shared/grlib/1553/b1553rt.c: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/273#note_113963

 >          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 | 

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. 

Another way to do this would be
```
~(tsw&RT_TSW_OK)>>7 & (1<<7)
```
But I don't think this is be cleaner than the current fix.

-- 
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/273#note_113963
You're receiving this email because of your account on gitlab.rtems.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/bugs/attachments/20241029/c3eb10b4/attachment.htm>


More information about the bugs mailing list