-
Notifications
You must be signed in to change notification settings - Fork 24
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
Add option for providing an external implementation of clock functions #516
base: main
Are you sure you want to change the base?
Conversation
#else // defined(LF_EXTERNAL_CLOCK_PLUGIN) | ||
// The following empty "dummy" function is here to avoid an "Empty translation unit" compiler | ||
// warning if the user has defined LF_EXTERNAL_CLOCK_PLUGIN to provide their own implementation. | ||
void __clock_dummy_function(void) {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are using Werror=pedantic
which throws an error on empty translation units. This dummy definition avoids that problem.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice to add specific instructions for how to make use of this. E.g., "Add X to your target properties, put Y into your cmake include file, then provide your own foo.c file and link it in as follows..." These could go into a comment in clock.c.
This PR adds support for letting the user provide their own implementation of functions found in
clock.c
. This enables locking the physical time the runtime sees, to a simulator.