Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem in Osal_GetTimeUs #218

Open
YSY4869 opened this issue Oct 29, 2024 · 1 comment
Open

Problem in Osal_GetTimeUs #218

YSY4869 opened this issue Oct 29, 2024 · 1 comment

Comments

@YSY4869
Copy link

YSY4869 commented Oct 29, 2024

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
Copy link
Contributor

dji-dev commented Oct 29, 2024

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

°°°

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants