aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/ports/STM32/STM32F4xx/stm32_rcc.h
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2018-01-17 14:55:12 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2018-01-17 14:55:12 +0000
commitc953aa5ac86e4f913c41333a773a0903e0860d35 (patch)
treed2c00d4f0eaf25892e5d4f4ade85b2866e2c38de /os/hal/ports/STM32/STM32F4xx/stm32_rcc.h
parentdf330879bb5c5630e847e2e9eec471080b0d18a4 (diff)
downloadChibiOS-c953aa5ac86e4f913c41333a773a0903e0860d35.tar.gz
ChibiOS-c953aa5ac86e4f913c41333a773a0903e0860d35.tar.bz2
ChibiOS-c953aa5ac86e4f913c41333a773a0903e0860d35.zip
Defaulted all STM32 drivers to enable peripheral clocks during stop/sleep modes. Now RCC macros are able to set or clear the LP bit of a peripheral.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@11300 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/ports/STM32/STM32F4xx/stm32_rcc.h')
-rw-r--r--os/hal/ports/STM32/STM32F4xx/stm32_rcc.h21
1 files changed, 14 insertions, 7 deletions
diff --git a/os/hal/ports/STM32/STM32F4xx/stm32_rcc.h b/os/hal/ports/STM32/STM32F4xx/stm32_rcc.h
index 0d0435c4d..caa4db8bd 100644
--- a/os/hal/ports/STM32/STM32F4xx/stm32_rcc.h
+++ b/os/hal/ports/STM32/STM32F4xx/stm32_rcc.h
@@ -62,6 +62,8 @@
RCC->APB1ENR |= (mask); \
if (lp) \
RCC->APB1LPENR |= (mask); \
+ else \
+ RCC->APB1LPENR &= ~(mask); \
}
/**
@@ -73,7 +75,6 @@
*/
#define rccDisableAPB1(mask) { \
RCC->APB1ENR &= ~(mask); \
- RCC->APB1LPENR &= ~(mask); \
}
/**
@@ -97,7 +98,10 @@
*/
#define rccEnableAPB2(mask, lp) { \
RCC->APB2ENR |= (mask); \
- RCC->APB2LPENR |= (mask); \
+ if (lp) \
+ RCC->APB2LPENR |= (mask); \
+ else \
+ RCC->APB2LPENR &= ~(mask); \
}
/**
@@ -109,7 +113,6 @@
*/
#define rccDisableAPB2(mask) { \
RCC->APB2ENR &= ~(mask); \
- RCC->APB2LPENR &= ~(mask); \
}
/**
@@ -134,7 +137,10 @@
*/
#define rccEnableAHB1(mask, lp) { \
RCC->AHB1ENR |= (mask); \
- RCC->AHB1LPENR |= (mask); \
+ if (lp) \
+ RCC->AHB1LPENR |= (mask); \
+ else \
+ RCC->AHB1LPENR &= ~(mask); \
}
/**
@@ -146,7 +152,6 @@
*/
#define rccDisableAHB1(mask) { \
RCC->AHB1ENR &= ~(mask); \
- RCC->AHB1LPENR &= ~(mask); \
}
/**
@@ -173,6 +178,8 @@
RCC->AHB2ENR |= (mask); \
if (lp) \
RCC->AHB2LPENR |= (mask); \
+ else \
+ RCC->AHB2LPENR &= ~(mask); \
}
/**
@@ -184,7 +191,6 @@
*/
#define rccDisableAHB2(mask) { \
RCC->AHB2ENR &= ~(mask); \
- RCC->AHB2LPENR &= ~(mask); \
}
/**
@@ -211,6 +217,8 @@
RCC->AHB3ENR |= (mask); \
if (lp) \
RCC->AHB3LPENR |= (mask); \
+ else \
+ RCC->AHB3LPENR &= ~(mask); \
}
/**
@@ -222,7 +230,6 @@
*/
#define rccDisableAHB3(mask) { \
RCC->AHB3ENR &= ~(mask); \
- RCC->AHB3LPENR &= ~(mask); \
}
/**