diff options
author | Wojtek Kosior <kwojtus@protonmail.com> | 2019-12-31 20:21:06 +0100 |
---|---|---|
committer | Wojtek Kosior <kwojtus@protonmail.com> | 2019-12-31 20:21:06 +0100 |
commit | 3fb88e3c0237379e32bd6d1d27465d5324726684 (patch) | |
tree | 1be51f6d846ae67c958773d6f487e5854848f28f | |
parent | 0d36a8bac1240eefdabe5ab96b9332cf73383d9d (diff) | |
download | rpi-MMU-example-3fb88e3c0237379e32bd6d1d27465d5324726684.tar.gz rpi-MMU-example-3fb88e3c0237379e32bd6d1d27465d5324726684.zip |
make global.h more readable
-rw-r--r-- | global.h | 17 |
1 files changed, 12 insertions, 5 deletions
@@ -4,16 +4,23 @@ // board type, raspi2 #define RASPI 2 +// conditionally #define PERIF_BASE #if RASPI == 4 + #define PERIF_BASE 0xFE000000 -#else -#if RASPI == 3 || RASPI == 2 + +#elif RASPI == 3 || RASPI == 2 + #define PERIF_BASE 0x3F000000 -#else + +#else // if RASPI == 1 + #define PERIF_BASE 0x20000000 -#endif // RASPI == 3 || RASPI == 2 -#endif // RASPI == 4 +#endif + +// GPIO_BASE is #define'd in terms of PERIF_BASE +// (as in sane kernels - like linux, not like in wiki.osdev codes...) #define GPIO_BASE (PERIF_BASE + 0x200000) #endif // GLOBAL_H |