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

Fix clock realtime monotonic #574

Closed
wants to merge 5 commits into from
Closed

Conversation

jlaitine
Copy link

@jlaitine jlaitine commented Dec 1, 2023

Changing the use of CLOCK_REALTIME -> CLOCK_MONOTONIC in a couple of places

This PR includes one extra patch for fixing buiding one SITL/Test file.

…LTIME -> CLOCK_MONOTONIC in SITL"

This reverts commit 556c3a3.
This is a fix for: 73cda71
     Author: Jukka Laitinen <[email protected]>
     Date:   Wed Apr 27 10:55:23 2022 +0400

         Change orb_publish interface and intialization of advertiser handles

Signed-off-by: Jukka Laitinen <[email protected]>
@jlaitine jlaitine requested a review from pussuw December 1, 2023 12:47
int take_timedwait(struct timespec *abstime)
{
#if defined(CONFIG_ARCH_BOARD_PX4_SITL)
return px4_sem_timedwait(&_sem, abstime);
Copy link
Author

@jlaitine jlaitine Dec 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not 100% right, but needed for SITL because of lockstep scheduler. px4_sem_timedwait acts as a wrapper around that as well.

#if defined(CONFIG_ARCH_BOARD_PX4_SITL)
return px4_sem_timedwait(&_sem, abstime);
#else
return sem_clockwait(&_sem, CLOCK_MONOTONIC, abstime);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

px4_sem_clockwait?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, could introduce that. might reduce confusion...

@jlaitine jlaitine closed this Feb 22, 2024
@jlaitine jlaitine deleted the fix_clock_realtime_monotonic branch February 22, 2024 08:01
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

Successfully merging this pull request may close these issues.

2 participants