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

Cyclic #include? #3

Closed
ul5255 opened this issue Aug 4, 2014 · 2 comments
Closed

Cyclic #include? #3

ul5255 opened this issue Aug 4, 2014 · 2 comments

Comments

@ul5255
Copy link

ul5255 commented Aug 4, 2014

Hi Dale,
Me again:

Line:
https://github.com/organix/pijFORTHos/blob/master/raspi.h#L7:

looks like a cyclic #include to me. Can this be removed?

I'm also not clear what these two lines do:
https://github.com/organix/pijFORTHos/blob/master/raspi.h#L20
and
https://github.com/organix/pijFORTHos/blob/master/raspi.h#L21 .

Does this mean they shadow the definitions of PUT_32 and GET_32
from start.s? If so, why not get rid of those definitions in
start.s?

I will try today at home to build the project. My goal is to
port an Arduino sketch such that I can control the Si504:
http://www.ov-selbstbau.de/wiki/index.php?title=Flexibler_Quarz-Oszillator_auf_Basis_Si504

Cheers,
Uwe.

@dalnefre
Copy link

dalnefre commented Aug 4, 2014

Nice catch, Thanks!

The #include is not really circular, because the #ifndef wrapper prevents multiple inclusion, even in this case.

The macros for PUT_32 and GET_32 are a way to inline equivalent functionality in C code (not the "volatile" keyword is important). The assembly-language versions are still there for cases where you need a real procedure to call. Also, if the optimizer gets too tricky with the macro-expanded versions, it's easy to comment them out and re-compile. I want to leave that option open.

Good luck with your project!

@ul5255
Copy link
Author

ul5255 commented Aug 5, 2014

Ok.

@ul5255 ul5255 closed this as completed Aug 5, 2014
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