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

convert efitimeus_t to tagged_numeric_t #6409 #15

Closed
wants to merge 2 commits into from

Conversation

kifir23917
Copy link
Member

No description provided.

@@ -24,7 +34,7 @@ using efitick_t = int64_t;
/**
* 64 bit time in microseconds (1/1_000_000 of a second), since boot
*/
using efitimeus_t = int64_t;
using efitimeus_t = tagged_numeric_t<timestamp_tag_s<int64_t, time_unit::MICROSECOND>>;
Copy link
Contributor

Choose a reason for hiding this comment

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

can/should we just use std::chrono instead?

Copy link
Member Author

Choose a reason for hiding this comment

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

Well, it makes sense. I will rewrite code using std::chrono::duration<int64_t, micros> and std::chrono::time_point.

Copy link
Contributor

Choose a reason for hiding this comment

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

Well, it makes sense. I will rewrite code using std::chrono::duration<int64_t, micros> and std::chrono::time_point.

What about our 1/168_000_000 second ticks and our 1/218_000_000 second tickets depending on target platform?

Copy link
Contributor

Choose a reason for hiding this comment

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

What about our 1/168_000_000 second ticks and our 1/218_000_000 second tickets depending on target platform?

// 4mhz was chosen because it's the GCD of (84, 108, 200), the three speeds of STM32 TIM5 clock currently supported
// https://www.wolframalpha.com/input/?i=common+factors+of+168+180+216
#define US_TO_NT_MULTIPLIER (4)

Copy link
Contributor

Choose a reason for hiding this comment

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

@kifir23917 kifir23917 marked this pull request as draft April 25, 2024 18:59
@kifir23917
Copy link
Member Author

#16

@kifir23917 kifir23917 closed this Apr 26, 2024
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.

3 participants