diff options
Diffstat (limited to 'stm-init.c')
-rw-r--r-- | stm-init.c | 67 |
1 files changed, 0 insertions, 67 deletions
@@ -48,7 +48,6 @@ /* Private variables ---------------------------------------------------------*/ /* Private function prototypes -----------------------------------------------*/ -static void SystemClock_Config(void); #ifdef HAL_GPIO_MODULE_ENABLED static void MX_GPIO_Init(void); #endif @@ -61,12 +60,6 @@ void stm_init(void) /* MCU Configuration----------------------------------------------------------*/ - /* Reset of all peripherals, Initializes the Flash interface and the Systick. */ - HAL_Init(); - - /* Configure the system clock */ - SystemClock_Config(); - /* System interrupt init*/ /* Sets the priority grouping field */ HAL_NVIC_SetPriorityGrouping(NVIC_PRIORITYGROUP_0); @@ -81,66 +74,6 @@ void stm_init(void) #endif } -/** System Clock Configuration - * - * HSE crystal at 25 MHz, end result is 180 MHz clock. - */ -static void SystemClock_Config(void) -{ - RCC_ClkInitTypeDef RCC_ClkInitStruct; - RCC_OscInitTypeDef RCC_OscInitStruct; - - __PWR_CLK_ENABLE(); - - __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1); - - RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE; - RCC_OscInitStruct.HSEState = RCC_HSE_ON; - RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; - RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; - RCC_OscInitStruct.PLL.PLLM = 25; - RCC_OscInitStruct.PLL.PLLN = 360; - RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2; - RCC_OscInitStruct.PLL.PLLQ = 4; - HAL_RCC_OscConfig(&RCC_OscInitStruct); - - HAL_PWREx_ActivateOverDrive(); - - RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2; - RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; - RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; - RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV4; - RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV2; - HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_5); -} - -#if 0 -/** System Clock Configuration - * - * HSI source, end result is 16 MHz SYSCLK - * -*/ -static void old_SystemClock_Config(void) -{ - - RCC_OscInitTypeDef RCC_OscInitStruct; - - __PWR_CLK_ENABLE(); - - __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE3); - - RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI; - RCC_OscInitStruct.HSIState = RCC_HSI_ON; - RCC_OscInitStruct.HSICalibrationValue = 6; - RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE; - HAL_RCC_OscConfig(&RCC_OscInitStruct); - - /* XXX Does this need HAL_PWREx_ActivateOverDrive() and - * HAL_RCC_ClockConfig() to function properly?? - */ -} -#endif - #ifdef HAL_UART_MODULE_ENABLED /* USART2 init function */ static void MX_USART2_UART_Init(void) |