summaryrefslogtreecommitdiff
path: root/prototype/fw/include
diff options
context:
space:
mode:
authorjaseg <git@jaseg.de>2020-11-26 12:39:21 +0100
committerjaseg <git@jaseg.de>2020-11-26 12:39:21 +0100
commit9b5625f12ae067a1583252d41febef848f055588 (patch)
tree71ce1935254fec9bca064aa08dfe6eb7ef0e0c3e /prototype/fw/include
parent451904a0c5fae3bd28d35c7128df3a9db1a04b26 (diff)
downloadihsm-9b5625f12ae067a1583252d41febef848f055588.tar.gz
ihsm-9b5625f12ae067a1583252d41febef848f055588.tar.bz2
ihsm-9b5625f12ae067a1583252d41febef848f055588.zip
Make firmware build and run
Diffstat (limited to 'prototype/fw/include')
-rw-r--r--prototype/fw/include/global.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/prototype/fw/include/global.h b/prototype/fw/include/global.h
index 138cbc9..d0c56d7 100644
--- a/prototype/fw/include/global.h
+++ b/prototype/fw/include/global.h
@@ -12,4 +12,8 @@
#include <generated/stm32_device.h>
+#define APB1_PRESC (1<<(APBPrescTable[(RCC->CFGR & RCC_CFGR_PPRE1_Msk) >> RCC_CFGR_PPRE1_Pos]))
+#define APB2_PRESC (1<<(APBPrescTable[(RCC->CFGR & RCC_CFGR_PPRE2_Msk) >> RCC_CFGR_PPRE2_Pos]))
+#define AHB_PRESC (1<<(AHBPrescTable[(RCC->CFGR & RCC_CFGR_HPRE_Msk) >> RCC_CFGR_HPRE_Pos]))
+
#endif /* __GLOBAL_H__ */