aboutsummaryrefslogtreecommitdiff
path: root/lib/stm32/f1/gpio.c
diff options
context:
space:
mode:
authorUwe Hermann2011-11-16 19:31:47 +0100
committerUwe Hermann2011-11-17 00:09:27 +0100
commit8725bc51717cce5ac06cc49ab33416099eeca6b1 (patch)
tree06b94a8fc554474d87f19b68b3e1619705928472 /lib/stm32/f1/gpio.c
parent6e7403f76943f97089e741100b32c2f0a4795a97 (diff)
lib/stm32/f1: Coding-style fixes.
Diffstat (limited to 'lib/stm32/f1/gpio.c')
-rw-r--r--lib/stm32/f1/gpio.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/stm32/f1/gpio.c b/lib/stm32/f1/gpio.c
index f1ea12c..347e800 100644
--- a/lib/stm32/f1/gpio.c
+++ b/lib/stm32/f1/gpio.c
@@ -47,7 +47,7 @@ void gpio_set_mode(u32 gpioport, u8 mode, u8 cnf, u16 gpios)
*/
crl = GPIO_CRL(gpioport);
crh = GPIO_CRH(gpioport);
-
+
/* Iterate over all bits, use i as the bitnumber. */
for (i = 0; i < 16; i++) {
/* Only set the config if the bit is set in gpios. */
@@ -61,7 +61,7 @@ void gpio_set_mode(u32 gpioport, u8 mode, u8 cnf, u16 gpios)
tmp32 = (i < 8) ? crl : crh;
/* Modify bits are needed. */
- tmp32 &= ~(0b1111 << offset); /* Clear the bits first. */
+ tmp32 &= ~(0xf << offset); /* Clear the bits first. */
tmp32 |= (mode << offset) | (cnf << (offset + 2));
/* Write tmp32 into crl or crh, leave the other unchanged. */
@@ -113,6 +113,6 @@ void gpio_port_config_lock(u32 gpioport, u16 gpios)
GPIO_LCKR(gpioport) = GPIO_LCKK | gpios; /* Set LCKK. */
reg32 = GPIO_LCKR(gpioport); /* Read LCKK. */
reg32 = GPIO_LCKR(gpioport); /* Read LCKK again. */
-
+
/* If (reg32 & GPIO_LCKK) is true, the lock is now active. */
}