RTEMS | dev/serial/zynq: Improve baud calculation and simplify code (!199)

Kinsey Moore (@opticron) gitlab at rtems.org
Tue Sep 17 01:40:49 UTC 2024




Kinsey Moore commented on a discussion on bsps/include/dev/serial/zynq-uart-regs.h: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/199#note_112132

 > + * @param desired_baud is the desired baud for an Zynq UART device.
 > + *
 > + * @param mode_clks is the value of the CLKS bit of the Zynq UART mode register.
 > + *
 > + * @param cd_ptr[out] is a reference to an uint32_t object.  The function
 > + *   stores the calculated clock divisor to this object.
 > + *
 > + * @param bdiv_ptr[out] is a reference to an uint32_t object.  The function
 > + *   stores the calculated baud divisor to this object.
 > + *
 > + * @return Returns the absolute error of the calculated baud to the desired
 > + *   baud in Hz.
 > + */
 > +uint32_t zynq_uart_calculate_baud(
 > +  uint32_t  desired_baud,
 > +  uint32_t  mode_clks,

A bool implicitly casts to 0 or 1, but the assert is acceptable.

-- 
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/199#note_112132
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/20240917/7bc4c242/attachment-0001.htm>


More information about the bugs mailing list