Skip to content

Commit 2bc21a7

Browse files
committed
Code misalignment correction
1 parent b77627d commit 2bc21a7

File tree

3 files changed

+101
-101
lines changed

3 files changed

+101
-101
lines changed

libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32L0/TARGET_DISCO_L053C8/system_stm32l0xx.c

Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@
66
* @date 8-January-2016
77
* @brief CMSIS Cortex-M0+ Device Peripheral Access Layer System Source File.
88
*
9-
* This file provides two functions and one global variable to be called from
9+
* This file provides two functions and one global variable to be called from
1010
* user application:
11-
* - SystemInit(): This function is called at startup just after reset and
11+
* - SystemInit(): This function is called at startup just after reset and
1212
* before branch to main program. This call is made inside
1313
* the "startup_stm32l0xx.s" file.
1414
*
1515
* - SystemCoreClock variable: Contains the core clock (HCLK), it can be used
16-
* by the user application to setup the SysTick
16+
* by the user application to setup the SysTick
1717
* timer or configure other parameters.
18-
*
18+
*
1919
* - SystemCoreClockUpdate(): Updates the variable SystemCoreClock and must
2020
* be called whenever the core clock is changed
2121
* during program execution.
@@ -36,7 +36,7 @@
3636
* APB2CLK (MHz) | 32 | 32
3737
*-----------------------------------------------------------------------------
3838
* USB capable (48 MHz precise clock) | YES | YES
39-
*-----------------------------------------------------------------------------
39+
*-----------------------------------------------------------------------------
4040
******************************************************************************
4141
* @attention
4242
*
@@ -73,23 +73,23 @@
7373

7474
/** @addtogroup stm32l0xx_system
7575
* @{
76-
*/
77-
76+
*/
77+
7878
/** @addtogroup STM32L0xx_System_Private_Includes
7979
* @{
8080
*/
8181

8282
#include "stm32l0xx.h"
8383
#include "hal_tick.h"
8484

85-
#if !defined (HSE_VALUE)
85+
#if !defined (HSE_VALUE)
8686
#define HSE_VALUE ((uint32_t)8000000) /*!< Value of the External oscillator in Hz */
8787
#endif /* HSE_VALUE */
8888

8989
#if !defined (MSI_VALUE)
9090
#define MSI_VALUE ((uint32_t)2000000) /*!< Value of the Internal oscillator in Hz*/
9191
#endif /* MSI_VALUE */
92-
92+
9393
#if !defined (HSI_VALUE)
9494
#define HSI_VALUE ((uint32_t)16000000) /*!< Value of the Internal oscillator in Hz*/
9595
#endif /* HSI_VALUE */
@@ -115,7 +115,7 @@
115115
/*!< Uncomment the following line if you need to relocate your vector Table in
116116
Internal SRAM. */
117117
/* #define VECT_TAB_SRAM */
118-
#define VECT_TAB_OFFSET 0x00 /*!< Vector Table base offset field.
118+
#define VECT_TAB_OFFSET 0x00 /*!< Vector Table base offset field.
119119
This value must be a multiple of 0x200. */
120120
/******************************************************************************/
121121
/**
@@ -140,14 +140,14 @@
140140
/* This variable is updated in three ways:
141141
1) by calling CMSIS function SystemCoreClockUpdate()
142142
2) by calling HAL API function HAL_RCC_GetHCLKFreq()
143-
3) each time HAL_RCC_ClockConfig() is called to configure the system clock frequency
143+
3) each time HAL_RCC_ClockConfig() is called to configure the system clock frequency
144144
Note: If you use this function to configure the system clock; then there
145145
is no need to call the 2 first functions listed above, since SystemCoreClock
146146
variable is updated automatically.
147147
*/
148148
uint32_t SystemCoreClock = 32000000;
149-
const uint8_t AHBPrescTable[16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9};
150-
const uint8_t PLLMulTable[9] = {3, 4, 6, 8, 12, 16, 24, 32, 48};
149+
const uint8_t AHBPrescTable[16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9};
150+
const uint8_t PLLMulTable[9] = {3, 4, 6, 8, 12, 16, 24, 32, 48};
151151

