Skip to content

Commit 3a79119

Browse files
committed
[F1] Update system source file
Signed-off-by: Frederic.Pillon <[email protected]>
1 parent b1789cc commit 3a79119

File tree

1 file changed

+15
-32
lines changed

1 file changed

+15
-32
lines changed

system/STM32F1xx/system_stm32f1xx.c

+15-32
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
******************************************************************************
33
* @file system_stm32f1xx.c
44
* @author MCD Application Team
5-
* @version V4.2.0
6-
* @date 31-March-2017
75
* @brief CMSIS Cortex-M3 Device Peripheral Access Layer System Source File.
86
*
97
* 1. This file provides two functions and one global variable to be called from
@@ -35,29 +33,13 @@
3533
******************************************************************************
3634
* @attention
3735
*
38-
* <h2><center>&copy; COPYRIGHT(c) 2017 STMicroelectronics</center></h2>
36+
* <h2><center>&copy; Copyright (c) 2017 STMicroelectronics.
37+
* All rights reserved.</center></h2>
3938
*
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
6143
*
6244
******************************************************************************
6345
*/
@@ -132,14 +114,15 @@
132114
* @{
133115
*/
134116

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;
143126

144127
const uint8_t AHBPrescTable[16U] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9};
145128
const uint8_t APBPrescTable[8U] = {0, 0, 0, 0, 1, 2, 3, 4};

0 commit comments

Comments
 (0)