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

Compiler defined compiler macros #36

Closed
VedantParanjape opened this issue Jul 16, 2020 · 2 comments
Closed

Compiler defined compiler macros #36

VedantParanjape opened this issue Jul 16, 2020 · 2 comments

Comments

@VedantParanjape
Copy link

VedantParanjape commented Jul 16, 2020

Does pru-gcc have any kind of compiler defined macros, like when i pass -mmcu=am335x.pru0 or am335x.pru1, is there some way i could so something like this:

#ifdef __PRU0__
    #define HOSTINT (uint32_t) 1 << 30
#elif __PRU1__
    #define HOSTINT (uint32_t) 1 << 31
#else 
@dinuxbg
Copy link
Owner

dinuxbg commented Jul 16, 2020

$ pru-gcc -E -dM -mmcu=am335x.pru0 - </dev/null
#define __AM335X_PRU0__ 1

The mmcu option actually picks a per-core/SoC file. For the gory details see here: https://github.com/dinuxbg/gnuprumcu/blob/master/device-specs/am335x.pru0

@dinuxbg dinuxbg closed this as completed Jul 16, 2020
@VedantParanjape
Copy link
Author

Thanks this helped !

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