mirror of
https://github.com/apache/nuttx.git
synced 2026-08-17 17:43:22 +08:00
up_rtc_rdalarm() computed tv_sec and tv_nsec from two separate evaluations of rt_timer_time_us() + offset + deadline. The RT timer advances between the two calls, so a read that straddles a second boundary yields an inconsistent timespec. Compute the microsecond value once into a local variable and derive both fields from that single snapshot. Signed-off-by: yushuailong <yyyusl@qq.com>