Payload-SDK icon indicating copy to clipboard operation
Payload-SDK copied to clipboard

Problem in Osal_GetTimeUs

Open YSY4869 opened this issue 1 year ago • 1 comments

Hi, I think there is a typo in the function Osal_GetTimeUs in file samples/sample_c/platform/linux/common/osal/osal.c

T_DjiReturnCode Osal_GetTimeUs(uint64_t *us)
{
    struct timeval time;

    gettimeofday(&time, NULL);
    *us = (time.tv_sec * 1000000 + time.tv_usec);

    if (s_localTimeUsOffset == 0) {
        s_localTimeUsOffset = *us;
    } else {
        *us = *us - s_localTimeMsOffset;
    }

    return DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS;
}

Maybe it should be *us = *us - s_localTimeUsOffset.

I notice that #140 also mentioned this.

YSY4869 avatar Oct 29 '24 04:10 YSY4869

Agent comment from Leon in Zendesk ticket #120512:

Hello, thank you for your feedback. It seems that it is indeed spelled wrong. We have fed back to the R&D team for confirmation. If there is a result, we will synchronize it with you again. Thank you again for your feedback~!

°°°

dji-dev avatar Oct 29 '24 12:10 dji-dev