aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWojtek Kosior <kwojtus@protonmail.com>2019-12-31 20:21:06 +0100
committerWojtek Kosior <kwojtus@protonmail.com>2019-12-31 20:21:06 +0100
commit3fb88e3c0237379e32bd6d1d27465d5324726684 (patch)
tree1be51f6d846ae67c958773d6f487e5854848f28f
parent0d36a8bac1240eefdabe5ab96b9332cf73383d9d (diff)
downloadrpi-MMU-example-3fb88e3c0237379e32bd6d1d27465d5324726684.tar.gz
rpi-MMU-example-3fb88e3c0237379e32bd6d1d27465d5324726684.zip
make global.h more readable
-rw-r--r--global.h17
1 files changed, 12 insertions, 5 deletions
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