aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/ports/STM32/STM32L4xx
diff options
context:
space:
mode:
Diffstat (limited to 'os/hal/ports/STM32/STM32L4xx')
-rw-r--r--os/hal/ports/STM32/STM32L4xx/hal_lld.c4
-rw-r--r--os/hal/ports/STM32/STM32L4xx/stm32_rcc.h24
2 files changed, 26 insertions, 2 deletions
diff --git a/os/hal/ports/STM32/STM32L4xx/hal_lld.c b/os/hal/ports/STM32/STM32L4xx/hal_lld.c
index 06dc36d58..4ea836e69 100644
--- a/os/hal/ports/STM32/STM32L4xx/hal_lld.c
+++ b/os/hal/ports/STM32/STM32L4xx/hal_lld.c
@@ -120,7 +120,7 @@ void hal_lld_init(void) {
rccResetAPB2(~0);
/* PWR clock enabled.*/
- rccEnablePWRInterface(FALSE);
+ rccEnablePWRInterface(true);
/* Initializes the backup domain.*/
hal_lld_backup_domain_init();
@@ -367,7 +367,7 @@ void stm32_clock_init(void) {
/* SYSCFG clock enabled here because it is a multi-functional unit shared
among multiple drivers.*/
- rccEnableAPB2(RCC_APB2ENR_SYSCFGEN, TRUE);
+ rccEnableAPB2(RCC_APB2ENR_SYSCFGEN, true);
}
/** @} */
diff --git a/os/hal/ports/STM32/STM32L4xx/stm32_rcc.h b/os/hal/ports/STM32/STM32L4xx/stm32_rcc.h
index df7e93c83..3d1711da4 100644
--- a/os/hal/ports/STM32/STM32L4xx/stm32_rcc.h
+++ b/os/hal/ports/STM32/STM32L4xx/stm32_rcc.h
@@ -60,6 +60,10 @@
*/
#define rccEnableAPB1R1(mask, lp) { \
RCC->APB1ENR1 |= (mask); \
+ if (lp) \
+ RCC->APB1SMENR1 |= (mask); \
+ else \
+ RCC->APB1SMENR1 &= ~(mask); \
}
/**
@@ -95,6 +99,10 @@
*/
#define rccEnableAPB1R2(mask, lp) { \
RCC->APB1ENR2 |= (mask); \
+ if (lp) \
+ RCC->APB1SMENR2 |= (mask); \
+ else \
+ RCC->APB1SMENR2 &= ~(mask); \
}
/**
@@ -130,6 +138,10 @@
*/
#define rccEnableAPB2(mask, lp) { \
RCC->APB2ENR |= (mask); \
+ if (lp) \
+ RCC->APB2SMENR |= (mask); \
+ else \
+ RCC->APB2SMENR &= ~(mask); \
}
/**
@@ -165,6 +177,10 @@
*/
#define rccEnableAHB1(mask, lp) { \
RCC->AHB1ENR |= (mask); \
+ if (lp) \
+ RCC->AHB1SMENR |= (mask); \
+ else \
+ RCC->AHB1SMENR &= ~(mask); \
}
/**
@@ -200,6 +216,10 @@
*/
#define rccEnableAHB2(mask, lp) { \
RCC->AHB2ENR |= (mask); \
+ if (lp) \
+ RCC->AHB2SMENR |= (mask); \
+ else \
+ RCC->AHB2SMENR &= ~(mask); \
}
/**
@@ -235,6 +255,10 @@
*/
#define rccEnableAHB3(mask, lp) { \
RCC->AHB3ENR |= (mask); \
+ if (lp) \
+ RCC->AHB3SMENR |= (mask); \
+ else \
+ RCC->AHB3SMENR &= ~(mask); \
}
/**