stm32: Reorganize stm32h7.c into major code blocks
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
de35790709
commit
e56b63fd7e
|
@ -4,15 +4,17 @@
|
||||||
//
|
//
|
||||||
// This file may be distributed under the terms of the GNU GPLv3 license.
|
// 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 "autoconf.h" // CONFIG_CLOCK_REF_FREQ
|
||||||
#include "board/armcm_boot.h" // VectorTable
|
#include "board/armcm_boot.h" // VectorTable
|
||||||
#include "command.h" // DECL_CONSTANT_STR
|
#include "command.h" // DECL_CONSTANT_STR
|
||||||
#include "internal.h" // enable_pclock
|
#include "internal.h" // enable_pclock
|
||||||
#include "sched.h" // sched_main
|
#include "sched.h" // sched_main
|
||||||
|
|
||||||
|
|
||||||
|
/****************************************************************
|
||||||
|
* Clock setup
|
||||||
|
****************************************************************/
|
||||||
|
|
||||||
#define FREQ_PERIPH (CONFIG_CLOCK_FREQ / 4)
|
#define FREQ_PERIPH (CONFIG_CLOCK_FREQ / 4)
|
||||||
|
|
||||||
// Enable a peripheral clock
|
// Enable a peripheral clock
|
||||||
|
@ -101,12 +103,6 @@ gpio_clock_enable(GPIO_TypeDef *regs)
|
||||||
enable_pclock((uint32_t)regs);
|
enable_pclock((uint32_t)regs);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Handle USB reboot requests
|
|
||||||
void
|
|
||||||
usb_request_bootloader(void)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
#if !CONFIG_STM32_CLOCK_REF_INTERNAL
|
#if !CONFIG_STM32_CLOCK_REF_INTERNAL
|
||||||
DECL_CONSTANT_STR("RESERVE_PINS_crystal", "PH0,PH1");
|
DECL_CONSTANT_STR("RESERVE_PINS_crystal", "PH0,PH1");
|
||||||
#endif
|
#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()
|
// Main entry point - called from armcm_boot.c:ResetHandler()
|
||||||
void
|
void
|
||||||
armcm_main(void)
|
armcm_main(void)
|
||||||
{
|
{
|
||||||
// Run SystemInit() and then restore VTOR
|
// Run SystemInit() and then restore VTOR
|
||||||
SystemInit();
|
SystemInit();
|
||||||
|
|
||||||
SCB->VTOR = (uint32_t)VectorTable;
|
SCB->VTOR = (uint32_t)VectorTable;
|
||||||
|
|
||||||
clock_setup();
|
clock_setup();
|
||||||
|
|
Loading…
Reference in New Issue