152152
/**
153153
* @}
@@ -177,19 +177,19 @@ uint8_t SetSysClock_PLL_HSI(void);
177177
* @retval None
178178
*/
179179
void SystemInit (void)
180-
{
180+
{
181181
/*!< Set MSION bit */
182182
RCC->CR |= (uint32_t)0x00000100;
183183

184184
/*!< Reset SW[1:0], HPRE[3:0], PPRE1[2:0], PPRE2[2:0], MCOSEL[2:0] and MCOPRE[2:0] bits */
185185
RCC->CFGR &= (uint32_t) 0x88FF400C;
186-
186+
187187
/*!< Reset HSION, HSIDIVEN, HSEON, CSSON and PLLON bits */
188188
RCC->CR &= (uint32_t)0xFEF6FFF6;
189-
189+
190190
/*!< Reset HSI48ON bit */
191191
RCC->CRRCR &= (uint32_t)0xFFFFFFFE;
192-
192+
193193
/*!< Reset HSEBYP bit */
194194
RCC->CR &= (uint32_t)0xFFFBFFFF;
195195

@@ -198,7 +198,7 @@ void SystemInit (void)
198198

199199
/*!< Disable all interrupts */
200200
RCC->CIER = 0x00000000;
201-
201+
202202
/* Configure the Vector Table location add offset address ------------------*/
203203
#ifdef VECT_TAB_SRAM
204204
SCB->VTOR = SRAM_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal SRAM */
@@ -224,34 +224,34 @@ void SystemInit (void)
224224
* The SystemCoreClock variable contains the core clock (HCLK), it can
225225
* be used by the user application to setup the SysTick timer or configure
226226
* other parameters.
227-
*
227+
*
228228
* @note Each time the core clock (HCLK) changes, this function must be called
229229
* to update SystemCoreClock variable value. Otherwise, any configuration
230-
* based on this variable will be incorrect.
231-
*
232-
* @note - The system frequency computed by this function is not the real
233-
* frequency in the chip. It is calculated based on the predefined
230+
* based on this variable will be incorrect.
231+
*
232+
* @note - The system frequency computed by this function is not the real
233+
* frequency in the chip. It is calculated based on the predefined
234234
* constant and the selected clock source:
235-
*
236-
* - If SYSCLK source is MSI, SystemCoreClock will contain the MSI
235+
*
236+
* - If SYSCLK source is MSI, SystemCoreClock will contain the MSI
237237
* value as defined by the MSI range.
238-
*
238+
*
239239
* - If SYSCLK source is HSI, SystemCoreClock will contain the HSI_VALUE(*)
240-
*
240+
*
241241
* - If SYSCLK source is HSE, SystemCoreClock will contain the HSE_VALUE(**)
242-
*
242+
*
243243
* - If SYSCLK source is PLL, SystemCoreClock will contain the HSE_VALUE(**)
244244
* or HSI_VALUE(*) multiplied/divided by the PLL factors.
245-
*
245+
*
246246
* (*) HSI_VALUE is a constant defined in stm32l0xx_hal.h file (default value
247247
* 16 MHz) but the real value may vary depending on the variations
248-
* in voltage and temperature.
249-
*
248+
* in voltage and temperature.
249+
*
250250
* (**) HSE_VALUE is a constant defined in stm32l0xx_hal.h file (default value
251251
* 8 MHz), user has to ensure that HSE_VALUE is same as the real
252252
* frequency of the crystal used. Otherwise, this function may
253253
* have wrong result.
254-
*
254+
*
255255
* - The result of this function could be not correct when using fractional
256256
* value for HSE crystal.
257257
* @param None
@@ -263,7 +263,7 @@ void SystemCoreClockUpdate (void)
263263

264264
/* Get SYSCLK source -------------------------------------------------------*/
265265
tmp = RCC->CFGR & RCC_CFGR_SWS;
266-
266+
267267
switch (tmp)
268268
{
269269
case 0x00: /* MSI used as system clock */
@@ -282,7 +282,7 @@ void SystemCoreClockUpdate (void)
282282
plldiv = RCC->CFGR & RCC_CFGR_PLLDIV;
283283
pllmul = PLLMulTable[(pllmul >> 18)];
284284
plldiv = (plldiv >> 22) + 1;
285-
285+
286286
pllsource = RCC->CFGR & RCC_CFGR_PLLSRC;
287287

288288
if (pllsource == 0x00)
@@ -311,8 +311,8 @@ void SystemCoreClockUpdate (void)
311311
/**
312312
* @brief Configures the System clock source, PLL Multiplier and Divider factors,
313313
* AHB/APBx prescalers and Flash settings
314-
* @note This function should be called only once the RCC clock configuration
315-
* is reset to the default reset state (done in SystemInit() function).
314+
* @note This function should be called only once the RCC clock configuration
315+
* is reset to the default reset state (done in SystemInit() function).
316316
* @param None
317317
* @retval None
318318
*/
@@ -338,7 +338,7 @@ void SetSysClock(void)
338338
}
339339
}
340340
}
341-
341+
342342
/* Output clock on MCO1 pin(PA8) for debugging purpose */
343343
//HAL_RCC_MCOConfig(RCC_MCO1, RCC_MCO1SOURCE_SYSCLK, RCC_MCODIV_1);
344344
//HAL_RCC_MCOConfig(RCC_MCO1, RCC_MCO1SOURCE_HSI48, RCC_MCODIV_1);
@@ -358,13 +358,13 @@ uint8_t SetSysClock_PLL_HSE(uint8_t bypass)
358358
{
359359
return 0;
360360
}
361-
362-
/* The voltage scaling allows optimizing the power consumption when the device is
363-
clocked below the maximum system frequency, to update the voltage scaling value
361+
362+
/* The voltage scaling allows optimizing the power consumption when the device is
363+
clocked below the maximum system frequency, to update the voltage scaling value
364364
regarding system frequency refer to product datasheet. */
365365
__PWR_CLK_ENABLE();
366366
__HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);
367-
367+
368368
/* Enable HSE and HSI48 oscillators and activate PLL with HSE as source */
369369
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE | RCC_OSCILLATORTYPE_HSI | RCC_OSCILLATORTYPE_HSI48;
370370
if (bypass == 0)
@@ -389,7 +389,7 @@ uint8_t SetSysClock_PLL_HSE(uint8_t bypass)
389389
{
390390
return 0; // FAIL
391391
}
392-
392+
393393
/* Select PLL as system clock source and configure the HCLK, PCLK1 and PCLK2 clocks dividers */
394394
RCC_ClkInitStruct.ClockType = (RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2);
395395
RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; // 32 MHz
@@ -406,7 +406,7 @@ uint8_t SetSysClock_PLL_HSE(uint8_t bypass)
406406
// HAL_RCC_MCOConfig(RCC_MCO1, RCC_MCO1SOURCE_HSE, RCC_MCODIV_2); // 4 MHz
407407
//else
408408
// HAL_RCC_MCOConfig(RCC_MCO1, RCC_MCO1SOURCE_HSE, RCC_MCODIV_1); // 8 MHz
409-
409+
410410
return 1; // OK
411411
}
412412
#endif
@@ -419,12 +419,12 @@ uint8_t SetSysClock_PLL_HSI(void)
419419
RCC_ClkInitTypeDef RCC_ClkInitStruct;
420420
RCC_OscInitTypeDef RCC_OscInitStruct;
421421

