aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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