Kinsey Moore started a new discussion on bsps/aarch64/raspberrypi/start/watchdog.c: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/120#note_110576 > +int raspberrypi_watchdog_timeout; > + > +void raspberrypi_watchdog_init() > +{ > + raspberrypi_watchdog_timeout = 0; > +} > + > +void raspberrypi_watchdog_start(unsigned int timeout_ms) > +{ > + double timeout_sec; > + raspberrypi_watchdog_timeout = timeout_ms; > + > + timeout_sec = timeout_ms / 1000; > + > + PM_WDOG = BCM2711_PM_PASSWD_MAGIC | > + ((int)(timeout_sec * 65536) & BCM2711_PM_WDOG_MASK); I would recommend against using floating point math here since it's not necessary. Instead, you can use a uint32_t and reorder the operations such that the multiplication occurs first followed by the division. The get_remaining_time() function should also return a uint32_t utilizing similar principles. -- View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/120#note_110576 You're receiving this email because of your account on gitlab.rtems.org.
_______________________________________________ bugs mailing list [email protected] http://lists.rtems.org/mailman/listinfo/bugs
