aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFredrik Thulin <fredrik@thulin.net>2016-05-14 16:07:50 +0200
committerFredrik Thulin <fredrik@thulin.net>2016-05-14 16:07:50 +0200
commit5d5fe691b454abccb42b4b7c0d0bc0c3c14f2e0f (patch)
treea838550bb341a36f4af8fe043ba0ff3ff67cf392
parent34e2db12555852bbc062ed11073bf35330f3bf9f (diff)
found paul is setting up HSE in TARGET_CRYPTECH_ALPHA
-rw-r--r--stm-init.c42
-rw-r--r--stm-init.h2
2 files changed, 0 insertions, 44 deletions
diff --git a/stm-init.c b/stm-init.c
index efcc025..f82ed16 100644
--- a/stm-init.c
+++ b/stm-init.c
@@ -48,9 +48,6 @@
/* Private variables ---------------------------------------------------------*/
/* Private function prototypes -----------------------------------------------*/
-#ifdef CRYPTECH_USE_HSE_CLOCK
-static void SystemClock_Config(void);
-#endif
#ifdef HAL_GPIO_MODULE_ENABLED
static void MX_GPIO_Init(void);
#endif
@@ -64,10 +61,6 @@ void stm_init(void)
/* MCU Configuration----------------------------------------------------------*/
-#ifdef CRYPTECH_USE_HSE_CLOCK
- SystemClock_Config();
-#endif
-
/* System interrupt init*/
/* Sets the priority grouping field */
HAL_NVIC_SetPriorityGrouping(NVIC_PRIORITYGROUP_0);
@@ -83,41 +76,6 @@ void stm_init(void)
#endif
}
-#ifdef CRYPTECH_USE_HSE_CLOCK
-/** System Clock Configuration
- *
- * HSE crystal at 25 MHz, end result is 180 MHz clock.
- */
-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);
-}
-#endif
-
#ifdef HAL_UART_MODULE_ENABLED
/* USART1 init function */
diff --git a/stm-init.h b/stm-init.h
index 489a2c6..ed80d01 100644
--- a/stm-init.h
+++ b/stm-init.h
@@ -43,6 +43,4 @@ extern void Error_Handler(void);
#define HAL_Delay osDelay
-#define CRYPTECH_USE_HSE_CLOCK
-
#endif /* __STM_INIT_H */