aboutsummaryrefslogtreecommitdiffstats
path: root/src/stm32/stm32h7.c
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2021-12-18 20:02:31 -0500
committerKevin O'Connor <kevin@koconnor.net>2021-12-23 22:15:25 -0500
commite56b63fd7e4400b8c6bca5d42d53dd6786f2a293 (patch)
tree9cf73ecbc4e1da61aad93f5a9884a218bd7e54b9 /src/stm32/stm32h7.c
parentde35790709c4cbdc20fac4cf96c96fa2cd1fdacb (diff)
downloadkutter-e56b63fd7e4400b8c6bca5d42d53dd6786f2a293.tar.gz
kutter-e56b63fd7e4400b8c6bca5d42d53dd6786f2a293.tar.xz
kutter-e56b63fd7e4400b8c6bca5d42d53dd6786f2a293.zip
stm32: Reorganize stm32h7.c into major code blocks
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src/stm32/stm32h7.c')
-rw-r--r--src/stm32/stm32h7.c31
1 files changed, 21 insertions, 10 deletions
diff --git a/src/stm32/stm32h7.c b/src/stm32/stm32h7.c
index 1a637e79..cd5ed0c6 100644
--- a/src/stm32/stm32h7.c
+++ b/src/stm32/stm32h7.c
@@ -4,15 +4,17 @@
//
// This file may be distributed under the terms of the GNU GPLv3 license.
-
-// I2C is not supported
-
#include "autoconf.h" // CONFIG_CLOCK_REF_FREQ
#include "board/armcm_boot.h" // VectorTable
#include "command.h" // DECL_CONSTANT_STR
#include "internal.h" // enable_pclock
#include "sched.h" // sched_main
+
+/****************************************************************
+ * Clock setup
+ ****************************************************************/
+
#define FREQ_PERIPH (CONFIG_CLOCK_FREQ / 4)
// Enable a peripheral clock
@@ -101,12 +103,6 @@ gpio_clock_enable(GPIO_TypeDef *regs)
enable_pclock((uint32_t)regs);
}
-// Handle USB reboot requests
-void
-usb_request_bootloader(void)
-{
-}
-
#if !CONFIG_STM32_CLOCK_REF_INTERNAL
DECL_CONSTANT_STR("RESERVE_PINS_crystal", "PH0,PH1");
#endif
@@ -224,13 +220,28 @@ clock_setup(void)
}
}
+
+/****************************************************************
+ * USB bootloader
+ ****************************************************************/
+
+// Handle USB reboot requests
+void
+usb_request_bootloader(void)
+{
+}
+
+
+/****************************************************************
+ * Startup
+ ****************************************************************/
+
// Main entry point - called from armcm_boot.c:ResetHandler()
void
armcm_main(void)
{
// Run SystemInit() and then restore VTOR
SystemInit();
-
SCB->VTOR = (uint32_t)VectorTable;
clock_setup();