aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/ports/STM32/STM32L1xx
diff options
context:
space:
mode:
Diffstat (limited to 'os/hal/ports/STM32/STM32L1xx')
-rw-r--r--os/hal/ports/STM32/STM32L1xx/stm32_rcc.h18
1 files changed, 15 insertions, 3 deletions
diff --git a/os/hal/ports/STM32/STM32L1xx/stm32_rcc.h b/os/hal/ports/STM32/STM32L1xx/stm32_rcc.h
index 1c52db0a8..11cbe332c 100644
--- a/os/hal/ports/STM32/STM32L1xx/stm32_rcc.h
+++ b/os/hal/ports/STM32/STM32L1xx/stm32_rcc.h
@@ -65,6 +65,7 @@
RCC->APB1LPENR |= (mask); \
else \
RCC->APB1LPENR &= ~(mask); \
+ (void)RCC->APB1LPENR; \
}
/**
@@ -76,6 +77,8 @@
*/
#define rccDisableAPB1(mask) { \
RCC->APB1ENR &= ~(mask); \
+ RCC->APB1LPENR &= ~(mask); \
+ (void)RCC->APB1LPENR; \
}
/**
@@ -87,7 +90,8 @@
*/
#define rccResetAPB1(mask) { \
RCC->APB1RSTR |= (mask); \
- RCC->APB1RSTR = 0; \
+ RCC->APB1RSTR &= ~(mask); \
+ (void)RCC->APB1RSTR; \
}
/**
@@ -104,6 +108,7 @@
RCC->APB2LPENR |= (mask); \
else \
RCC->APB2LPENR &= ~(mask); \
+ (void)RCC->APB2LPENR; \
}
/**
@@ -115,6 +120,8 @@
*/
#define rccDisableAPB2(mask) { \
RCC->APB2ENR &= ~(mask); \
+ RCC->APB2LPENR &= ~(mask); \
+ (void)RCC->APB2LPENR; \
}
/**
@@ -126,7 +133,8 @@
*/
#define rccResetAPB2(mask) { \
RCC->APB2RSTR |= (mask); \
- RCC->APB2RSTR = 0; \
+ RCC->APB2RSTR &= ~(mask); \
+ (void)RCC->APB2RSTR; \
}
/**
@@ -143,6 +151,7 @@
RCC->AHBLPENR |= (mask); \
else \
RCC->AHBLPENR &= ~(mask); \
+ (void)RCC->AHBLPENR; \
}
/**
@@ -154,6 +163,8 @@
*/
#define rccDisableAHB(mask) { \
RCC->AHBENR &= ~(mask); \
+ RCC->AHBLPENR &= ~(mask); \
+ (void)RCC->AHBLPENR; \
}
/**
@@ -165,7 +176,8 @@
*/
#define rccResetAHB(mask) { \
RCC->AHBRSTR |= (mask); \
- RCC->AHBRSTR = 0; \
+ RCC->AHBRSTR &= ~(mask); \
+ (void)RCC->AHBRSTR; \
}
/** @} */