422-
/* The voltage scaling allows optimizing the power consumption when the device is
423-
clocked below the maximum system frequency, to update the voltage scaling value
422+
/* The voltage scaling allows optimizing the power consumption when the device is
423+
clocked below the maximum system frequency, to update the voltage scaling value
424424
regarding system frequency refer to product datasheet. */
425425
__PWR_CLK_ENABLE();
426426
__HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);
427-
427+
428428
/* Enable HSI and HSI48 oscillators and activate PLL with HSI as source */
429429
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI | RCC_OSCILLATORTYPE_HSE | RCC_OSCILLATORTYPE_HSI48;
430430
RCC_OscInitStruct.HSEState = RCC_HSE_OFF;
@@ -442,7 +442,7 @@ uint8_t SetSysClock_PLL_HSI(void)
442442
{
443443
return 0; // FAIL
444444
}
445-
445+
446446
/* Select PLL as system clock source and configure the HCLK, PCLK1 and PCLK2 clocks dividers */
447447
RCC_ClkInitStruct.ClockType = (RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2);
448448
RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; // 32 MHz
@@ -456,7 +456,7 @@ uint8_t SetSysClock_PLL_HSI(void)
456456

457457
/* Output clock on MCO1 pin(PA8) for debugging purpose */
458458
//HAL_RCC_MCOConfig(RCC_MCO1, RCC_MCO1SOURCE_HSI, RCC_MCODIV_1); // 16 MHz
459-
459+
460460
return 1; // OK
461461
}
462462

0 commit comments

Comments
 (0)