summaryrefslogtreecommitdiff
path: root/reset-controller/fw/src/sr_global.h
diff options
context:
space:
mode:
authorjaseg <git-bigdata-wsl-arch@jaseg.de>2021-04-09 18:38:02 +0200
committerjaseg <git-bigdata-wsl-arch@jaseg.de>2021-04-09 18:38:57 +0200
commit50998fcfb916ae251309bd4b464f2c122e8cb30d (patch)
tree4ecf7a7443b75ab51c4dc0c0fc9289342dc7d6a0 /reset-controller/fw/src/sr_global.h
parent312fee491cfab436d52db4b6265107e20f3e1293 (diff)
downloadmaster-thesis-50998fcfb916ae251309bd4b464f2c122e8cb30d.tar.gz
master-thesis-50998fcfb916ae251309bd4b464f2c122e8cb30d.tar.bz2
master-thesis-50998fcfb916ae251309bd4b464f2c122e8cb30d.zip
Repo re-org
Diffstat (limited to 'reset-controller/fw/src/sr_global.h')
-rw-r--r--reset-controller/fw/src/sr_global.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/reset-controller/fw/src/sr_global.h b/reset-controller/fw/src/sr_global.h
new file mode 100644
index 0000000..97db4e4
--- /dev/null
+++ b/reset-controller/fw/src/sr_global.h
@@ -0,0 +1,35 @@
+#ifndef __SR_GLOBAL_H__
+#define __SR_GLOBAL_H__
+
+#include <stdint.h>
+#include <sys/types.h>
+
+#ifndef SIMULATION
+#include <stm32f407xx.h>
+#include <stm32f4_isr.h>
+#endif
+
+#define UNUSED(x) ((void) x)
+#define ARRAY_LENGTH(x) (sizeof(x) / sizeof(x[0]))
+
+#define unused_a __attribute__((unused))
+
+extern unsigned int sysclk_speed;
+extern unsigned int apb1_speed;
+extern unsigned int apb2_speed;
+extern unsigned int auxclk_speed;
+extern unsigned int apb1_timer_speed;
+extern unsigned int apb2_timer_speed;
+
+extern struct leds {
+ unsigned int comm_tx;
+} leds;
+static inline uint16_t htole(uint16_t val) { return val; }
+
+void __libc_init_array(void);
+
+static inline void panic(void) {
+ asm volatile ("bkpt");
+}
+
+#endif /* __SR_GLOBAL_H__ */