git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1366 35acf78f-673a-0410-8e92-d51de3d6d3f4

master
gdisirio 2009-11-29 21:07:43 +00:00
parent b21a96e14b
commit 39d171f7ef
4 changed files with 11 additions and 28 deletions

View File

@ -37,11 +37,6 @@ void hwinit0(void) {
*/
void hwinit1(void) {
/*
* NVIC/SCB initialization.
*/
stm32_nvic_init();
/*
* HAL initialization.
*/

View File

@ -37,11 +37,6 @@ void hwinit0(void) {
*/
void hwinit1(void) {
/*
* NVIC/SCB initialization.
*/
stm32_nvic_init();
/*
* HAL initialization.
*/

View File

@ -72,6 +72,17 @@ const STM32GPIOConfig pal_default_config =
*/
void hal_lld_init(void) {
/* Note: PRIGROUP 4:0 (4:4).*/
SCB->AIRCR = AIRCR_VECTKEY | SCB_AIRCR_PRIGROUP_0 | SCB_AIRCR_PRIGROUP_1;
NVICSetSystemHandlerPriority(HANDLER_SVCALL, PRIORITY_SVCALL);
NVICSetSystemHandlerPriority(HANDLER_SYSTICK, PRIORITY_SYSTICK);
NVICSetSystemHandlerPriority(HANDLER_PENDSV, PRIORITY_PENDSV);
/* Systick initialization.*/
SysTick->LOAD = SYSCLK / (8000000 / CH_FREQUENCY) - 1;
SysTick->VAL = 0;
SysTick->CTRL = SysTick_CTRL_ENABLE | SysTick_CTRL_TICKINT;
#if CH_HAL_USE_ADC || CH_HAL_USE_SPI
dmaInit();
#endif
@ -108,21 +119,4 @@ void stm32_clock_init(void) {
;
}
/**
* @brief STM32 NVIC/SCB/SYSTICK initialization.
* @note All the involved constants come from the file @p board.h.
*/
void stm32_nvic_init(void) {
/* Note: PRIGROUP 4:0 (4:4).*/
SCB->AIRCR = AIRCR_VECTKEY | SCB_AIRCR_PRIGROUP_0 | SCB_AIRCR_PRIGROUP_1;
NVICSetSystemHandlerPriority(HANDLER_SVCALL, PRIORITY_SVCALL);
NVICSetSystemHandlerPriority(HANDLER_SYSTICK, PRIORITY_SYSTICK);
NVICSetSystemHandlerPriority(HANDLER_PENDSV, PRIORITY_PENDSV);
SysTick->LOAD = SYSCLK / (8000000 / CH_FREQUENCY) - 1;
SysTick->VAL = 0;
SysTick->CTRL = SysTick_CTRL_ENABLE | SysTick_CTRL_TICKINT;
}
/** @} */

View File

@ -61,7 +61,6 @@ extern "C" {
#endif
void hal_lld_init(void);
void stm32_clock_init(void);
void stm32_nvic_init(void);
#ifdef __cplusplus
}
#endif