mirror of
https://github.com/apache/nuttx.git
synced 2025-12-10 04:04:18 +08:00
In multi-core environment where NuttX runs on each core, if one core sets the RTC time, the RTC value gotten on other cores is incorrect. This is caused by clock_gettime(CLOCK_MONOTONIC) function used to get elapsed time, which uses a core-specific global varaiable g_basetime as the base time. To fix this, update the g_basetime from the backup SRAM that can be shared between cores in setting/getting the RTC time. Signed-off-by: SPRESENSE <41312067+SPRESENSE@users.noreply.github.com>