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

Clkinit.c #20

Open
LdB-ECM opened this issue Sep 1, 2018 · 0 comments
Open

Clkinit.c #20

LdB-ECM opened this issue Sep 1, 2018 · 0 comments

Comments

@LdB-ECM
Copy link

LdB-ECM commented Sep 1, 2018

I am trying to merge some stuff back to your master but that file (clkinit.c) causes problems it's being treated as if it's a system as in it is in the system directory.

The commenting about the #ifdef XINU_PLATFORM_X86 already makes the problem quite clear the file needs to be one of two choices
1.) Implementation made platform specific .. clkinit.c moves to each platform
2.) Place a callback function pointer in the header which start NULL

void (*clkinit_callback) (void) = NULL;

To do option 1 you can simply copy the existing clkinit.c into each platform and add to that platform makerules. You can then remove the file from the system directory. I would simply override the clkinit.c locally on the pi platform. The #ifdef could then also be removed from the x86 platform and throw out the #else code for that platform.

If we do option 2. All that needs to happen is the call back function pointer is expected to be set in platforminit.c as in "clkinit_callback = myplatform_clockInit". The x86 platform and I can then both set that callback function and the ClkInit.c code simple needs to say

if (clkinit_callback != NULL) clkinit_calback();

I don't mind which way it is done but obviously as the maintainer that is up to you

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

1 participant