|
2 | 2 | ****************************************************************************** |
3 | 3 | * @file system_stm32f1xx.c |
4 | 4 | * @author MCD Application Team |
5 | | - * @version V4.2.0 |
6 | | - * @date 31-March-2017 |
7 | 5 | * @brief CMSIS Cortex-M3 Device Peripheral Access Layer System Source File. |
8 | 6 | * |
9 | 7 | * 1. This file provides two functions and one global variable to be called from |
|
35 | 33 | ****************************************************************************** |
36 | 34 | * @attention |
37 | 35 | * |
38 | | - * <h2><center>© COPYRIGHT(c) 2017 STMicroelectronics</center></h2> |
| 36 | + * <h2><center>© Copyright (c) 2017 STMicroelectronics. |
| 37 | + * All rights reserved.</center></h2> |
39 | 38 | * |
40 | | - * Redistribution and use in source and binary forms, with or without modification, |
41 | | - * are permitted provided that the following conditions are met: |
42 | | - * 1. Redistributions of source code must retain the above copyright notice, |
43 | | - * this list of conditions and the following disclaimer. |
44 | | - * 2. Redistributions in binary form must reproduce the above copyright notice, |
45 | | - * this list of conditions and the following disclaimer in the documentation |
46 | | - * and/or other materials provided with the distribution. |
47 | | - * 3. Neither the name of STMicroelectronics nor the names of its contributors |
48 | | - * may be used to endorse or promote products derived from this software |
49 | | - * without specific prior written permission. |
50 | | - * |
51 | | - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
52 | | - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
53 | | - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
54 | | - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
55 | | - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
56 | | - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
57 | | - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
58 | | - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
59 | | - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
60 | | - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 39 | + * This software component is licensed by ST under BSD 3-Clause license, |
| 40 | + * the "License"; You may not use this file except in compliance with the |
| 41 | + * License. You may obtain a copy of the License at: |
| 42 | + * opensource.org/licenses/BSD-3-Clause |
61 | 43 | * |
62 | 44 | ****************************************************************************** |
63 | 45 | */ |
|
132 | 114 | * @{ |
133 | 115 | */ |
134 | 116 |
|
135 | | -/******************************************************************************* |
136 | | -* Clock Definitions |
137 | | -*******************************************************************************/ |
138 | | -#if defined(STM32F100xB) ||defined(STM32F100xE) |
139 | | - uint32_t SystemCoreClock = 24000000U; /*!< System Clock Frequency (Core Clock) */ |
140 | | -#else /*!< HSI Selected as System Clock source */ |
141 | | - uint32_t SystemCoreClock = 72000000U; /*!< System Clock Frequency (Core Clock) */ |
142 | | -#endif |
| 117 | + /* This variable is updated in three ways: |
| 118 | + 1) by calling CMSIS function SystemCoreClockUpdate() |
| 119 | + 2) by calling HAL API function HAL_RCC_GetHCLKFreq() |
| 120 | + 3) each time HAL_RCC_ClockConfig() is called to configure the system clock frequency |
| 121 | + Note: If you use this function to configure the system clock; then there |
| 122 | + is no need to call the 2 first functions listed above, since SystemCoreClock |
| 123 | + variable is updated automatically. |
| 124 | + */ |
| 125 | +uint32_t SystemCoreClock = 16000000; |
143 | 126 |
|
144 | 127 | const uint8_t AHBPrescTable[16U] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9}; |
145 | 128 | const uint8_t APBPrescTable[8U] = {0, 0, 0, 0, 1, 2, 3, 4}; |
|
0 commit comments