Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit088209c

Browse files
ABOSTMfpistm
authored andcommitted
Group system IP clock enable in separate function called at init
This new function could be called by STM32duino_Low_Power librarySigned-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
1 parentba52cf2 commit088209c

File tree

6 files changed

+25
-17
lines changed

6 files changed

+25
-17
lines changed

‎cores/arduino/stm32/clock.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ typedef enum {
3737
uint32_tgetCurrentMillis(void);
3838
uint32_tgetCurrentMicros(void);
3939

40+
voidconfigIPClock(void);
4041
voidenableClock(sourceClock_tsource);
4142
voidconfigHSECapacitorTuning(void);
4243

‎cores/arduino/stm32/usb/usbd_if.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,6 @@ WEAK void USBD_reenumerate(void)
151151
* do not manage the internal pull-up, so manage
152152
* internal pull-up manually.
153153
*/
154-
__HAL_RCC_SYSCFG_CLK_ENABLE();
155154
LL_SYSCFG_DisableUSBPullUp();
156155
delay(USBD_ENUM_DELAY);
157156
LL_SYSCFG_EnableUSBPullUp();

‎libraries/SrcWrapper/src/stm32/clock.c

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,28 @@ void configHSECapacitorTuning(void)
152152
#endif
153153
}
154154

155+
/**
156+
* @brief This function enables clocks for some system IP
157+
* @param None
158+
* @retval None
159+
*/
160+
voidconfigIPClock(void)
161+
{
162+
#ifdefHSEM_BASE
163+
__HAL_RCC_HSEM_CLK_ENABLE();
164+
#endif
165+
166+
#if defined(__HAL_RCC_PWR_CLK_ENABLE)
167+
/* Enable PWR clock, needed for example: voltage scaling, low power ... */
168+
__HAL_RCC_PWR_CLK_ENABLE();
169+
#endif
170+
171+
#if defined(__HAL_RCC_SYSCFG_CLK_ENABLE)
172+
/* Enable SYSCFG clock, needed for example: Pin remap or Analog switch ... */
173+
__HAL_RCC_SYSCFG_CLK_ENABLE();
174+
#endif
175+
}
176+
155177
#ifdef__cplusplus
156178
}
157179
#endif

‎libraries/SrcWrapper/src/stm32/hw_config.c

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ extern "C" {
2626
*/
2727
voidhw_config_init(void)
2828
{
29+
configIPClock();
30+
2931
/* Init DWT if present */
3032
#ifdefDWT_BASE
3133
dwt_init();
@@ -34,17 +36,8 @@ void hw_config_init(void)
3436
/* Initialize the HAL */
3537
HAL_Init();
3638

37-
#ifdefHSEM_BASE
38-
__HAL_RCC_HSEM_CLK_ENABLE();
39-
#endif
40-
4139
configHSECapacitorTuning();
4240

43-
#if defined(__HAL_RCC_PWR_CLK_ENABLE)
44-
/* Enable PWR clock, needed for example: voltage scaling, low power ... */
45-
__HAL_RCC_PWR_CLK_ENABLE();
46-
#endif
47-
4841
/* Configure the system clock */
4942
SystemClock_Config();
5043

‎libraries/SrcWrapper/src/stm32/pinmap.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ void pin_function(PinName pin, int function)
7474

7575
/* Handle pin remap if any */
7676
#if defined(LL_SYSCFG_PIN_RMP_PA11)&& defined(LL_SYSCFG_PIN_RMP_PA12)|| defined(SYSCFG_CFGR1_PA11_PA12_RMP)
77-
__HAL_RCC_SYSCFG_CLK_ENABLE();
7877
switch (pin&PNAME_MASK) {
7978
#if defined(SYSCFG_CFGR1_PA11_PA12_RMP)
8079
/* Disable PIN pair PA11/12 mapped instead of PA9/10 */

‎libraries/SrcWrapper/src/stm32/uart.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -272,12 +272,6 @@ void uart_init(serial_t *obj, uint32_t baudrate, uint32_t databits, uint32_t par
272272
}
273273
#endif
274274

275-
#if defined(STM32F091xC)|| defined (STM32F098xx)
276-
/* Enable SYSCFG Clock */
277-
/* Required to get SYSCFG interrupt status register */
278-
__HAL_RCC_SYSCFG_CLK_ENABLE();
279-
#endif
280-
281275
/* Configure UART GPIO pins */
282276
pinmap_pinout(obj->pin_tx,PinMap_UART_TX);
283277
if (uart_rx!=NP) {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp