Bug in date_time library if last updated time is not too old

Hello, I have stumbled upon a case exposing a bug in your lib/date_time/date_time_core.c.

In my case the modem re-registered and got a time from the network (%XTIME) right before the rescheduled date_time-worker fired. That caused the last updated time be within CONFIG_DATE_TIME_UPDATE_INTERVAL_SECONDS.

The problem here is that in date_time_core.c:126 the date_time_core_current_check() returns 0. This causes date_time_update_work_fn trying to reschedule the worker before resetting the atomic reschedule_blocked flag, and the rescheduling fail.
Parents Reply Children
No Data
Related