RTEMS | Draft: cpukit: add support for common CAN/CAN FD stack (!49)
Pavel Pisa (@ppisa)
gitlab at rtems.org
Fri Jun 28 12:47:10 UTC 2024
Pavel Pisa commented on a discussion on cpukit/include/dev/can/can-queue.h: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/49#note_108466
> +#define CAN_FIFOF_NOTIFYPEND ( 1 << 4 )
> +#define CAN_FIFOF_RTL_MEM ( 1 << 3 )
> +
> +/**
> + * @brief This function atomically tests FIFO flag to input flag.
> + *
> + * @param fifo Pointer to CAN FIFO Queue.
> + * @param flag Required flag to be tested.
> + *
> + * @return True if FIFO has the flag.
> + * @return False otherwise.
> + *
> + */
> +static inline int canque_fifo_test_fl( struct canque_fifo_t *fifo, int flag )
> +{
> + return ( atomic_load( &fifo->fifo_flags ) &flag ) ? 1 : 0;
It could be problematic if int is shorter than fifo_flags. Then ternary is safe option.
--
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/49#note_108466
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/20240628/fd256ccc/attachment-0001.htm>
More information about the bugs
mailing list