dji-sdk / Payload-SDK

DJI Payload SDK Official Repository
https://github.com/dji-sdk/Payload-SDK
Other
265 stars 118 forks source link

Problem in Osal_GetTimeUs #218

Open YSY4869 opened 3 weeks ago

YSY4869 commented 3 weeks ago

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.

dji-dev commented 3 weeks ago

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~!

°°°