sm8450-common: gps: GNSS adapter: need to check validity of elapsed real time

1: Need to check the validity of elapased real time before
   marking it as valid
2: Increase the allowed time between two get boot time call
   from 10 micro seconds to 2 milli-seconds

Change-Id: If2f7ddb23ce72cb52f294ff44353f5c9a9421a9c
CRs-fixed: 3281559
This commit is contained in:
Vrutti Patel
2023-07-06 16:42:54 +05:30
committed by Arian
parent 7de395884a
commit 341ddf5768
2 changed files with 8 additions and 4 deletions

View File

@@ -1171,7 +1171,7 @@ bool ElapsedRealtimeEstimator::getCurrentTime(
struct timespec sinceBootTime = {};
struct timespec sinceBootTimeTest = {};
bool clockGetTimeSuccess = false;
const uint32_t MAX_TIME_DELTA_VALUE_NANOS = 10000;
const uint32_t MAX_TIME_DELTA_VALUE_NANOS = 2000000; // 2 milli-seconds
const uint32_t MAX_GET_TIME_COUNT = 20;
/* Attempt to get CLOCK_REALTIME and CLOCK_BOOTIME in succession without an interruption
or context switch (for up to MAX_GET_TIME_COUNT times) to avoid errors in the calculation */