From 3fb88e3c0237379e32bd6d1d27465d5324726684 Mon Sep 17 00:00:00 2001 From: Wojtek Kosior Date: Tue, 31 Dec 2019 20:21:06 +0100 Subject: make global.h more readable --- global.h | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'global.h') diff --git a/global.h b/global.h index 6fc19ed..202ca85 100644 --- a/global.h +++ b/global.h @@ -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 -- cgit v1.2.3